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

.Net: Bug: Invoking a tool call without ID then following up with another chat completion message throws null pointer #10125

Open
gjz22 opened this issue Jan 8, 2025 · 0 comments
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code triage

Comments

@gjz22
Copy link

gjz22 commented Jan 8, 2025

Am not sure whether this is a bug or a feature request.

Describe the bug
The normal way OpenAI tool calling is performed is [key information in brackets]:

  1. We pass a prompt and a list of tools to OpenAI
  2. Open AI responds with a tool call [with a tool call id]
  3. The tool call is invoked by the application
  4. We pass the result of the invocation as a chat content back to Open AI [With the ID]
  5. Open AI passes back
    However, if you invoke a tool directly (starting from step 3 above with a synthetic invocation constructed by the app: new FunctionCallContent(myFunction, myPlugin, null, myArguments)) there is no id from Open AI, so there is no id. When constructing the OpenAI tool call object this throws an error that the toolCallId can not be null.

To Reproduce
Steps to reproduce the behavior:

  1. Invoke a tool call (FunctionCallContent) with a null id
  2. Get the function result
  3. pass to another chat completion service call
  4. Get an argument exception

Expected behavior
I'd expect one of two things to happen:

  1. [preferable] A better way to pass results of these synthetic methods back to OpenAI for processing
  2. A clear error that either results from synthetic executions are not supported in the ToChatMessage

Platform

  • Language: C#
@gjz22 gjz22 added the bug Something isn't working label Jan 8, 2025
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Jan 8, 2025
@github-actions github-actions bot changed the title Bug: Invoking a tool call without ID then following up with another chat completion message throws null pointer .Net: Bug: Invoking a tool call without ID then following up with another chat completion message throws null pointer Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code triage
Projects
None yet
Development

No branches or pull requests

2 participants