#Handoff from one assistant to another

1 messages · Page 1 of 1 (latest)

pine willow
#

Hello, everyone, and thanks in advance for any help. Been using the OpenAI API for a few months now, but have hit some confusion.

  1. Is the Assistants API going away? Should I be doing everything in Agents SDK instead?
  2. Completions vs. Responses? What's the difference?
  3. This is what I'm trying to do. Advice appreciated:

I have assistant A conducting a chat with a human user, and that's been working fine. However, once A has collected all the info from the user that I asked it to, I have been trying to get it to hand off to assistant B. Assistant B has its own developer/system prompt and set of sensitive information to collect. Because what B collects is sensitive, I ideally would like to have it be a separate assistant or agent (so as to keep the sensitive info isolated and away from A), but I've been struggling to get this working for the past 2 days.

What is the advised way to hand off between two separate conversational assistants/agents, each of which conduct a prolonged chat with a human user (and if I want to keep one's communications more or less hidden or abstracted away from the other)?

I know there's orchestrator-subagent, but that would fail to keep the sensitive info away from the orchestrator (unless I turned it on its head and had B be the orchestrator, I guess). There's straight handoff, but when I tried to convert my Assistant-based architecture to Agent-based today, A just got stuck on its first tool call and failed to proceed from there.

Lastly, once B is done, I most likely need it to hand back off to A, or I suppose I could have the finalization work done by a new assistant/agent C.

It's a lot, and I'm rambling. Again, any help appreciated. Many thanks!

midnight oak
#
  1. Assistants api is kept afaik. And is separate from agents SDK. Assistants is state full user conversations. Agents SDK are agents. If you are using assistants api for some project you can keep using it, no need to migrate to agents SDK. Also, afaik they are not integrated
#

1 (bis). Some use cases you may have maybe should be solved with agents instead of assistants, depends on the use case

#
  1. Responses api was launched 3-4 months ago. OpenAI has not stated that responses api will replace completions api. However everything you can do with completions can be done with responses api. Responses api also covers some cases (like hosted tools) that the completions api does not support. Looking at the future we should use responses api. However, most of other providers are sticking with the completions api schema, so I don’t see a future soon where OpenAI drops the completions api, more info here https://community.openai.com/t/introducing-the-responses-api/1140929 Introducing the Responses API - Announcements - OpenAI Developer Community
OpenAI Developer Community

We’re making improvements to how you build assistants and use tools with the OpenAI API. Based on your feedback from the Assistants API beta, we’ve built the Responses API — a faster, more flexible, and easier way to create agentic experiences that combines the simplicity of Chat Completions with the tool use and state management of the As...

#

I read the use case. This is quite interesting! You have a conversational agent with a user. This agent at some point detects that has to delegate the task, and when the task is done, come back to tell the user something. This delegated task is managed by some LLM with tools (an agent).

#

Assistants api provides much more features to interact with the user conversationally (like keeping track of the conversation). And you have that already built, so I would keep that.

#

The assistant B can be an agent from OpenAI agents SDK

#

So you have the change to try them! And they are really powerful

#

How to integrate both? With a function call

#

Declare a function call in the assistant A, and in the code of the function you’ll perform the Agent b run. When the agent ends, the response of the agent is piped as the return of the function call, so the assistant A knows the result

#

This should work.