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
Hi, I started working with the framework yesterday. I created an agency and a function that allows me to make an API call to an endpoint, where I execute the get_completion method on a specific agent. I want to know if there’s a way to keep track of the thread_id for a conversation. When I make a new API call, it creates a new conversation. How can I handle conversations by thread_id?
Additionally, the assistants aren’t registering on my OpenAI Assistants.
Here’s my current code:
@router.post("/{agent_name}/execute")asyncdefexecute_agent(agent_name: str, request: Request, agency=Depends(get_agency)):
""" Execute an action with the specified agent. """try:
body=awaitrequest.json()
ifagent_namenotinagency._get_agent_names():
raiseHTTPException(status_code=404, detail="Agent not found")
agent=agency._get_agent_by_name(agent_name)
response=agency.get_completion(
message=body["message"],
recipient_agent=agent
)
return {"agent": agent_name, "response": response}
exceptExceptionase:
raiseHTTPException(status_code=500, detail="Error message: "+str(e))
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I started working with the framework yesterday. I created an agency and a function that allows me to make an API call to an endpoint, where I execute the
get_completion
method on a specific agent. I want to know if there’s a way to keep track of thethread_id
for a conversation. When I make a new API call, it creates a new conversation. How can I handle conversations bythread_id
?Additionally, the assistants aren’t registering on my OpenAI Assistants.
Here’s my current code:
Beta Was this translation helpful? Give feedback.
All reactions