Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] OpenAI Assistants API - Parallel Tool Use Broken #32329

Open
hayescode opened this issue Jan 24, 2025 · 0 comments
Open

[BUG] OpenAI Assistants API - Parallel Tool Use Broken #32329

hayescode opened this issue Jan 24, 2025 · 0 comments
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@hayescode
Copy link

API Spec link

https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-12-01-preview

API Spec version

2024-12-01-preview

Describe the bug

With parallel_tool_calls set to True sometimes the required_action returns fake function_names and arguments like "recipient_name". The only tool I have is called ask_database but instead of submitting 2 seperate tool calls it combines into 1.

    run = await llm.beta.threads.runs.create_and_poll(
        assistant_id=assistant_id,
        thread_id=thread.id,
        parallel_tool_calls=True,
    )

Expected behavior

{
  "data": [
    {
      "step_details": {
        "tool_calls": [
          {
            "id": "call_U83VxNlfG2lZAv3GvtTDxQ50",
            "function": {
              "arguments": "{\"sql_query\":\"SELECT SUM(BARRELS) "}}\",
              "name": "ask_database",
              "output": null
            },
            "type": "function"
          },
          {
            "id": "call_U83VxNlfG2lZAv3GvtTDxQ51",
            "function": {
              "arguments": "{\"sql_query\":\"SELECT SUM(NEW_BARRELS) "}}\",
              "name": "ask_database",
              "output": null
            },
            "type": "function"
          }
        ],
        "type": "tool_calls"
      },
}

Actual behavior

{
  "data": [
    {
      "id": "step_d1lZKBXSLZbPbEca3xKUYCrN",
      "assistant_id": "asst_Y8fWym6bJMhDOZRocybNQZUm",
      "cancelled_at": null,
      "completed_at": null,
      "created_at": 1737740639,
      "expired_at": null,
      "failed_at": null,
      "last_error": null,
      "metadata": null,
      "object": "thread.run.step",
      "run_id": "run_9ZeZ8syaZySOWMEzZX7W7hR8",
      "status": "in_progress",
      "step_details": {
        "tool_calls": [
          {
            "id": "call_U83VxNlfG2lZAv3GvtTDxQ50",
            "function": {
              "arguments": "{\"tool_uses\":[{\"recipient_name\":\"functions.ask_database\",\"parameters\":{\"sql_query\":\"SELECT SUM(BARRELS) "}},{\"recipient_name\":\"functions.ask_database\",\"parameters\":{\"sql_query\":\"SELECT SUM(BARRELS) "}}]}",
              "name": "multi_tool_use.parallel",
              "output": null
            },
            "type": "function"
          }
        ],
        "type": "tool_calls"
      },
      "thread_id": "thread_B8PoIjgTfDr381kahAAsA2CR",
      "type": "tool_calls",
      "usage": null,
      "expires_at": 1737741237
    }
  ],
  "object": "list",
  "first_id": "step_d1lZKBXSLZbPbEca3xKUYCrN",
  "last_id": "step_d1lZKBXSLZbPbEca3xKUYCrN",
  "has_more": false
}

Reproduction Steps

run = await llm.beta.threads.runs.create_and_poll(
    assistant_id=assistant_id,
    thread_id=thread.id,
    parallel_tool_calls=True,
)
steps= await llm.beta.threads.runs.steps.list(thread_id=run.thread_id, run_id=run.id)
print(steps.model_dump_json(indent=2))

Environment

No response

@hayescode hayescode added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jan 24, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

1 participant