jaf-py 2.6.4__py3-none-any.whl → 2.6.5__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.
- jaf/__init__.py +1 -1
- jaf/core/agent_tool.py +64 -3
- jaf/core/tracing.py +1 -1
- {jaf_py-2.6.4.dist-info → jaf_py-2.6.5.dist-info}/METADATA +2 -2
- {jaf_py-2.6.4.dist-info → jaf_py-2.6.5.dist-info}/RECORD +9 -9
- {jaf_py-2.6.4.dist-info → jaf_py-2.6.5.dist-info}/WHEEL +0 -0
- {jaf_py-2.6.4.dist-info → jaf_py-2.6.5.dist-info}/entry_points.txt +0 -0
- {jaf_py-2.6.4.dist-info → jaf_py-2.6.5.dist-info}/licenses/LICENSE +0 -0
- {jaf_py-2.6.4.dist-info → jaf_py-2.6.5.dist-info}/top_level.txt +0 -0
jaf/__init__.py
CHANGED
jaf/core/agent_tool.py
CHANGED
|
@@ -8,7 +8,6 @@ by other agents, enabling hierarchical agent orchestration patterns.
|
|
|
8
8
|
import asyncio
|
|
9
9
|
import json
|
|
10
10
|
import inspect
|
|
11
|
-
import inspect
|
|
12
11
|
import contextvars
|
|
13
12
|
from typing import Any, Callable, Dict, List, Optional, Union, Awaitable, TypeVar, get_type_hints
|
|
14
13
|
|
|
@@ -181,11 +180,73 @@ def create_agent_tool(
|
|
|
181
180
|
# Session inheritance is configurable via preserve_session.
|
|
182
181
|
# - When True: inherit parent's conversation_id and memory (shared memory/session)
|
|
183
182
|
# - When False: do not inherit (ephemeral, per-invocation sub-agent run)
|
|
183
|
+
#
|
|
184
|
+
# Model selection for subagents:
|
|
185
|
+
# - If subagent has its own model_config, use that model AND create appropriate provider
|
|
186
|
+
# - If subagent has no model_config, inherit parent's model_override and provider
|
|
187
|
+
# This allows subagents to run on different models than the parent agent
|
|
188
|
+
subagent_model_override = None
|
|
189
|
+
subagent_model_provider = parent_config.model_provider
|
|
190
|
+
|
|
191
|
+
if agent.model_config and agent.model_config.name:
|
|
192
|
+
subagent_model_name = agent.model_config.name
|
|
193
|
+
# Subagent has explicit model_config - create appropriate provider for it
|
|
194
|
+
# Use model_override to force the subagent's model
|
|
195
|
+
subagent_model_override = subagent_model_name
|
|
196
|
+
|
|
197
|
+
# Create provider based on model type
|
|
198
|
+
import os
|
|
199
|
+
if subagent_model_name.startswith("azure/"):
|
|
200
|
+
try:
|
|
201
|
+
from jaf.providers import make_litellm_sdk_provider
|
|
202
|
+
azure_api_key = os.getenv("AZURE_API_KEY")
|
|
203
|
+
azure_api_base = os.getenv("AZURE_API_BASE")
|
|
204
|
+
azure_api_version = os.getenv("AZURE_API_VERSION")
|
|
205
|
+
subagent_model_provider = make_litellm_sdk_provider(
|
|
206
|
+
model=subagent_model_name,
|
|
207
|
+
api_key=azure_api_key,
|
|
208
|
+
base_url=azure_api_base,
|
|
209
|
+
api_version=azure_api_version,
|
|
210
|
+
)
|
|
211
|
+
except Exception as e:
|
|
212
|
+
# Fallback to parent provider if Azure provider creation fails
|
|
213
|
+
subagent_model_provider = parent_config.model_provider
|
|
214
|
+
elif subagent_model_name.startswith("vertex_ai/"):
|
|
215
|
+
try:
|
|
216
|
+
from jaf.providers import make_litellm_sdk_provider
|
|
217
|
+
vertex_project = os.getenv("VERTEXAI_PROJECT")
|
|
218
|
+
vertex_location = os.getenv("VERTEXAI_LOCATION")
|
|
219
|
+
if not vertex_project or not vertex_location:
|
|
220
|
+
raise ValueError(
|
|
221
|
+
"VERTEXAI_PROJECT and VERTEXAI_LOCATION environment variables are required for vertex_ai/ models"
|
|
222
|
+
)
|
|
223
|
+
subagent_model_provider = make_litellm_sdk_provider(
|
|
224
|
+
model=subagent_model_name,
|
|
225
|
+
vertex_project=vertex_project,
|
|
226
|
+
vertex_location=vertex_location,
|
|
227
|
+
)
|
|
228
|
+
except Exception:
|
|
229
|
+
subagent_model_provider = parent_config.model_provider
|
|
230
|
+
elif subagent_model_name.startswith("glm"):
|
|
231
|
+
try:
|
|
232
|
+
from jaf.providers import make_litellm_provider
|
|
233
|
+
subagent_model_provider = make_litellm_provider(
|
|
234
|
+
base_url=os.getenv("LITELLM_BASE_URL"),
|
|
235
|
+
api_key=os.getenv("LITELLM_KEY")
|
|
236
|
+
)
|
|
237
|
+
except Exception:
|
|
238
|
+
subagent_model_provider = parent_config.model_provider
|
|
239
|
+
# For other models, use parent's provider (may work or may not)
|
|
240
|
+
else:
|
|
241
|
+
# No subagent model_config - inherit from parent
|
|
242
|
+
subagent_model_override = parent_config.model_override
|
|
243
|
+
subagent_model_provider = parent_config.model_provider
|
|
244
|
+
|
|
184
245
|
sub_config = RunConfig(
|
|
185
246
|
agent_registry={agent.name: agent, **parent_config.agent_registry},
|
|
186
|
-
model_provider=
|
|
247
|
+
model_provider=subagent_model_provider,
|
|
187
248
|
max_turns=max_turns or parent_config.max_turns,
|
|
188
|
-
model_override=
|
|
249
|
+
model_override=subagent_model_override,
|
|
189
250
|
initial_input_guardrails=parent_config.initial_input_guardrails,
|
|
190
251
|
final_output_guardrails=parent_config.final_output_guardrails,
|
|
191
252
|
on_event=parent_config.on_event,
|
jaf/core/tracing.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jaf-py
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.5
|
|
4
4
|
Summary: A purely functional agent framework with immutable state and composable tools - Python implementation
|
|
5
5
|
Author: JAF Contributors
|
|
6
6
|
Maintainer: JAF Contributors
|
|
@@ -82,7 +82,7 @@ Dynamic: license-file
|
|
|
82
82
|
|
|
83
83
|
<!--  -->
|
|
84
84
|
|
|
85
|
-
[](https://github.com/xynehq/jaf-py)
|
|
86
86
|
[](https://www.python.org/)
|
|
87
87
|
[](https://xynehq.github.io/jaf-py/)
|
|
88
88
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
jaf/__init__.py,sha256=
|
|
1
|
+
jaf/__init__.py,sha256=clE4UWW2Y5bty2ataCPqnL__bVP8HGO1EBIR1VYI9ZU,8652
|
|
2
2
|
jaf/cli.py,sha256=EDMMA5uX0e3TUIedLdyP3p4Qy-aXADvpht3VgJPJagU,8299
|
|
3
3
|
jaf/exceptions.py,sha256=FdLIw7bdCNtBYfqRyJBkRT4Z1vWuvkzrMqFiMAzjL8Y,9158
|
|
4
4
|
jaf/a2a/__init__.py,sha256=r4W-WHZNjoxR8EQ0x41_rY3fl12OH5qcSn0KycXaKKU,7752
|
|
@@ -39,7 +39,7 @@ jaf/a2a/tests/test_integration.py,sha256=hfGAtwXOfV9OXrFgS94twMbzxMQ4Vfj0KYoNT5V
|
|
|
39
39
|
jaf/a2a/tests/test_protocol.py,sha256=3Ov9fTqznDqJLg8PqY2oy9I2Tpvwv_N0aN-rpFpAmjM,22215
|
|
40
40
|
jaf/a2a/tests/test_types.py,sha256=rSUhZmOQcFrgNiEg4hDCZwypj19h6mSamVapWkrzZWc,17329
|
|
41
41
|
jaf/core/__init__.py,sha256=4IqKRspv8gvgAtbmvaMvUgYZB1fSIy3vsyCXkjF8PjU,2013
|
|
42
|
-
jaf/core/agent_tool.py,sha256=
|
|
42
|
+
jaf/core/agent_tool.py,sha256=bwYQtRK9YfwPM_3s2kjp3Vl-6vR64jUlOnviqM0Z5tM,15411
|
|
43
43
|
jaf/core/analytics.py,sha256=ypdhllyOThXZB-TY_eR1t1n2qrnAVN7Ljb8PaOtJft0,23267
|
|
44
44
|
jaf/core/checkpoint.py,sha256=O7mfi7gFOAUgJ3zHzgJsr11uzn-BU-Vj1iKyKjcirMk,8398
|
|
45
45
|
jaf/core/composition.py,sha256=Tj0-FRTVWygmAfsBLld7pnZK4nrGMMBx2YYJW_KQPoo,25393
|
|
@@ -56,7 +56,7 @@ jaf/core/state.py,sha256=fdWDc2DQ-o_g_8E4ibg2QM0Vad_XUique3a5iYBwGZo,9516
|
|
|
56
56
|
jaf/core/streaming.py,sha256=5ntOtJrZVCHuGsygquyCLG2J5yuSxE6DN5OM-BrQiGw,16818
|
|
57
57
|
jaf/core/tool_results.py,sha256=L9U3JDQAjAH5YR7iMpSxfVky2Nxo6FYQs4WE05RATaQ,11283
|
|
58
58
|
jaf/core/tools.py,sha256=rHxzAfGVGpYk3YJKmrq3AQLW0oE3ACkiJBOwle2bLdc,15146
|
|
59
|
-
jaf/core/tracing.py,sha256=
|
|
59
|
+
jaf/core/tracing.py,sha256=p5C7l0X1Is3cNjsINiEsUv01rnUFz9Z0lh4DFWRXsUE,59360
|
|
60
60
|
jaf/core/types.py,sha256=lJXlkL55devvzbc5efT5FdQ_LX3JcsMWA10Hy8Cd5Qs,37015
|
|
61
61
|
jaf/core/workflows.py,sha256=0825AoD1QwEiGAs5IRlWHmaKrjurx6xF7oDJR6POBsg,25651
|
|
62
62
|
jaf/memory/__init__.py,sha256=YfANOg5vUFSPVG7gpBE4_lYkV5X3_U6Yj9v1_QexfN0,1396
|
|
@@ -89,9 +89,9 @@ jaf/visualization/functional_core.py,sha256=0Xs2R8ELADKNIgokcbjuxmWwxEyCH1yXIEdG
|
|
|
89
89
|
jaf/visualization/graphviz.py,sha256=EwWVIRv8Z7gTiO5Spvcm-z_UUQ1oWNPRgdE33ZzFwx8,11569
|
|
90
90
|
jaf/visualization/imperative_shell.py,sha256=N5lWzOLMIU_iCoy3n5WCg49eec8VxV8f7JIG6_wNtVw,2506
|
|
91
91
|
jaf/visualization/types.py,sha256=90G8oClsFa_APqTuMrTW6KjD0oG9I4kVur773dXNW0E,1393
|
|
92
|
-
jaf_py-2.6.
|
|
93
|
-
jaf_py-2.6.
|
|
94
|
-
jaf_py-2.6.
|
|
95
|
-
jaf_py-2.6.
|
|
96
|
-
jaf_py-2.6.
|
|
97
|
-
jaf_py-2.6.
|
|
92
|
+
jaf_py-2.6.5.dist-info/licenses/LICENSE,sha256=LXUQBJxdyr-7C4bk9cQBwvsF_xwA-UVstDTKabpcjlI,1063
|
|
93
|
+
jaf_py-2.6.5.dist-info/METADATA,sha256=sacV8SfppPc9buMj-yoaNvDqrtF7S-k9P51zRZqp6ls,27743
|
|
94
|
+
jaf_py-2.6.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
95
|
+
jaf_py-2.6.5.dist-info/entry_points.txt,sha256=OtIJeNJpb24kgGrqRx9szGgDx1vL9ayq8uHErmu7U5w,41
|
|
96
|
+
jaf_py-2.6.5.dist-info/top_level.txt,sha256=Xu1RZbGaM4_yQX7bpalo881hg7N_dybaOW282F15ruE,4
|
|
97
|
+
jaf_py-2.6.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|