meshagent-anthropic 0.22.2__tar.gz → 0.24.0__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.
Files changed (25) hide show
  1. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/CHANGELOG.md +12 -0
  2. {meshagent_anthropic-0.22.2/meshagent_anthropic.egg-info → meshagent_anthropic-0.24.0}/PKG-INFO +4 -4
  3. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/meshagent/anthropic/messages_adapter.py +60 -40
  4. meshagent_anthropic-0.24.0/meshagent/anthropic/version.py +1 -0
  5. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0/meshagent_anthropic.egg-info}/PKG-INFO +4 -4
  6. meshagent_anthropic-0.24.0/meshagent_anthropic.egg-info/requires.txt +6 -0
  7. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/pyproject.toml +3 -3
  8. meshagent_anthropic-0.22.2/meshagent/anthropic/version.py +0 -1
  9. meshagent_anthropic-0.22.2/meshagent_anthropic.egg-info/requires.txt +0 -6
  10. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/LICENSE +0 -0
  11. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/MANIFEST.in +0 -0
  12. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/README.md +0 -0
  13. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/meshagent/anthropic/__init__.py +0 -0
  14. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/meshagent/anthropic/mcp.py +0 -0
  15. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/meshagent/anthropic/openai_responses_stream_adapter.py +0 -0
  16. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/meshagent/anthropic/proxy/__init__.py +0 -0
  17. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/meshagent/anthropic/proxy/proxy.py +0 -0
  18. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/meshagent/anthropic/tests/anthropic_live_test.py +0 -0
  19. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/meshagent/anthropic/tests/mcp_test.py +0 -0
  20. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/meshagent/anthropic/tests/messages_adapter_test.py +0 -0
  21. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/meshagent/anthropic/tests/openai_responses_stream_adapter_test.py +0 -0
  22. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/meshagent_anthropic.egg-info/SOURCES.txt +0 -0
  23. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/meshagent_anthropic.egg-info/dependency_links.txt +0 -0
  24. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/meshagent_anthropic.egg-info/top_level.txt +0 -0
  25. {meshagent_anthropic-0.22.2 → meshagent_anthropic-0.24.0}/setup.cfg +0 -0
@@ -1,3 +1,15 @@
1
+ ## [0.24.0]
2
+ - Breaking: removed `AgentsClient.ask` and `list_agents` from the Python SDK.
3
+ - Breaking: `AgentCallContext` renamed to `TaskContext`, planning module and Pydantic agent utilities removed, and discovery toolkit no longer lists agents.
4
+ - Feature: TaskRunner refactor adds RunTaskTool/RemoteToolkit support plus a `run()` helper for direct execution.
5
+ - Feature: task-runner CLI adds `run` and an `allow_model_selection` toggle for LLM task runners; legacy agent ask/list CLI commands removed.
6
+
7
+ ## [0.23.0]
8
+ - Breaking: service template APIs now expect YAML template strings and ServiceTemplateSpec.to_service_spec() no longer accepts values; use ServiceTemplateSpec.from_yaml(..., values) for Jinja rendering
9
+ - Added Jinja/YAML template parsing and ServiceSpec.from_yaml for loading service specs from YAML
10
+ - Added file storage mounts and token role fields in service/container specs
11
+ - Added render_template client method plus new User/UserRoomGrant models and a none project role
12
+
1
13
  ## [0.22.2]
2
14
  - Stability
3
15
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-anthropic
3
- Version: 0.22.2
3
+ Version: 0.24.0
4
4
  Summary: Anthropic Building Blocks for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://docs.meshagent.com
@@ -11,9 +11,9 @@ Description-Content-Type: text/markdown
11
11
  License-File: LICENSE
12
12
  Requires-Dist: pytest~=8.4
13
13
  Requires-Dist: pytest-asyncio~=0.26
14
- Requires-Dist: meshagent-api~=0.22.2
15
- Requires-Dist: meshagent-agents~=0.22.2
16
- Requires-Dist: meshagent-tools~=0.22.2
14
+ Requires-Dist: meshagent-api~=0.24.0
15
+ Requires-Dist: meshagent-agents~=0.24.0
16
+ Requires-Dist: meshagent-tools~=0.24.0
17
17
  Requires-Dist: anthropic<1.0,>=0.25
18
18
  Dynamic: license-file
19
19
 
@@ -153,50 +153,56 @@ class AnthropicMessagesToolResponseAdapter(ToolResponseAdapter):
153
153
  return [{"role": "user", "content": response.outputs}]
154
154
 
155
155
  tool_result_content: list[dict]
156
-
157
- if isinstance(response, FileResponse):
158
- mime_type = (response.mime_type or "").lower()
159
-
160
- if mime_type == "image/jpg":
161
- mime_type = "image/jpeg"
162
-
163
- if mime_type.startswith("image/"):
164
- allowed = {"image/jpeg", "image/png", "image/gif", "image/webp"}
165
- if mime_type not in allowed:
166
- output = f"{response.name} was returned as {response.mime_type}, which Anthropic does not accept as an image block"
167
- tool_result_content = [_text_block(output)]
168
- else:
156
+ try:
157
+ if isinstance(response, FileResponse):
158
+ mime_type = (response.mime_type or "").lower()
159
+
160
+ if mime_type == "image/jpg":
161
+ mime_type = "image/jpeg"
162
+
163
+ if mime_type.startswith("image/"):
164
+ allowed = {"image/jpeg", "image/png", "image/gif", "image/webp"}
165
+ if mime_type not in allowed:
166
+ output = f"{response.name} was returned as {response.mime_type}, which Anthropic does not accept as an image block"
167
+ tool_result_content = [_text_block(output)]
168
+ else:
169
+ tool_result_content = [
170
+ {
171
+ "type": "image",
172
+ "source": {
173
+ "type": "base64",
174
+ "media_type": mime_type,
175
+ "data": base64.b64encode(response.data).decode(
176
+ "utf-8"
177
+ ),
178
+ },
179
+ }
180
+ ]
181
+
182
+ elif mime_type == "application/pdf":
169
183
  tool_result_content = [
170
184
  {
171
- "type": "image",
185
+ "type": "document",
186
+ "title": response.name,
172
187
  "source": {
173
188
  "type": "base64",
174
- "media_type": mime_type,
189
+ "media_type": "application/pdf",
175
190
  "data": base64.b64encode(response.data).decode("utf-8"),
176
191
  },
177
192
  }
178
193
  ]
179
194
 
180
- elif mime_type == "application/pdf":
181
- tool_result_content = [
182
- {
183
- "type": "document",
184
- "title": response.name,
185
- "source": {
186
- "type": "base64",
187
- "media_type": "application/pdf",
188
- "data": base64.b64encode(response.data).decode("utf-8"),
189
- },
190
- }
191
- ]
195
+ else:
196
+ output = await self.to_plain_text(room=room, response=response)
197
+ tool_result_content = [_text_block(output)]
192
198
 
193
199
  else:
194
200
  output = await self.to_plain_text(room=room, response=response)
195
201
  tool_result_content = [_text_block(output)]
196
202
 
197
- else:
198
- output = await self.to_plain_text(room=room, response=response)
199
- tool_result_content = [_text_block(output)]
203
+ except Exception as ex:
204
+ logger.error("unable to process tool call results", exc_info=ex)
205
+ tool_result_content = [_text_block(f"Error: {ex}")]
200
206
 
201
207
  message = {
202
208
  "role": "user",
@@ -533,16 +539,30 @@ class AnthropicMessagesAdapter(LLMAdapter[dict]):
533
539
  on_behalf_of=on_behalf_of,
534
540
  caller_context={"chat": context.to_json()},
535
541
  )
536
- tool_response = await tool_bundle.execute(
537
- context=tool_context,
538
- tool_use=tool_use,
539
- )
540
- return await tool_adapter.create_messages(
541
- context=context,
542
- tool_call=tool_use,
543
- room=room,
544
- response=tool_response,
545
- )
542
+ try:
543
+ tool_response = await tool_bundle.execute(
544
+ context=tool_context,
545
+ tool_use=tool_use,
546
+ )
547
+ return await tool_adapter.create_messages(
548
+ context=context,
549
+ tool_call=tool_use,
550
+ room=room,
551
+ response=tool_response,
552
+ )
553
+ except Exception as ex:
554
+ tool_result_content = [_text_block(f"Error: {ex}")]
555
+ message = {
556
+ "role": "user",
557
+ "content": [
558
+ {
559
+ "type": "tool_result",
560
+ "tool_use_id": tool_use.get("id"),
561
+ "content": tool_result_content,
562
+ }
563
+ ],
564
+ }
565
+ return [message]
546
566
 
547
567
  for tool_use in tool_uses:
548
568
  tasks.append(asyncio.create_task(do_tool(tool_use)))
@@ -0,0 +1 @@
1
+ __version__ = "0.24.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-anthropic
3
- Version: 0.22.2
3
+ Version: 0.24.0
4
4
  Summary: Anthropic Building Blocks for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://docs.meshagent.com
@@ -11,9 +11,9 @@ Description-Content-Type: text/markdown
11
11
  License-File: LICENSE
12
12
  Requires-Dist: pytest~=8.4
13
13
  Requires-Dist: pytest-asyncio~=0.26
14
- Requires-Dist: meshagent-api~=0.22.2
15
- Requires-Dist: meshagent-agents~=0.22.2
16
- Requires-Dist: meshagent-tools~=0.22.2
14
+ Requires-Dist: meshagent-api~=0.24.0
15
+ Requires-Dist: meshagent-agents~=0.24.0
16
+ Requires-Dist: meshagent-tools~=0.24.0
17
17
  Requires-Dist: anthropic<1.0,>=0.25
18
18
  Dynamic: license-file
19
19
 
@@ -0,0 +1,6 @@
1
+ pytest~=8.4
2
+ pytest-asyncio~=0.26
3
+ meshagent-api~=0.24.0
4
+ meshagent-agents~=0.24.0
5
+ meshagent-tools~=0.24.0
6
+ anthropic<1.0,>=0.25
@@ -12,9 +12,9 @@ keywords = []
12
12
  dependencies = [
13
13
  "pytest~=8.4",
14
14
  "pytest-asyncio~=0.26",
15
- "meshagent-api~=0.22.2",
16
- "meshagent-agents~=0.22.2",
17
- "meshagent-tools~=0.22.2",
15
+ "meshagent-api~=0.24.0",
16
+ "meshagent-agents~=0.24.0",
17
+ "meshagent-tools~=0.24.0",
18
18
  "anthropic>=0.25,<1.0"
19
19
  ]
20
20
 
@@ -1 +0,0 @@
1
- __version__ = "0.22.2"
@@ -1,6 +0,0 @@
1
- pytest~=8.4
2
- pytest-asyncio~=0.26
3
- meshagent-api~=0.22.2
4
- meshagent-agents~=0.22.2
5
- meshagent-tools~=0.22.2
6
- anthropic<1.0,>=0.25