Skip to content

Commit 0ebf80c

Browse files
committed
updating rest
1 parent 538ce67 commit 0ebf80c

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

articles/ai-services/openai/how-to/assistant-functions.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ When you initiate a **Run** with a user Message that triggers the function, the
121121
"type": "function",
122122
"function": {
123123
"name": "get_weather",
124-
"arguments": "{\"location\":\"San Francisco\"}"
124+
"arguments": "{\"location\":\"Seattle\"}"
125125
}
126126
},
127127
]
@@ -143,22 +143,6 @@ You can then complete the **Run** by submitting the tool output from the functio
143143
def get_weather():
144144
return "It's 80 degrees F and slightly cloudy."
145145

146-
# Create a thread
147-
thread = client.beta.threads.create()
148-
149-
#Add a user question to the thread
150-
message = client.beta.threads.messages.create(
151-
thread_id=thread.id,
152-
role="user",
153-
content="What is the weather in Seattle?"
154-
)
155-
156-
run = client.beta.threads.runs.create_and_poll(
157-
thread_id=thread.id,
158-
assistant_id= assistant.id,
159-
instructions="",
160-
)
161-
162146
# Define the list to store tool outputs
163147
tool_outputs = []
164148

@@ -198,6 +182,8 @@ else:
198182

199183
# [REST](#tab/rest)
200184

185+
in the following example, replace `output` with the output of the function you want to use.
186+
201187
```console
202188
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/thread_abc123/runs/run_123/submit_tool_outputs?api-version=2024-07-01-preview \
203189
-H "Content-Type: application/json" \

0 commit comments

Comments
 (0)