You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,17 @@
2
2
This code can be copied and pasted into a code snippet with the the WPCode Wordpress plugin (to appear with a shortcode). See the results of this code at https://onebread.co.uk
3
3
4
4
Pre-requisites:
5
-
- You will need an OpenAI API key (see https://openai.com/blog/openai-api for details)
5
+
- You will need an OpenAI API key (see https://openai.com/blog/openai-api for details) - replace "<YOUR_API_KEY>" with this value in lines 21 and 67 of the code
6
6
7
-
The end to end execution of this code costs around $0.15 at the point of writing
7
+
The end to end execution of this code costs around $0.11 at the point of writing (previously $0.15 when using the completions endpoint with davinci-003
8
8
9
9
When a user enters a bible passage and clicks on submit, the following happens:
10
10
11
11
1. Checks whether there's a post for this bible passage already, if not...
12
-
2. Calls off to text-davinci-003 completions API to get a vivid description of the bible passage in 20 words (temp 1)
13
-
3. Passes this description to dall.e API to get an image back as b64 file
12
+
2. Calls off to gpt-3.5-turbo-1106 completions API to get a vivid description of the bible passage in 20 words (temp 1)
13
+
3. Passes this description to dall.e API (version 2) to get an image back as b64 file
14
14
4. Uploads the image to the Wordpress media library and adds alt text
15
-
5. Calls off to text-davinci-003 completions API to get the bible passage summarised as a limerick (temp 0.5)
16
-
6. Calls off to text-davinci-003 completions API to get some practical application point suggestions (temp 0.7)
17
-
7. Calls off to text-davinci-003 completions API to get a list of related passages (temp 0.5)
15
+
5. Calls off to gpt-3.5-turbo-1106 completions API to get the bible passage summarised as a limerick (temp 0.5)
16
+
6. Calls off to gpt-3.5-turbo-1106 completions API to get some practical application point suggestions (temp 0.7)
17
+
7. Calls off to gpt-3.5-turbo-1106 completions API to get a list of related passages (temp 0.5)
18
18
8. Writes all of these to a Wordpress post with the category set to be the book of the bible
0 commit comments