Skip to content

Commit f3c6068

Browse files
authored
Array modifications
revised to add and remove commas to the messages array where needed
1 parent c3c39d3 commit f3c6068

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

articles/cognitive-services/openai/includes/chat-completion.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ response = openai.ChatCompletion.create(
3030
engine="gpt-35-turbo", # The deployment name you chose when you deployed the ChatGPT or GPT-4 model.
3131
messages=[
3232
{"role": "system", "content": "Assistant is a large language model trained by OpenAI."},
33-
{"role": "user", "content": "What's the difference between garbanzo beans and chickpeas?"},
33+
{"role": "user", "content": "What's the difference between garbanzo beans and chickpeas?"}
3434
]
3535
)
3636

@@ -103,8 +103,8 @@ A conversation with one example answer followed by a question would look like:
103103

104104
```
105105
{"role": "system", "content": "Provide some context and/or instructions to the model."},
106-
{"role": "user", "content": "Example question goes here."}
107-
{"role": "assistant", "content": "Example answer goes here."}
106+
{"role": "user", "content": "Example question goes here."},
107+
{"role": "assistant", "content": "Example answer goes here."},
108108
{"role": "user", "content": "First question/message for the model to actually respond to."}
109109
```
110110

@@ -180,7 +180,7 @@ This is only one example of how you can use few shot learning with ChatGPT and G
180180
{"role": "user", "content": "When do I need to file my taxes by?"},
181181
{"role": "assistant", "content": "In 2023, you will need to file your taxes by April 18th. The date falls after the usual April 15th deadline because April 15th falls on a Saturday in 2023. For more details, see https://www.irs.gov/filing/individuals/when-to-file."},
182182
{"role": "user", "content": "How can I check the status of my tax refund?"},
183-
{"role": "assistant", "content": "You can check the status of your tax refund by visiting https://www.irs.gov/refunds"},
183+
{"role": "assistant", "content": "You can check the status of your tax refund by visiting https://www.irs.gov/refunds"}
184184
```
185185

186186
#### Using Chat Completion for non-chat scenarios
@@ -300,4 +300,4 @@ The token counting portion of the code demonstrated previously, is a simplified
300300

301301
* [Learn more about Azure OpenAI](../overview.md).
302302
* Get started with the ChatGPT model with [the ChatGPT quickstart](../chatgpt-quickstart.md).
303-
* For more examples, check out the [Azure OpenAI Samples GitHub repository](https://github.com/Azure/openai-samples)
303+
* For more examples, check out the [Azure OpenAI Samples GitHub repository](https://github.com/Azure/openai-samples)

0 commit comments

Comments
 (0)