AttributeError: 'NoneType' object has no attribute 'submit_tool_outputs'

When i pass multiple messages in thread and try to call run.required_action for function approval, it give None

here is the code.
let ask one question


message = client.beta.threads.messages.create(
    thread_id=thread_id,
    role="user",
    content="What  is 3+3",
)

let ask another

message = client.beta.threads.messages.create(
    thread_id=thread_id,
    role="user",
    content="What  is 3+4",
)

now after running thread and retrieving it
when I run

run.required_action

It return None

You should actually “run”, then check the status first, not required action. See if there’s an assistant message for you to retrieve.

If the AI didn’t call for an external tool function, required_action will indeed be null.

3+4 is likely a question that the AI can answer without needing to employ external tools.

but my run.status says requires_action. is not it be “completed” in that case. the questions are just sample btw

i am again checking i think you are right.

If you’ve already mastered using chat completions - with assistants you have to start with a brand new understanding of multiple steps required just to obtain the AI saying “hi”.

Here’s documentation that starts at these steps, where a user question is added to a thread, and a run performs AI inference.

https://platform.openai.com/docs/assistants/overview

Try out example code and then you can probe deeper into these operations.

If you don’t have external tool specifications you’ve supplied, you should not worry about checking for them. null is the AI not needing anything from you at that particular point. Be mindful of the time required to obtain status changes and continued checks to get back a complete response.

1 Like