Skip to content

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

Merged
merged 2 commits into from
May 9, 2025
Merged

Conversation

pamelafox
Copy link
Contributor

No description provided.

@Copilot Copilot AI review requested due to automatic review settings April 11, 2025 22:31
Copy link

@Copilot Copilot AI left a 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
Copy link
Contributor Author

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
Copy link
Contributor Author

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",
Copy link
Contributor Author

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:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

@sgoedecke sgoedecke merged commit 273874f into github:main May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants