-
Notifications
You must be signed in to change notification settings - Fork 3
Chat MCP example #143
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
base: main
Are you sure you want to change the base?
Chat MCP example #143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds an example chat agent that integrates Clarifai’s LLM models with MCP tools, enabling interactive queries and tool-driven responses.
- Introduce project dependencies in
requirements.txt
- Implement
client.py
with LLMClient, tool discovery, execution, and chat session orchestration - Provide setup, usage, and architecture details in
README.md
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
agents/mcp/chat-mcp-agent/requirements.txt | Added required packages: fastmcp, openai, python-dotenv, langchain-core |
agents/mcp/chat-mcp-agent/client.py | New chat client implementation with LLM integration and tool management |
agents/mcp/chat-mcp-agent/README.md | Documentation for setup, usage, and architecture of the example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces an interactive chat agent that integrates Clarifai's LLM with MCP tools for executing tool calls and processing natural language responses. Key changes include adding the required dependencies in requirements.txt, implementing the core client and chat session logic in client.py, and providing clear documentation in the README.md.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
agents/mcp/chat-mcp-agent/requirements.txt | Adds dependency specifications for Clarifai, LangChain, fastmcp, and OpenAI. |
agents/mcp/chat-mcp-agent/client.py | Implements LLMClient, tool formatting, asynchronous tool calls, and an interactive chat loop. |
agents/mcp/chat-mcp-agent/README.md | Provides comprehensive setup, usage, and component architecture documentation. |
arguments | ||
) | ||
result = await server.call_tool_mcp(tool_name, arguments) | ||
result_data = result.model_dump()['content'][0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accessing the first element of 'content' without validating it may lead to an IndexError if the response structure is not as expected. Consider adding a check to ensure the list is non-empty.
Copilot uses AI. Check for mistakes.
do we need this one still? looks like on is already merged? |
No description provided.