Skip to content

Trouble with tool calling in C# #653

@MikeYeager

Description

@MikeYeager

I've done an initial C# implementation of an IChatClient wrapper for the OpenAIChatClient. It works for simple chat completions. I'm trying to get tool calling to work, but not having success. It looks like it should work, but I'm having to force it to run the tool (Required). It's returning valid JSON to call the tool, but the FinishReason is always 'stop' and not 'tool_call'.

I'm attaching a zip of the project. I assumed I'm having an issue converting between the Betalgo.Ranul.OpenAI and the Microsoft.Extensions.AI classes, but any help would be appreciated. I'm happy to donate the swapper code as a starting point for the project.

FoundryLocalAgentFramework.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions