Calling external functions from Assistants

Mohamed Hussein 650 Reputation points
2024-12-12T07:15:10.6333333+00:00

Good Day,

Appreciate your all efforts,

At Azure OpenAi Assistants, when calling an external function like Web Search, I've 3 questions

  1. Is that manadroty to manually trigger the function, when the run status requires_action
  2. At the playground, what's the difference between Adding Custom Function and Logic App
  3. If there are multiple functions, and set the tool choice to Auto, what will be the scenario? should the assistant state which function to be called, then i manually call it?

Thank you once agsinImage 9

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,793 questions
{count} votes

1 answer

Sort by: Most helpful
  1. santoshkc 13,350 Reputation points Microsoft External Staff
    2024-12-12T10:47:49.9966667+00:00

    Hi @Mohamed Hussein,

    Thank you for reaching out to Microsoft Q&A forum!

    Is that manadroty to manually trigger the function, when the run status requires_action

    When the run status is set to requires_action, it indicates that the assistant has identified the function to be called but cannot execute it directly. It requires you to manually invoke the function and provide the output back to the assistant.

    At the playground, what's the difference between Adding Custom Function and Logic App

    Custom Function: This allows you to define a function specification in JSON format directly in the assistant. The assistant will generate the required function call arguments but will not execute the function. You handle execution externally and feed the result back to the assistant.

    Logic App: This enables integration with Azure Logic Apps. The Logic App must have an HTTP trigger and response defined. This setup is more automated, as the Logic App handles the function execution once triggered by the assistant, provided the app is correctly configured.

    If there are multiple functions, and set the tool choice to Auto, what will be the scenario? should the assistant state which function to be called, then i manually call it?

    If multiple functions are available and the tool choice is set to Auto, the assistant determines the most suitable function to call based on the user query. You would still need to manually invoke the function if requires_action is returned, even in Auto mode.

    Please refer to: Assistants function calling and Call Azure Logic apps as functions.

    I hope you understand! Thank you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.