Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dev = [
"ruff>=0.8.4",
"tomli>=2.2.1",
"pytest>=7.4.0",
"pytest-mock",
"pytest-asyncio>=0.21.1",
"pytest-cov",
]
Expand Down Expand Up @@ -107,6 +108,7 @@ dev = [
"pytest>=7.4.0",
"pytest-asyncio>=0.21.1",
"pytest-cov>=6.1.1",
"pytest-mock",
"ipdb>=0.13.13",
]

Expand Down
18 changes: 12 additions & 6 deletions src/mcp_agent/llm/augmented_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ def deep_merge(dict1: Dict[Any, Any], dict2: Dict[Any, Any]) -> Dict[Any, Any]:


class AugmentedLLM(ContextDependent, AugmentedLLMProtocol, Generic[MessageParamT, MessageT]):
"""
The basic building block of agentic systems is an LLM enhanced with augmentations
such as retrieval, tools, and memory provided from a collection of MCP servers.
Our current models can actively use these capabilities—generating their own search queries,
selecting appropriate tools, and determining what information to retain.
"""


# Common parameter names used across providers
PARAM_MESSAGES = "messages"
PARAM_MODEL = "model"
Expand All @@ -100,12 +108,10 @@ class AugmentedLLM(ContextDependent, AugmentedLLMProtocol, Generic[MessageParamT
# Base set of fields that should always be excluded
BASE_EXCLUDE_FIELDS = {PARAM_METADATA}

"""
The basic building block of agentic systems is an LLM enhanced with augmentations
such as retrieval, tools, and memory provided from a collection of MCP servers.
Our current models can actively use these capabilities—generating their own search queries,
selecting appropriate tools, and determining what information to retain.
"""
class _Actions:
STOP = "Stop" # Making the actions available like so: self.ACTIONS.STOP
CONTINUE_WITH_TOOLS = "CONTINUE_WITH_TOOLS"
ACTIONS = _Actions()

provider: Provider | None = None

Expand Down
736 changes: 355 additions & 381 deletions src/mcp_agent/llm/providers/augmented_llm_anthropic.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/mcp_agent/llm/providers/augmented_llm_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def _api_key(self):
return "AzureCredential"
return super()._api_key()

def _openai_client(self) -> AsyncOpenAI:
def _initialize_client(self) -> AsyncOpenAI:
"""
Returns an AzureOpenAI client, handling both API Key and DefaultAzureCredential.
"""
Expand Down
Loading
Loading