Here’s a sample call to a named assistant.thread from curl on a Windows 10 terminal:
curl -X POST “h t t p s://api{openai}/v1/threads/thread_Ko6iamCFlbDK1Osdksdj/runs” -H “Authorization:Bearer {myapiKey}” -H “Content-Type:application/json” -H “OpenAI-Beta:assistants=v1” -d “{“assistant_id”: “asst_qJ5u2DJHUPuBYOZqsd”, “messages”: [{“role”: “user”, “content”: “tell me a bar joke.”}] }”
Comment: of course myapKey is the actual key, not dummy pseudocode here.
Additional info: { model:gpt-3.5-turbo }, fyi, I’m on the upgraded gpt-4 wailing list. Does that matter?
The above call resulted in the following error. And this is a showstopper. Was the syntax incorrect or something else?
{
“error”: {
“message”: “1 validation error for Request\nbody → messages\n extra fields not permitted (type=value_error.extra)”,
“type”: “invalid_request_error”,
“param”: null,
“code”: null
}
So, I found out the following RUN status.
status
string
The status of the run, which can be either queued, in_progress, requires_action, cancelling, cancelled, failed, completed, or expired.
Question, would 'requires_action" status indicate this instance of Run is ready to fulfill a request ( to accept “messages” )? ‘expired’ obvious, no go.
requires_action will be if the AI needs something from you: a function call to be run by you and the return value from that function.
When a run has the status: "requires_action" and required_action.type is submit_tool_outputs, this endpoint can be used to submit the outputs from the tool calls once they’re all completed. All outputs must be submitted in a single request.
Required action: “For now, this is always submit_tool_outputs.”
ahe, probably I know what’s going on. we can use curl for syncho action like Create an instance of “Assistant” but NOT for RUN a thread with message interactions for would be asyncho…