I hope the someone can give some light to me
I am trying to create an assistant. In order to do that, i have created a prompt that detects when a concrete topic is detected, and it launchs another prompt with a function on it (for example, create a support ticket).
The problem is that i am not able to check if a function is running, just i am able to know when the function is finished.
I want to know when the function is running or not, because i want to come back to the main thread of the process that detect the different topics.
Exist any way to detect when is running a function?
I have read all the topics without luck:
Depending on how youâre using the models, Python or Node, you can get the run steps after each interaction. It will show which tools were used and why.
This code snippet should grab it, then you can print it out however you want.
# When the run is over, list and print the run steps for troubleshooting.
run_steps = client.beta.threads.runs.steps.list(
thread_id=thread.id,
run_id=run.id
)
Once the Function is called, it will give you JSON output as parameters. When you finish using these parameters of function, youâll need to âSubmit Tool Outputâ to let your assistant know that function call is finished.
Threads and Runs donât work for ChatCompletion. Its only for Assistants.
If you use function calling in ChatCompletion, it will give you JSON output parameters and thatâs it. You can use these parameters however you like.
But if you are using Assistant APIs, it means thereâs a thread of communication between you and the OpenAI Assistant. Now if you use Function Calling in Assistant, it will also give you JSON output but as this is a back and fourth communication, it will pause the communication between you and assistant until you tell the assistant that youâve processed/used the function calling parameters and now its okay to resume the communication again. Thatâs where âSubmit Tool Outputâ comes which i mentioned in my previous comment.
If you are still confused, I am available to do a 1on1 to explain you these things.