-
Notifications
You must be signed in to change notification settings - Fork 96
Update openai examples in cookbook #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
@@ -1,6 +1,6 @@ | |||
azure-ai-inference~=1.0.0b4 | |||
azure-ai-evaluation~=1.1.0 | |||
openai~=1.37.1 | |||
openai~=1.72.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old package causes this error:
openai/openai-python#1903
@@ -14,7 +14,7 @@ To run these notebooks, click on a link below to open it in Codespaces and selec | |||
To run these scripts, open your terminal and run a command like: | |||
|
|||
```shell | |||
python3 samples/python/openai/basic.py | |||
python samples/python/openai/basic.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python3 is only on Linux/Mac boxes, not Windows
@@ -259,8 +259,10 @@ | |||
"\n", | |||
"# Print the streamed response\n", | |||
"for update in response:\n", | |||
" if update.choices[0].delta.content:\n", | |||
" print(update.choices[0].delta.content, end=\"\")\n" | |||
" if update.choices:\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Azure AI has a bug/feature where first choices is null, yay
@@ -34,7 +34,9 @@ | |||
|
|||
# Print the streamed response | |||
for update in response: | |||
if update.choices[0].delta.content: | |||
print(update.choices[0].delta.content, end="") | |||
if update.choices: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
No description provided.