Skip to content

Commit

Permalink
API call update
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis2054 authored Dec 4, 2023
1 parent f524122 commit 47ecc39
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Chapter09/Summarizing_with_ChatGPT.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
"\n",
"**December 4,2023 OpenAI API update** \n",
"\n",
"API Chat completion call changed from ```openai.ChatCompletion.create``` to ```client.chat.completions.create with client= [YOUR OPENAI CLIENT]```\n"
"API Chat completion call changed from ```openai.ChatCompletion.create``` to ```client.chat.completions.create with client= [YOUR OPENAI CLIENT]```\n",
"\n",
"Also to print the content of the response use : ```print(response.choices[0].message.content)```\n",
"\n",
"\n"
]
},
{
Expand Down Expand Up @@ -287,9 +291,9 @@
],
"source": [
"uinput=\"Summarize the following paragraph: During such processes, cells sense the environment and respond to external factors that induce a certain direction of motion towards specific targets (taxis): this results in a persistent migration in a certain preferential direction. The guidance cues leading to directed migration may be biochemical or biophysical. Biochemical cues can be, for example, soluble factors or growth factors that give rise to chemotaxis, which involves a mono-directional stimulus. Other cues generating mono-directional stimuli include, for instance, bound ligands to the substratum that induce haptotaxis, durotaxis, that involves migration towards regions with an increasing stiffness of the ECM, electrotaxis, also known as galvanotaxis, that prescribes a directed motion guided by an electric field or current, or phototaxis, referring to the movement oriented by a stimulus of light [34]. Important biophysical cues are some of the properties of the extracellular matrix (ECM), first among all the alignment of collagen fibers and its stiffness. In particular, the fiber alignment is shown to stimulate contact guidance [22, 21].\"\n",
"text=dialog(uinput) #preparing the messages for ChatGPT\n",
"reponse=dialog(uinput) #preparing the messages for ChatGPT\n",
"print(\"Viewer request\",uinput)\n",
"print(\"ChatGPT response:\",text)"
"print(\"ChatGPT response:\",response.choices[0].message.content)"
]
},
{
Expand Down Expand Up @@ -333,9 +337,9 @@
"source": [
"#amoeboid \n",
"uinput=\"Explain this sentence: I don't use a false foot to move forward so I am not an amoeboid today.\"\n",
"text=dialog(uinput) #preparing the messages for ChatGPT\n",
"respone=dialog(uinput) #preparing the messages for ChatGPT\n",
"print(\"Viewer request\",uinput)\n",
"print(\"ChatGPT response:\",text)\n"
"print(\"ChatGPT response:\",response.choices[0].message.content)\n"
]
},
{
Expand Down Expand Up @@ -375,9 +379,9 @@
"source": [
"#The verb to ice pucks\n",
"uinput=\"English to French: Icing pucks is fun!\"\n",
"text=dialog(uinput) #preparing the messages for ChatGPT\n",
"response=dialog(uinput) #preparing the messages for ChatGPT\n",
"print(\"Viewer request\",uinput)\n",
"print(\"ChatGPT response:\",text)"
"print(\"ChatGPT response:\",response.choices[0].message.content)"
]
},
{
Expand Down Expand Up @@ -415,9 +419,9 @@
"source": [
"#The verb to ice pucks\n",
"uinput=\"French to English: Glaçage des rondelles est amusant!!\"\n",
"text=dialog(uinput) #preparing the messages for ChatGPT\n",
"response=dialog(uinput) #preparing the messages for ChatGPT\n",
"print(\"Viewer request\",uinput)\n",
"print(\"ChatGPT response:\",text)"
"print(\"ChatGPT response:\",response.choices[0].message.content)"
]
},
{
Expand Down

0 comments on commit 47ecc39

Please sign in to comment.