unique_orchestrator 1.7.3__py3-none-any.whl → 1.7.4__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.
Potentially problematic release.
This version of unique_orchestrator might be problematic. Click here for more details.
- unique_orchestrator/unique_ai_builder.py +69 -41
- {unique_orchestrator-1.7.3.dist-info → unique_orchestrator-1.7.4.dist-info}/METADATA +5 -2
- {unique_orchestrator-1.7.3.dist-info → unique_orchestrator-1.7.4.dist-info}/RECORD +5 -5
- {unique_orchestrator-1.7.3.dist-info → unique_orchestrator-1.7.4.dist-info}/LICENSE +0 -0
- {unique_orchestrator-1.7.3.dist-info → unique_orchestrator-1.7.4.dist-info}/WHEEL +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
2
|
from logging import Logger
|
|
3
|
-
from typing import NamedTuple
|
|
3
|
+
from typing import NamedTuple, cast
|
|
4
4
|
|
|
5
5
|
from openai import AsyncOpenAI
|
|
6
6
|
from unique_follow_up_questions.follow_up_postprocessor import (
|
|
@@ -46,11 +46,13 @@ from unique_toolkit.agentic.thinking_manager.thinking_manager import (
|
|
|
46
46
|
from unique_toolkit.agentic.tools.a2a import (
|
|
47
47
|
A2AManager,
|
|
48
48
|
ExtendedSubAgentToolConfig,
|
|
49
|
+
SubAgentDisplaySpec,
|
|
49
50
|
SubAgentEvaluationService,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
SubAgentEvaluationSpec,
|
|
52
|
+
SubAgentReferencesPostprocessor,
|
|
53
|
+
SubAgentResponsesDisplayPostprocessor,
|
|
53
54
|
SubAgentResponsesPostprocessorConfig,
|
|
55
|
+
SubAgentResponseWatcher,
|
|
54
56
|
)
|
|
55
57
|
from unique_toolkit.agentic.tools.config import ToolBuildConfig
|
|
56
58
|
from unique_toolkit.agentic.tools.mcp.manager import MCPManager
|
|
@@ -107,6 +109,7 @@ class _CommonComponents(NamedTuple):
|
|
|
107
109
|
history_manager: HistoryManager
|
|
108
110
|
evaluation_manager: EvaluationManager
|
|
109
111
|
postprocessor_manager: PostprocessorManager
|
|
112
|
+
response_watcher: SubAgentResponseWatcher
|
|
110
113
|
# Tool Manager Components
|
|
111
114
|
tool_progress_reporter: ToolProgressReporter
|
|
112
115
|
tool_manager_config: ToolManagerConfig
|
|
@@ -126,6 +129,8 @@ def _build_common(
|
|
|
126
129
|
|
|
127
130
|
uploaded_documents = content_service.get_documents_uploaded_to_chat()
|
|
128
131
|
|
|
132
|
+
response_watcher = SubAgentResponseWatcher()
|
|
133
|
+
|
|
129
134
|
tool_progress_reporter = ToolProgressReporter(
|
|
130
135
|
chat_service=chat_service,
|
|
131
136
|
config=config.agent.services.tool_progress_reporter_config,
|
|
@@ -174,7 +179,9 @@ def _build_common(
|
|
|
174
179
|
a2a_manager = A2AManager(
|
|
175
180
|
logger=logger,
|
|
176
181
|
tool_progress_reporter=tool_progress_reporter,
|
|
182
|
+
response_watcher=response_watcher,
|
|
177
183
|
)
|
|
184
|
+
|
|
178
185
|
tool_manager_config = ToolManagerConfig(
|
|
179
186
|
tools=config.space.tools,
|
|
180
187
|
max_tool_calls=config.agent.experimental.loop_configuration.max_tool_calls_per_iteration,
|
|
@@ -222,6 +229,7 @@ def _build_common(
|
|
|
222
229
|
tool_manager_config=tool_manager_config,
|
|
223
230
|
mcp_servers=event.payload.mcp_servers,
|
|
224
231
|
postprocessor_manager=postprocessor_manager,
|
|
232
|
+
response_watcher=response_watcher,
|
|
225
233
|
)
|
|
226
234
|
|
|
227
235
|
|
|
@@ -341,16 +349,15 @@ async def _build_responses(
|
|
|
341
349
|
_add_sub_agents_postprocessor(
|
|
342
350
|
postprocessor_manager=postprocessor_manager,
|
|
343
351
|
tool_manager=tool_manager,
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
chat_id=event.payload.chat_id,
|
|
347
|
-
sleep_time_before_update=config.agent.experimental.sub_agents_config.sleep_time_before_update,
|
|
352
|
+
config=config,
|
|
353
|
+
response_watcher=common_components.response_watcher,
|
|
348
354
|
)
|
|
349
355
|
_add_sub_agents_evaluation(
|
|
350
356
|
evaluation_manager=common_components.evaluation_manager,
|
|
351
357
|
tool_manager=tool_manager,
|
|
352
358
|
config=config,
|
|
353
359
|
event=event,
|
|
360
|
+
response_watcher=common_components.response_watcher,
|
|
354
361
|
)
|
|
355
362
|
|
|
356
363
|
return UniqueAIResponsesApi(
|
|
@@ -414,16 +421,15 @@ def _build_completions(
|
|
|
414
421
|
_add_sub_agents_postprocessor(
|
|
415
422
|
postprocessor_manager=postprocessor_manager,
|
|
416
423
|
tool_manager=tool_manager,
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
chat_id=event.payload.chat_id,
|
|
420
|
-
sleep_time_before_update=config.agent.experimental.sub_agents_config.sleep_time_before_update,
|
|
424
|
+
config=config,
|
|
425
|
+
response_watcher=common_components.response_watcher,
|
|
421
426
|
)
|
|
422
427
|
_add_sub_agents_evaluation(
|
|
423
428
|
evaluation_manager=common_components.evaluation_manager,
|
|
424
429
|
tool_manager=tool_manager,
|
|
425
430
|
config=config,
|
|
426
431
|
event=event,
|
|
432
|
+
response_watcher=common_components.response_watcher,
|
|
427
433
|
)
|
|
428
434
|
|
|
429
435
|
return UniqueAI(
|
|
@@ -447,28 +453,37 @@ def _build_completions(
|
|
|
447
453
|
def _add_sub_agents_postprocessor(
|
|
448
454
|
postprocessor_manager: PostprocessorManager,
|
|
449
455
|
tool_manager: ToolManager | ResponsesApiToolManager,
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
chat_id: str,
|
|
453
|
-
sleep_time_before_update: float,
|
|
456
|
+
config: UniqueAIConfig,
|
|
457
|
+
response_watcher: SubAgentResponseWatcher,
|
|
454
458
|
) -> None:
|
|
455
459
|
sub_agents = tool_manager.sub_agents
|
|
456
460
|
if len(sub_agents) > 0:
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
main_agent_chat_id=chat_id,
|
|
460
|
-
company_id=company_id,
|
|
461
|
-
config=SubAgentResponsesPostprocessorConfig(
|
|
462
|
-
sleep_time_before_update=sleep_time_before_update,
|
|
463
|
-
),
|
|
461
|
+
display_config = SubAgentResponsesPostprocessorConfig(
|
|
462
|
+
sleep_time_before_update=config.agent.experimental.sub_agents_config.sleep_time_before_update,
|
|
464
463
|
)
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
464
|
+
display_specs = []
|
|
465
|
+
for tool in sub_agents:
|
|
466
|
+
tool_config = cast(
|
|
467
|
+
ExtendedSubAgentToolConfig, tool.settings.configuration
|
|
468
|
+
) # (BeforeValidator of ToolBuildConfig)
|
|
469
|
+
|
|
470
|
+
display_specs.append(
|
|
471
|
+
SubAgentDisplaySpec(
|
|
472
|
+
assistant_id=tool_config.assistant_id,
|
|
473
|
+
display_name=tool.display_name(),
|
|
474
|
+
display_config=tool_config.response_display_config,
|
|
475
|
+
)
|
|
471
476
|
)
|
|
477
|
+
reference_postprocessor = SubAgentReferencesPostprocessor(
|
|
478
|
+
response_watcher=response_watcher,
|
|
479
|
+
)
|
|
480
|
+
sub_agent_responses_postprocessor = SubAgentResponsesDisplayPostprocessor(
|
|
481
|
+
config=display_config,
|
|
482
|
+
response_watcher=response_watcher,
|
|
483
|
+
display_specs=display_specs,
|
|
484
|
+
)
|
|
485
|
+
postprocessor_manager.add_postprocessor(reference_postprocessor)
|
|
486
|
+
postprocessor_manager.add_postprocessor(sub_agent_responses_postprocessor)
|
|
472
487
|
|
|
473
488
|
|
|
474
489
|
def _add_sub_agents_evaluation(
|
|
@@ -476,18 +491,31 @@ def _add_sub_agents_evaluation(
|
|
|
476
491
|
tool_manager: ToolManager | ResponsesApiToolManager,
|
|
477
492
|
config: UniqueAIConfig,
|
|
478
493
|
event: ChatEvent,
|
|
494
|
+
response_watcher: SubAgentResponseWatcher,
|
|
479
495
|
) -> None:
|
|
480
496
|
sub_agents = tool_manager.sub_agents
|
|
481
|
-
if
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
497
|
+
if (
|
|
498
|
+
len(sub_agents) > 0
|
|
499
|
+
and config.agent.experimental.sub_agents_config.evaluation_config is not None
|
|
500
|
+
):
|
|
501
|
+
evaluation_specs = []
|
|
502
|
+
for tool in sub_agents:
|
|
503
|
+
tool_config = cast(
|
|
504
|
+
ExtendedSubAgentToolConfig, tool.settings.configuration
|
|
505
|
+
) # (BeforeValidator of ToolBuildConfig)
|
|
506
|
+
|
|
507
|
+
evaluation_specs.append(
|
|
508
|
+
SubAgentEvaluationSpec(
|
|
509
|
+
assistant_id=tool_config.assistant_id,
|
|
510
|
+
display_name=tool.display_name(),
|
|
511
|
+
config=tool_config.evaluation_config,
|
|
493
512
|
)
|
|
513
|
+
)
|
|
514
|
+
|
|
515
|
+
sub_agent_evaluation = SubAgentEvaluationService(
|
|
516
|
+
config=config.agent.experimental.sub_agents_config.evaluation_config,
|
|
517
|
+
language_model_service=LanguageModelService.from_event(event),
|
|
518
|
+
evaluation_specs=evaluation_specs,
|
|
519
|
+
response_watcher=response_watcher,
|
|
520
|
+
)
|
|
521
|
+
evaluation_manager.add_evaluation(sub_agent_evaluation)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unique_orchestrator
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.4
|
|
4
4
|
Summary:
|
|
5
5
|
License: Proprietary
|
|
6
6
|
Author: Andreas Hauri
|
|
@@ -20,7 +20,7 @@ Requires-Dist: unique-internal-search (>=1.0.1,<2.0.0)
|
|
|
20
20
|
Requires-Dist: unique-sdk (>=0.10.34,<0.11.0)
|
|
21
21
|
Requires-Dist: unique-stock-ticker (>=1.0.2,<2.0.0)
|
|
22
22
|
Requires-Dist: unique-swot (>=0.1.0,<0.2.0)
|
|
23
|
-
Requires-Dist: unique-toolkit (>=1.
|
|
23
|
+
Requires-Dist: unique-toolkit (>=1.23.0,<2.0.0)
|
|
24
24
|
Requires-Dist: unique-web-search (>=1.3.1,<2.0.0)
|
|
25
25
|
Description-Content-Type: text/markdown
|
|
26
26
|
|
|
@@ -34,6 +34,9 @@ All notable changes to this project will be documented in this file.
|
|
|
34
34
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
35
35
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
36
36
|
|
|
37
|
+
## [1.7.4] - 2025-11-04
|
|
38
|
+
- Update and adapt to toolkit 1.23.0 (refactor sub agents implementation)
|
|
39
|
+
|
|
37
40
|
## [1.7.3] - 2025-11-03
|
|
38
41
|
- Fixed an issue where new assistant messages were not properly generated during streaming outputs with tool calls; the orchestrator now correctly creates messages via `_create_new_assistant_message_if_loop_response_contains_content` when loop_response includes text and tool invocations.
|
|
39
42
|
|
|
@@ -4,8 +4,8 @@ unique_orchestrator/prompts/system_prompt.jinja2,sha256=YXFdx3PG2p4TKfjEpz7guIw2
|
|
|
4
4
|
unique_orchestrator/prompts/user_message_prompt.jinja2,sha256=BQokpBh3H2J-rFk8i-PRph3jy4T1gAJPPb1mxxRWNuM,878
|
|
5
5
|
unique_orchestrator/tests/test_unique_ai_reference_order.py,sha256=8mZeVP1k8neH4qrFW3oa3zwIdaq2c7R1VvurC7kjBU8,4445
|
|
6
6
|
unique_orchestrator/unique_ai.py,sha256=ffA5hfULt5o9MRCIA6XA8ih4jlij2cW8SUm0AUxGAB8,19767
|
|
7
|
-
unique_orchestrator/unique_ai_builder.py,sha256=
|
|
8
|
-
unique_orchestrator-1.7.
|
|
9
|
-
unique_orchestrator-1.7.
|
|
10
|
-
unique_orchestrator-1.7.
|
|
11
|
-
unique_orchestrator-1.7.
|
|
7
|
+
unique_orchestrator/unique_ai_builder.py,sha256=U2Ok55FjI0GsR6NS071-dqRseEKrvFkEjA1yazKRq80,18818
|
|
8
|
+
unique_orchestrator-1.7.4.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
|
|
9
|
+
unique_orchestrator-1.7.4.dist-info/METADATA,sha256=yf1cOrPB6WvzudJWoEQEBgkzZvxz53PBffccNpmbj3o,4306
|
|
10
|
+
unique_orchestrator-1.7.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
11
|
+
unique_orchestrator-1.7.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|