You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> 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}"`.
"instructions": "You are a weather bot. Use the provided functions to answer questions.",
98
-
"tools": [{
99
-
"type": "function",
100
-
"function": {
101
-
"name": "getCurrentWeather",
102
-
"description": "Get the weather in location",
103
-
"parameters": {
104
-
"type": "object",
105
-
"properties": {
106
-
"location": {"type": "string", "description": "The city and state e.g. San Francisco, CA"},
107
-
"unit": {"type": "string", "enum": ["c", "f"]}
108
-
},
109
-
"required": ["location"]
110
-
}
111
-
}
112
-
},
113
-
{
84
+
tools=[{
114
85
"type": "function",
115
-
"function": {
116
-
"name": "getNickname",
117
-
"description": "Get the nickname of a city",
118
-
"parameters": {
119
-
"type": "object",
120
-
"properties": {
121
-
"location": {"type": "string", "description": "The city and state e.g. San Francisco, CA"}
122
-
},
123
-
"required": ["location"]
124
-
}
125
-
}
126
-
}],
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
+
}],
127
98
"model": "gpt-4-1106-preview"
128
99
}'
129
100
```
@@ -149,18 +120,10 @@ When you initiate a **Run** with a user Message that triggers the function, the
149
120
"id": "call_abc123",
150
121
"type": "function",
151
122
"function": {
152
-
"name": "getCurrentWeather",
153
-
"arguments": "{\"location\":\"San Francisco\"}"
123
+
"name": "get_weather",
124
+
"arguments": "{\"location\":\"Seattle\"}"
154
125
}
155
126
},
156
-
{
157
-
"id": "call_abc456",
158
-
"type": "function",
159
-
"function": {
160
-
"name": "getNickname",
161
-
"arguments": "{\"location\":\"Los Angeles\"}"
162
-
}
163
-
}
164
127
]
165
128
}
166
129
},
@@ -169,50 +132,66 @@ When you initiate a **Run** with a user Message that triggers the function, the
169
132
170
133
## Submitting function outputs
171
134
172
-
You can then complete the **Run** by submitting the tool output from the function(s) you call. Pass the `tool_call_id` referenced in the `required_action` object above to match output to each function call.
135
+
You can then complete the **Run** by submitting the tool output from the function(s) you call. Pass the `tool_call_id` referenced in the `required_action` object to match output to each function call.
0 commit comments