Skip to content
Discussion options

You must be logged in to vote

The UseFunctionInvocation will employ middleware that will handle any tool call requests, invoking those tools, and sending back another request to the server, all hidden behind your single GetResponseAsync. The final ChatResponse you get back will be for the nth request/response, after all function calls have been processed. Thus, the OpenAI ChatCompletion you're getting back in that final response is for a response in which no tool calls happened.

If you want to see what's going on, try changing:

   .UseFunctionInvocation()

to instead be:

  .UseFunctionInvocation()
  .UseLogging(LoggerFactory.Create(b => b.AddConsole().SetMinimumLevel(LogLevel.Trace)))

You'll end up seeing all the req…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@rido-min
Comment options

@stephentoub
Comment options

Answer selected by rido-min
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants