Can an Assistant Smartly Call Tools in Parallel and Sequentially?

Hi OpenAI Community,

I’m currently developing an app that uses OpenAI assistants, and I have a question regarding how assistants can call tools in a smart and dynamic manner.

In my app, I have an Location assistant that utilizes multiple tools. The assistant is designed to perform tasks like:

  • Web search using an API to gather location details.
  • MapKit framework to provide address links or directions based on the results of a given search query

I want to know if it’s possible for the assistant to call tools in parallel when it’s efficient (for example, fetching web data while also preparing map resources), but also call them sequentially when needed (like waiting for web search results before generating the map link).

More specifically:

  1. Can the assistant intelligently decide the order and timing of tool calls based on the task? For example, it could:
    First perform a web search for a location.
    Then, after getting results, use the MapKit tool to generate a map link for the found location.

  2. Is there a best practice for managing this kind of tool orchestration? Is there a way for the assistant to execute tasks in parallel when no dependencies exist, but also sequentially when one tool relies on another’s output?

I would appreciate any insights or advice on how to approach this tool execution strategy. Ideally, I’d like the assistant to make decisions dynamically on whether it needs to wait for one tool’s output before calling another.

Thank you in advance!

My bot when asked to draw a picture summarising an article (for which I provide a link) will first crawl the article, then paint the picture.

So yes, this can be done, though you don’t necessarily need to “force” it to behave like this. This was kind of unintended “emergent” behaviour which I didn’t deliberately code for and a result of its iterative looping thought process (which is bespoke and doesn’t use the Assistant API).

Sometimes this stuff surprises you! :sweat_smile:

2 Likes