Skip to content

Commit 54daddb

Browse files
Merge pull request #262774 from mrbullwinkle/mrb_01_09_2024_fix_snippet
[Azure OpenAI]
2 parents bf7ca41 + 79db6d2 commit 54daddb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

articles/ai-services/openai/how-to/function-calling.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ To force the model to call a specific function set the `tool_choice` parameter w
5151
> The default behavior (`tool_choice: "auto"`) is for the model to decide on its own whether to call a function and if so which function to call.
5252
5353
```python
54+
import os
5455
from openai import AzureOpenAI
5556
import json
5657

@@ -60,8 +61,6 @@ client = AzureOpenAI(
6061
api_version="2023-12-01-preview"
6162
)
6263

63-
from openai import OpenAI
64-
import json
6564

6665
# Example function hard coded to return the same weather
6766
# In production, this could be your backend API or an external API

0 commit comments

Comments
 (0)