fast-agent-mcp 0.2.1__py3-none-any.whl → 0.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fast-agent-mcp
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Define, Prompt and Test MCP enabled Agents and Workflows
5
5
  Author-email: Shaun Smith <fastagent@llmindset.co.uk>, Sarmad Qadri <sarmad@lastmileai.dev>
6
6
  License: Apache License
@@ -1,6 +1,6 @@
1
1
  mcp_agent/__init__.py,sha256=6ewnFA5JA8SUjWsWPVyjEQx5xfZKPbVz2WjavA55uvA,1683
2
2
  mcp_agent/app.py,sha256=jBmzYM_o50g8vhlTgkkf5TGiBWNbXWViYnd0WANbpzo,10276
3
- mcp_agent/config.py,sha256=vqMsIpz3BLVrVHI9YRfvl0AA_DKW3zBvLDCEnw-fbp0,10379
3
+ mcp_agent/config.py,sha256=lI4B9VhF0qplez20cPeegxPA1ZcFBIxzepm_FOhW_08,10758
4
4
  mcp_agent/console.py,sha256=Gjf2QLFumwG1Lav__c07X_kZxxEUSkzV-1_-YbAwcwo,813
5
5
  mcp_agent/context.py,sha256=NHcfnp5v-dCSxRvzEbavVaI7WOv5ir64IAFbGSnfeHI,7812
6
6
  mcp_agent/context_dependent.py,sha256=QXfhw3RaQCKfscEEBRGuZ3sdMWqkgShz2jJ1ivGGX1I,1455
@@ -54,7 +54,7 @@ mcp_agent/llm/augmented_llm.py,sha256=PdEMlglHFCTenqVDWsvEj3iBZh5ljFP7ZBdMibTGUx
54
54
  mcp_agent/llm/augmented_llm_passthrough.py,sha256=_DC6lGYbXPMXBeJn9Ot2fq-fXJ5GP7HhRmlY9pNvJ2s,6033
55
55
  mcp_agent/llm/augmented_llm_playback.py,sha256=YVR2adzjMf9Q5WfYBytryWMRqJ87a3kNBnjxhApsMcU,3413
56
56
  mcp_agent/llm/memory.py,sha256=UakoBCJBf59JBtB6uyZM0OZjlxDW_VHtSfDs08ibVEc,3312
57
- mcp_agent/llm/model_factory.py,sha256=nCxU9oAd8m1QqHnNVyLUJksAFkudLlIq1XSKX3MCuYA,8153
57
+ mcp_agent/llm/model_factory.py,sha256=NFe-m8AmIyHWDVmspJR_nEDs02eBAttf6avesOjAOhs,8336
58
58
  mcp_agent/llm/prompt_utils.py,sha256=yWQHykoK13QRF7evHUKxVF0SpVLN-Bsft0Yixzvn0g0,4825
59
59
  mcp_agent/llm/sampling_converter.py,sha256=C7wPBlmT0eD90XWabC22zkxsrVHKCrjwIwg6cG628cI,2926
60
60
  mcp_agent/llm/sampling_format_converter.py,sha256=xGz4odHpOcP7--eFaJaFtUR8eR9jxZS7MnLH6J7n0EU,1263
@@ -62,7 +62,8 @@ mcp_agent/llm/providers/__init__.py,sha256=heVxtmuqFJOnjjxHz4bWSqTAxXoN1E8twC_gQ
62
62
  mcp_agent/llm/providers/anthropic_utils.py,sha256=vYDN5G5jKMhD2CQg8veJYab7tvvzYkDMq8M1g_hUAQg,3275
63
63
  mcp_agent/llm/providers/augmented_llm_anthropic.py,sha256=9JXyweks5Joes4ERtmi2wX8i7ZsXydKM7IkMq7s7dIU,15429
64
64
  mcp_agent/llm/providers/augmented_llm_deepseek.py,sha256=SdYDqZZ9hM9sBvW1FSItNn_ENEKQXGNKwVHGnjqjyAA,1927
65
- mcp_agent/llm/providers/augmented_llm_openai.py,sha256=MDzZxG6MeqE9Cq13xyQp-4DwnHtgxeMGy4SedzJi0RM,18486
65
+ mcp_agent/llm/providers/augmented_llm_generic.py,sha256=qh4I8_wwududAbYRHDTN3rwsRfwZ7PKf6VjHewK9azQ,1550
66
+ mcp_agent/llm/providers/augmented_llm_openai.py,sha256=-EkkekxYn85QUXsCmqX6Mk8vUE91ZJCUxzL0N9-fHXg,18136
66
67
  mcp_agent/llm/providers/multipart_converter_anthropic.py,sha256=3eRu7MSkbvBzKLptNdC_u0QohU_6eJ1ikRTaT6yPm0Y,16650
67
68
  mcp_agent/llm/providers/multipart_converter_openai.py,sha256=-EUAVP7ZB5JzvVe4Gtn5av9syWyN74BoDzhK-sOpSdg,16709
68
69
  mcp_agent/llm/providers/openai_multipart.py,sha256=qKBn7d3jSabnJmVgWweVzqh8q9mBqr09fsPmP92niAQ,6899
@@ -131,8 +132,8 @@ mcp_agent/resources/examples/workflows/orchestrator.py,sha256=rOGilFTliWWnZ3Jx5w
131
132
  mcp_agent/resources/examples/workflows/parallel.py,sha256=n0dFN26QvYd2wjgohcaUBflac2SzXYx-bCyxMSousJE,1884
132
133
  mcp_agent/resources/examples/workflows/router.py,sha256=E4x_-c3l4YW9w1i4ARcDtkdeqIdbWEGfsMzwLYpdbVc,1677
133
134
  mcp_agent/ui/console_display.py,sha256=TVGDtJ37hc6UG0ei9g7ZPZZfFNeS1MYozt-Mx8HsPCk,9752
134
- fast_agent_mcp-0.2.1.dist-info/METADATA,sha256=aewQmossBC95xw0NPet8u2LUxcjqRdsjdU291wudXsY,29647
135
- fast_agent_mcp-0.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
136
- fast_agent_mcp-0.2.1.dist-info/entry_points.txt,sha256=qPM7vwtN1_KmP3dXehxgiCxUBHtqP7yfenZigztvY-w,226
137
- fast_agent_mcp-0.2.1.dist-info/licenses/LICENSE,sha256=cN3FxDURL9XuzE5mhK9L2paZo82LTfjwCYVT7e3j0e4,10939
138
- fast_agent_mcp-0.2.1.dist-info/RECORD,,
135
+ fast_agent_mcp-0.2.2.dist-info/METADATA,sha256=868y8r88XRjKBhQk5rIJYVv6x1N1y7V-Wxwn0szRz6g,29647
136
+ fast_agent_mcp-0.2.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
137
+ fast_agent_mcp-0.2.2.dist-info/entry_points.txt,sha256=qPM7vwtN1_KmP3dXehxgiCxUBHtqP7yfenZigztvY-w,226
138
+ fast_agent_mcp-0.2.2.dist-info/licenses/LICENSE,sha256=cN3FxDURL9XuzE5mhK9L2paZo82LTfjwCYVT7e3j0e4,10939
139
+ fast_agent_mcp-0.2.2.dist-info/RECORD,,
mcp_agent/config.py CHANGED
@@ -136,6 +136,18 @@ class DeepSeekSettings(BaseModel):
136
136
  model_config = ConfigDict(extra="allow", arbitrary_types_allowed=True)
137
137
 
138
138
 
139
+ class GenericSettings(BaseModel):
140
+ """
141
+ Settings for using OpenAI models in the fast-agent application.
142
+ """
143
+
144
+ api_key: str | None = None
145
+
146
+ base_url: str | None = None
147
+
148
+ model_config = ConfigDict(extra="allow", arbitrary_types_allowed=True)
149
+
150
+
139
151
  class TemporalSettings(BaseModel):
140
152
  """
141
153
  Temporal settings for the fast-agent application.
@@ -250,6 +262,9 @@ class Settings(BaseSettings):
250
262
  deepseek: DeepSeekSettings | None = None
251
263
  """Settings for using DeepSeek models in the fast-agent application"""
252
264
 
265
+ generic: GenericSettings | None = None
266
+ """Settings for using Generic models in the fast-agent application"""
267
+
253
268
  logger: LoggerSettings | None = LoggerSettings()
254
269
  """Logger settings for the fast-agent application"""
255
270
 
@@ -9,6 +9,7 @@ from mcp_agent.llm.augmented_llm_passthrough import PassthroughLLM
9
9
  from mcp_agent.llm.augmented_llm_playback import PlaybackLLM
10
10
  from mcp_agent.llm.providers.augmented_llm_anthropic import AnthropicAugmentedLLM
11
11
  from mcp_agent.llm.providers.augmented_llm_deepseek import DeepSeekAugmentedLLM
12
+ from mcp_agent.llm.providers.augmented_llm_generic import GenericAugmentedLLM
12
13
  from mcp_agent.llm.providers.augmented_llm_openai import OpenAIAugmentedLLM
13
14
  from mcp_agent.mcp.interfaces import AugmentedLLMProtocol
14
15
 
@@ -32,6 +33,7 @@ class Provider(Enum):
32
33
  OPENAI = auto()
33
34
  FAST_AGENT = auto()
34
35
  DEEPSEEK = auto()
36
+ GENERIC = auto()
35
37
 
36
38
 
37
39
  class ReasoningEffort(Enum):
@@ -60,6 +62,7 @@ class ModelFactory:
60
62
  "openai": Provider.OPENAI,
61
63
  "fast-agent": Provider.FAST_AGENT,
62
64
  "deepseek": Provider.DEEPSEEK,
65
+ "generic": Provider.GENERIC,
63
66
  }
64
67
 
65
68
  # Mapping of effort strings to enum values
@@ -116,6 +119,7 @@ class ModelFactory:
116
119
  Provider.OPENAI: OpenAIAugmentedLLM,
117
120
  Provider.FAST_AGENT: PassthroughLLM,
118
121
  Provider.DEEPSEEK: DeepSeekAugmentedLLM,
122
+ Provider.GENERIC: GenericAugmentedLLM,
119
123
  }
120
124
 
121
125
  # Mapping of special model names to their specific LLM classes
@@ -0,0 +1,46 @@
1
+ import os
2
+
3
+ from mcp_agent.core.request_params import RequestParams
4
+ from mcp_agent.llm.providers.augmented_llm_openai import OpenAIAugmentedLLM
5
+
6
+ DEFAULT_OLLAMA_BASE_URL = "http://localhost:11434/v1"
7
+ DEFAULT_OLLAMA_MODEL = "llama3.2:latest"
8
+ DEFAULT_OLLAMA_API_KEY = "ollama"
9
+
10
+
11
+ class GenericAugmentedLLM(OpenAIAugmentedLLM):
12
+ def __init__(self, *args, **kwargs) -> None:
13
+ kwargs["provider_name"] = "GenericOpenAI" # Set provider name in kwargs
14
+ super().__init__(*args, **kwargs) # Properly pass args and kwargs to parent
15
+
16
+ def _initialize_default_params(self, kwargs: dict) -> RequestParams:
17
+ """Initialize Deepseek-specific default parameters"""
18
+ chosen_model = kwargs.get("model", DEFAULT_OLLAMA_MODEL)
19
+
20
+ return RequestParams(
21
+ model=chosen_model,
22
+ systemPrompt=self.instruction,
23
+ parallel_tool_calls=True,
24
+ max_iterations=10,
25
+ use_history=True,
26
+ )
27
+
28
+ def _api_key(self) -> str:
29
+ config = self.context.config
30
+ api_key = None
31
+
32
+ if config and config.generic:
33
+ api_key = config.generic.api_key
34
+ if api_key == "<your-api-key-here>":
35
+ api_key = None
36
+
37
+ if api_key is None:
38
+ api_key = os.getenv("GENERIC_API_KEY")
39
+
40
+ return api_key or "ollama"
41
+
42
+ def _base_url(self) -> str:
43
+ if self.context.config and self.context.config.deepseek:
44
+ base_url = self.context.config.deepseek.base_url
45
+
46
+ return base_url if base_url else DEFAULT_OLLAMA_BASE_URL
@@ -115,7 +115,6 @@ class OpenAIAugmentedLLM(AugmentedLLM[ChatCompletionMessageParam, ChatCompletion
115
115
  self,
116
116
  message,
117
117
  request_params: RequestParams | None = None,
118
- response_model: Type[ModelT] | None = None,
119
118
  ) -> List[ChatCompletionMessage]:
120
119
  """
121
120
  Process a query using an LLM and available tools.
@@ -192,16 +191,9 @@ class OpenAIAugmentedLLM(AugmentedLLM[ChatCompletionMessageParam, ChatCompletion
192
191
  self.logger.debug(f"{arguments}")
193
192
  self._log_chat_progress(self.chat_turn(), model=model)
194
193
 
195
- if response_model is None:
196
- executor_result = await self.executor.execute(
197
- openai_client.chat.completions.create, **arguments
198
- )
199
- else:
200
- executor_result = await self.executor.execute(
201
- openai_client.beta.chat.completions.parse,
202
- **arguments,
203
- response_format=response_model,
204
- )
194
+ executor_result = await self.executor.execute(
195
+ openai_client.chat.completions.create, **arguments
196
+ )
205
197
 
206
198
  response = executor_result[0]
207
199