-
Notifications
You must be signed in to change notification settings - Fork 34
Add HuggingFace Inference and code optimization #20
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?
Changes from all commits
4dff4ce
548b49c
a52d9f4
54a320c
4dea3dc
8dca7cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,27 +7,27 @@ | |||||||||||||||||||||||||||||||||
| import requests | ||||||||||||||||||||||||||||||||||
| from typing import Optional | ||||||||||||||||||||||||||||||||||
| from datetime import datetime | ||||||||||||||||||||||||||||||||||
| from anthropic import Anthropic, APIStatusError | ||||||||||||||||||||||||||||||||||
| from python_a2a import ( | ||||||||||||||||||||||||||||||||||
| A2AServer, A2AClient, run_server, | ||||||||||||||||||||||||||||||||||
| Message, TextContent, MessageRole, ErrorContent, Metadata | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| import asyncio | ||||||||||||||||||||||||||||||||||
| from mcp_utils import MCPClient | ||||||||||||||||||||||||||||||||||
| import base64 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # Handle different import contexts | ||||||||||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||||||||||
| from .llm_providers import get_provider, init_provider | ||||||||||||||||||||||||||||||||||
| from .mcp_utils import MCPClient | ||||||||||||||||||||||||||||||||||
| except ImportError: | ||||||||||||||||||||||||||||||||||
| from llm_providers import get_provider, init_provider | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+19
to
+22
|
||||||||||||||||||||||||||||||||||
| from .llm_providers import get_provider, init_provider | |
| from .mcp_utils import MCPClient | |
| except ImportError: | |
| from llm_providers import get_provider, init_provider | |
| from .llm_providers import get_provider | |
| from .mcp_utils import MCPClient | |
| except ImportError: | |
| from llm_providers import get_provider |
Copilot
AI
Jan 13, 2026
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.
Import of 'init_provider' is not used.
| from .llm_providers import get_provider, init_provider | |
| from .mcp_utils import MCPClient | |
| except ImportError: | |
| from llm_providers import get_provider, init_provider | |
| from .llm_providers import get_provider | |
| from .mcp_utils import MCPClient | |
| except ImportError: | |
| from llm_providers import get_provider |
Copilot
AI
Jan 13, 2026
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.
Print statement may execute during import.
Copilot
AI
Jan 13, 2026
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.
Inconsistent error handling for missing response_text. In the updated code at line 178, the function checks 'if response_text:' before logging, but still returns response_text regardless. If response_text is None (which can happen from provider.complete() failures), the function should return None explicitly or handle the None case more clearly for the caller.
| if response_text: | |
| # Log the LLM response | |
| log_message(conversation_id, current_path, f"{provider.name} {agent_id}", response_text) | |
| if response_text is None: | |
| # Handle missing response_text from provider as a failure case | |
| print(f"Agent {agent_id}: {provider.name} returned no response_text", flush=True) | |
| return None | |
| # Log the LLM response | |
| log_message(conversation_id, current_path, f"{provider.name} {agent_id}", response_text) | |
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.
The documentation header "Environment Variables" is now missing a descriptive sentence. The original text "You need the following environment details ()" appears to have been removed, but the replacement doesn't include an introductory sentence before the "Core Settings" subsection. Consider adding a brief introduction like "Configure the following environment variables:"