grasp_agents 0.3.5__tar.gz → 0.3.6__tar.gz
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.
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/PKG-INFO +1 -1
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/pyproject.toml +1 -1
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/cloud_llm.py +24 -16
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/openai/openai_llm.py +9 -5
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/.gitignore +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/LICENSE.md +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/README.md +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/__init__.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/comm_processor.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/costs_dict.yaml +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/generics_utils.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/grasp_logging.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/http_client.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/llm.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/llm_agent.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/llm_agent_memory.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/llm_policy_executor.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/memory.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/message_history.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/openai/__init__.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/openai/completion_chunk_converters.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/openai/completion_converters.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/openai/content_converters.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/openai/converters.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/openai/message_converters.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/openai/tool_converters.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/packet.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/packet_pool.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/printer.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/processor.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/prompt_builder.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/rate_limiting/__init__.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/rate_limiting/rate_limiter_chunked.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/rate_limiting/types.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/rate_limiting/utils.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/run_context.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/typing/__init__.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/typing/completion.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/typing/completion_chunk.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/typing/content.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/typing/converters.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/typing/events.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/typing/io.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/typing/message.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/typing/tool.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/usage_tracker.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/utils.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/workflow/__init__.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/workflow/looped_workflow.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/workflow/parallel_processor.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/workflow/sequential_workflow.py +0 -0
- {grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/workflow/workflow_processor.py +0 -0
@@ -127,21 +127,32 @@ class CloudLLM(LLM[SettingsT_co, ConvertT_co], Generic[SettingsT_co, ConvertT_co
|
|
127
127
|
)
|
128
128
|
|
129
129
|
self._model_name = model_name
|
130
|
+
model_name_parts = model_name.split(":", 1)
|
131
|
+
|
132
|
+
if len(model_name_parts) == 2 and model_name_parts[0] in PROVIDERS:
|
133
|
+
api_provider, api_model_name = model_name_parts
|
134
|
+
if api_provider not in PROVIDERS:
|
135
|
+
raise ValueError(
|
136
|
+
f"API provider '{api_provider}' is not supported. "
|
137
|
+
f"Supported providers are: {', '.join(PROVIDERS.keys())}"
|
138
|
+
)
|
130
139
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
140
|
+
self._api_provider: APIProvider | None = api_provider
|
141
|
+
self._api_model_name: str = api_model_name
|
142
|
+
self._base_url: str | None = PROVIDERS[api_provider]["base_url"]
|
143
|
+
self._api_key: str | None = PROVIDERS[api_provider]["api_key"]
|
144
|
+
self._struct_outputs_support: bool = any(
|
145
|
+
fnmatch.fnmatch(self._model_name, pat)
|
146
|
+
for pat in PROVIDERS[api_provider]["struct_outputs_support"]
|
137
147
|
)
|
138
|
-
self._api_provider: APIProvider = api_provider
|
139
|
-
self._api_model_name: str = api_model_name
|
140
148
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
149
|
+
else:
|
150
|
+
self._api_provider = None
|
151
|
+
self._api_model_name = model_name
|
152
|
+
self._base_url = None
|
153
|
+
self._api_key = None
|
154
|
+
self._struct_outputs_support = False
|
155
|
+
|
145
156
|
if (
|
146
157
|
self._llm_settings.get("use_struct_outputs")
|
147
158
|
and not self._struct_outputs_support
|
@@ -161,9 +172,6 @@ class CloudLLM(LLM[SettingsT_co, ConvertT_co], Generic[SettingsT_co, ConvertT_co
|
|
161
172
|
)
|
162
173
|
)
|
163
174
|
self.no_tqdm = no_tqdm
|
164
|
-
|
165
|
-
self._base_url: str = PROVIDERS[api_provider]["base_url"]
|
166
|
-
self._api_key: str | None = PROVIDERS[api_provider]["api_key"]
|
167
175
|
self._client: Any
|
168
176
|
|
169
177
|
self._async_http_client: httpx.AsyncClient | None = None
|
@@ -178,7 +186,7 @@ class CloudLLM(LLM[SettingsT_co, ConvertT_co], Generic[SettingsT_co, ConvertT_co
|
|
178
186
|
self.num_generation_retries = num_generation_retries
|
179
187
|
|
180
188
|
@property
|
181
|
-
def api_provider(self) -> APIProvider:
|
189
|
+
def api_provider(self) -> APIProvider | None:
|
182
190
|
return self._api_provider
|
183
191
|
|
184
192
|
@property
|
@@ -80,6 +80,7 @@ class OpenAILLM(CloudLLM[OpenAILLMSettings, OpenAIConverters]):
|
|
80
80
|
dict[str, Any] | AsyncHTTPClientParams | None
|
81
81
|
) = None,
|
82
82
|
async_openai_client_params: dict[str, Any] | None = None,
|
83
|
+
client: AsyncOpenAI | None = None,
|
83
84
|
# Rate limiting
|
84
85
|
rate_limiter: (RateLimiterC[Messages, AssistantMessage] | None) = None,
|
85
86
|
rate_limiter_rpm: float | None = None,
|
@@ -117,11 +118,14 @@ class OpenAILLM(CloudLLM[OpenAILLMSettings, OpenAIConverters]):
|
|
117
118
|
_async_openai_client_params["http_client"] = self._async_http_client
|
118
119
|
|
119
120
|
# TODO: context manager for async client
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
121
|
+
if client:
|
122
|
+
self._client = client
|
123
|
+
else:
|
124
|
+
self._client: AsyncOpenAI = AsyncOpenAI(
|
125
|
+
base_url=self._base_url,
|
126
|
+
api_key=self._api_key,
|
127
|
+
**_async_openai_client_params,
|
128
|
+
)
|
125
129
|
|
126
130
|
async def _get_completion(
|
127
131
|
self,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/openai/completion_chunk_converters.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{grasp_agents-0.3.5 → grasp_agents-0.3.6}/src/grasp_agents/rate_limiting/rate_limiter_chunked.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|