Skip to content

Mcp#3

Merged
vaayne merged 7 commits intomainfrom
mcp
Mar 1, 2025
Merged

Mcp#3
vaayne merged 7 commits intomainfrom
mcp

Conversation

@vaayne
Copy link
Copy Markdown
Collaborator

@vaayne vaayne commented Feb 28, 2025

No description provided.

- Added `mcps` package with `CreateMCPClients` function to initialize MCP clients.
- Updated `PolyLLM` to support MCP server configurations and tools.
- Modified `GetProvider` to `preProcess` to handle model tools and MCP server initialization.
- Updated `Providers` JSON and Go code to remove unnecessary fields.
- Added `WithMCPServerConfig` and `WithProviders` options for `PolyLLM` configuration.
- Updated SSE handling to skip chunks without choices.
- Added new function `llmToolToMCPToolRequest` to convert LLM tool calls to MCP tool requests.
- Refactored `ChatCompletion` method to introduce `chatCompletion` and `streamingFunc` for better separation of concerns.
- Implemented tool invocation logic within `streamingFunc` to handle and return tool responses.
- Introduced `finalToolCalls` to accumulate tool calls across streaming responses.
- Modified `streamingFunc` to accept `finalToolCalls` and update it based on new tool calls.
- Added logic to handle `FinishReasonToolCalls` to invoke MCP tools and send their results to the user.
- Updated `toolCalls` extraction to use `choice.Delta.ToolCalls` directly.
- Ensured `finalToolCalls` is reset after invoking MCP tools to prevent repeated usage.
…ients (main)

- Updated log message to specify "mcp server" instead of just "server"
- Added log message after server initialization to confirm successful setup
- Added comprehensive documentation on configuration, including JSON configuration file and MCP configuration.
- Introduced new sections in README for using configuration files and MCP with code examples.
- Updated Features section to highlight MCP Support and Configuration File capabilities.
- Modified CLI usage examples to include configuration file support.
- Renamed `providers.json` to `builtin-llm-providers.json` and refactored provider-related files into the `llms` package.
- Added new files for LLM interface and model management: `llm.go`, `llm_models.go`, and others.
- Created utility functions for converting between MCP tools and LLM tools.
- Refactored project structure to better organize LLM and MCP providers, client implementations, and options.
- Enhanced logging with color-coded outputs and structured logging using `slog`.
- Introduced configuration loading functionality for initializing PolyLLM with custom settings.
@vaayne vaayne merged commit f47af4c into main Mar 1, 2025
2 checks passed
@vaayne vaayne deleted the mcp branch March 1, 2025 16:15
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.

1 participant