-
Notifications
You must be signed in to change notification settings - Fork 772
Router LLM should extend AugmentedLLM to enable composability #369
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
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from typing import Callable, List, Optional, TYPE_CHECKING | ||
|
||
from mcp_agent.agents.agent import Agent | ||
from mcp_agent.workflows.llm.augmented_llm import AugmentedLLM | ||
from mcp_agent.workflows.llm.augmented_llm_anthropic import AnthropicAugmentedLLM | ||
from mcp_agent.workflows.router.router_llm import LLMRouter | ||
|
||
|
@@ -49,6 +50,7 @@ def __init__( | |
@classmethod | ||
async def create( | ||
cls, | ||
llm: AugmentedLLM | None = None, | ||
server_names: List[str] | None = None, | ||
Comment on lines
+53
to
54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion
Leaving it unused will trigger linters and confuse API consumers. 🤖 Prompt for AI Agents
|
||
agents: List[Agent] | None = None, | ||
functions: List[Callable] | None = None, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from typing import Callable, List, Optional, TYPE_CHECKING | ||
|
||
from mcp_agent.agents.agent import Agent | ||
from mcp_agent.workflows.llm.augmented_llm import AugmentedLLM | ||
from mcp_agent.workflows.llm.augmented_llm_openai import OpenAIAugmentedLLM | ||
from mcp_agent.workflows.router.router_llm import LLMRouter | ||
|
||
|
@@ -49,6 +50,7 @@ def __init__( | |
@classmethod | ||
async def create( | ||
cls, | ||
llm: AugmentedLLM | None = None, | ||
server_names: List[str] | None = None, | ||
Comment on lines
+53
to
54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion
The optional 🤖 Prompt for AI Agents
|
||
agents: List[Agent] | None = None, | ||
functions: List[Callable] | None = None, | ||
|
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.
Propagate the underlying
__aexit__
return valueAgent.__aexit__()
may returnTrue
to suppress an exception; dropping that value changes behaviour to “always re-raise”. Forward the result explicitly:📝 Committable suggestion
🤖 Prompt for AI Agents