@@ -76,40 +76,25 @@ assistant = client.beta.assistants.create(
76
76
> With Azure OpenAI the ` model ` parameter requires model deployment name. If your model deployment name is different than the underlying model name then you would adjust your code to ` "model": "{your-custom-model-deployment-name}" ` .
77
77
78
78
``` console
79
- curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/assistants?api-version=2024-02-15 -preview \
79
+ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/assistants?api-version=2024-07-01 -preview \
80
80
-H "api-key: $AZURE_OPENAI_API_KEY" \
81
81
-H "Content-Type: application/json" \
82
82
-d '{
83
83
"instructions": "You are a weather bot. Use the provided functions to answer questions.",
84
- " tools": [{
84
+ tools= [{
85
85
"type": "function",
86
- "function": {
87
- "name": "getCurrentWeather",
88
- "description": "Get the weather in location",
89
- "parameters": {
90
- "type": "object",
91
- "properties": {
92
- "location": {"type": "string", "description": "The city and state e.g. San Francisco, CA"},
93
- "unit": {"type": "string", "enum": ["c", "f"]}
94
- },
95
- "required": ["location"]
96
- }
97
- }
98
- },
99
- {
100
- "type": "function",
101
- "function": {
102
- "name": "getNickname",
103
- "description": "Get the nickname of a city",
104
- "parameters": {
105
- "type": "object",
106
- "properties": {
107
- "location": {"type": "string", "description": "The city and state e.g. San Francisco, CA"}
108
- },
109
- "required": ["location"]
110
- }
111
- }
112
- }],
86
+ "function": {
87
+ "name": "get_weather",
88
+ "description": "Get the weather in location",
89
+ "parameters": {
90
+ "type": "object",
91
+ "properties": {
92
+ "location": {"type": "string", "description": "The city name, for example San Francisco"}
93
+ },
94
+ "required": ["location"]
95
+ }
96
+ }
97
+ }],
113
98
"model": "gpt-4-1106-preview"
114
99
}'
115
100
```
@@ -135,18 +120,10 @@ When you initiate a **Run** with a user Message that triggers the function, the
135
120
"id" : " call_abc123" ,
136
121
"type" : " function" ,
137
122
"function" : {
138
- "name" : " getCurrentWeather " ,
123
+ "name" : " get_weather " ,
139
124
"arguments" : " {\" location\" :\" San Francisco\" }"
140
125
}
141
126
},
142
- {
143
- "id" : " call_abc456" ,
144
- "type" : " function" ,
145
- "function" : {
146
- "name" : " getNickname" ,
147
- "arguments" : " {\" location\" :\" Los Angeles\" }"
148
- }
149
- }
150
127
]
151
128
}
152
129
},
@@ -222,16 +199,13 @@ else:
222
199
# [ REST] ( #tab/rest )
223
200
224
201
``` console
225
- curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/thread_abc123/runs/run_123/submit_tool_outputs?api-version=2024-02-15 -preview \
202
+ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/thread_abc123/runs/run_123/submit_tool_outputs?api-version=2024-07-01 -preview \
226
203
-H "Content-Type: application/json" \
227
- -H "api-key: $AZURE_OPENAI_API_KEY " \
204
+ -H "api-key: 851c6e0b83744d8c8fc2a07eab098376 " \
228
205
-d '{
229
206
"tool_outputs": [{
230
- "tool_call_id": "call_abc123",
231
- "output": "{"temperature": "22", "unit": "celsius"}"
232
- }, {
233
- "tool_call_id": "call_abc456",
234
- "output": "{"nickname": "LA"}"
207
+ "tool_call_id": "call_123",
208
+ "output": "{\"60 degrees F and raining\"}"
235
209
}]
236
210
}'
237
211
```
0 commit comments