pyagentic-core 2.3.0a3__tar.gz → 2.3.0a4__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.
- {pyagentic_core-2.3.0a3/pyagentic_core.egg-info → pyagentic_core-2.3.0a4}/PKG-INFO +1 -1
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_base/_agent/_agent.py +2 -1
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_utils/_image.py +1 -1
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/llm/_openai.py +6 -3
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/models/llm.py +1 -1
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/models/response.py +3 -1
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4/pyagentic_core.egg-info}/PKG-INFO +1 -1
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyproject.toml +1 -1
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/LICENSE +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/README.md +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/__init__.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_base/__init__.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_base/_agent/__init__.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_base/_agent/_agent_linking.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_base/_agent/_agent_state.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_base/_exceptions.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_base/_info.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_base/_metaclasses.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_base/_ref.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_base/_spec.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_base/_state.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_base/_tool.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_base/_validation.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_utils/_typing.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/_utils/_warnings.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/llm/__init__.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/llm/_anthropic.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/llm/_gemini.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/llm/_mock.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/llm/_openaiv1.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/llm/_provider.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/logging.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/models/tracing.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/policies/__init__.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/policies/_events.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/policies/_policy.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/tracing/__init__.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/tracing/_basic.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/tracing/_langfuse.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/tracing/_tracer.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic/updates.py +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic_core.egg-info/SOURCES.txt +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic_core.egg-info/dependency_links.txt +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic_core.egg-info/requires.txt +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic_core.egg-info/top_level.txt +0 -0
- {pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/setup.cfg +0 -0
|
@@ -38,7 +38,7 @@ from pyagentic.llm._provider import LLMProvider
|
|
|
38
38
|
from pyagentic.llm import LLMProviders
|
|
39
39
|
from pyagentic.tracing._tracer import AgentTracer, traced
|
|
40
40
|
from pyagentic.tracing import BasicTracer
|
|
41
|
-
|
|
41
|
+
from pyagentic._utils._image import _encode_image
|
|
42
42
|
|
|
43
43
|
logger = get_logger(__name__)
|
|
44
44
|
|
|
@@ -441,6 +441,7 @@ class BaseAgent(metaclass=AgentMeta):
|
|
|
441
441
|
result=stringified_result, id_=tool_call.id
|
|
442
442
|
)
|
|
443
443
|
)
|
|
444
|
+
result = _encode_image(result)
|
|
444
445
|
# Add the image as a user message so the LLM can see it
|
|
445
446
|
self.state._messages.append(
|
|
446
447
|
Message(role="user", content=f"Image from {tool_call.name}:", image=result)
|
|
@@ -106,13 +106,16 @@ class OpenAIProvider(LLMProvider):
|
|
|
106
106
|
|
|
107
107
|
# If message has an image, convert to OpenAI's content array format
|
|
108
108
|
if message.image is not None:
|
|
109
|
-
image_url = _encode_image(message.image)
|
|
110
|
-
|
|
111
109
|
# Build content array with text and image
|
|
112
110
|
content = []
|
|
113
111
|
if message.content:
|
|
114
112
|
content.append({"type": "text", "text": message.content})
|
|
115
|
-
content.append(
|
|
113
|
+
content.append(
|
|
114
|
+
{
|
|
115
|
+
"type": "image_url",
|
|
116
|
+
"image_url": {"url": f"data:image/png;base64,{message.image}"},
|
|
117
|
+
}
|
|
118
|
+
)
|
|
116
119
|
|
|
117
120
|
msg_dict["content"] = content
|
|
118
121
|
# Remove the image field as it's now in content
|
|
@@ -69,8 +69,10 @@ class ToolResponse(BaseModel):
|
|
|
69
69
|
case _:
|
|
70
70
|
raise Exception(f"Unsupported type: {param_type}")
|
|
71
71
|
|
|
72
|
+
return_type = str if tool_def.return_type == Image else tool_def.return_type
|
|
73
|
+
|
|
72
74
|
return create_model(
|
|
73
|
-
f"ToolResponse[{tool_def.name}]", __base__=cls, output=
|
|
75
|
+
f"ToolResponse[{tool_def.name}]", __base__=cls, output=return_type, **fields
|
|
74
76
|
)
|
|
75
77
|
|
|
76
78
|
|
|
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
|
|
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
|
{pyagentic_core-2.3.0a3 → pyagentic_core-2.3.0a4}/pyagentic_core.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|