Skip to content

Conversation

@christothes
Copy link
Collaborator

@christothes christothes commented May 2, 2025

This PR adds functionality for managing OpenAI function tools in chat completions and responses, implementing two utility classes: ChatTools and ResponseTools.

Key Features

  • Unified Tool Management
    • Both classes handle local and remote MCP (Model Context Protocol) tools
    • Support for both static method tools and remote MCP server tools
    • Vectorized tool lookup using embeddings for smart tool filtering
  • Tool Registration
    • Local tool registration via reflection from static methods
    • Remote tool registration from MCP servers
  • Tool Filtering
    • Vector-based tool filtering when an EmbeddingClient is provided
    • Configurable similarity thresholds
    • Customizable maximum tool limits


[TestFixture]
[Category("Utility")]
public class ChatToolsTests
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a test for the following scenario: I have an ongoing chat where the model called "Function Foo" at some point, but then I remove "Function Foo" from the list of available tools and continue talking to the model. Confirm that when the model sees "Function Foo" in the chat history but not in its list of available tools, it still works correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants