unique_orchestrator 1.2.3__py3-none-any.whl → 1.3.0__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/config.py +20 -15
- unique_orchestrator/unique_ai.py +27 -10
- unique_orchestrator/unique_ai_builder.py +2 -5
- {unique_orchestrator-1.2.3.dist-info → unique_orchestrator-1.3.0.dist-info}/METADATA +7 -1
- unique_orchestrator-1.3.0.dist-info/RECORD +11 -0
- unique_orchestrator-1.2.3.dist-info/RECORD +0 -11
- {unique_orchestrator-1.2.3.dist-info → unique_orchestrator-1.3.0.dist-info}/LICENSE +0 -0
- {unique_orchestrator-1.2.3.dist-info → unique_orchestrator-1.3.0.dist-info}/WHEEL +0 -0
unique_orchestrator/config.py
CHANGED
|
@@ -32,6 +32,11 @@ from unique_toolkit.language_model.default_language_model import DEFAULT_GPT_4o
|
|
|
32
32
|
from unique_web_search.config import WebSearchConfig
|
|
33
33
|
from unique_web_search.service import WebSearchTool
|
|
34
34
|
|
|
35
|
+
DeactivatedNone = Annotated[
|
|
36
|
+
None,
|
|
37
|
+
Field(title="Deactivated", description="None"),
|
|
38
|
+
]
|
|
39
|
+
|
|
35
40
|
|
|
36
41
|
class SpaceType(StrEnum):
|
|
37
42
|
UNIQUE_CUSTOM = "unique_custom"
|
|
@@ -121,9 +126,6 @@ class EvaluationConfig(BaseModel):
|
|
|
121
126
|
model_config = get_configuration_dict()
|
|
122
127
|
max_review_steps: int = 3
|
|
123
128
|
hallucination_config: HallucinationConfig = HallucinationConfig()
|
|
124
|
-
sub_agents_config: SubAgentEvaluationServiceConfig | None = (
|
|
125
|
-
SubAgentEvaluationServiceConfig()
|
|
126
|
-
)
|
|
127
129
|
|
|
128
130
|
|
|
129
131
|
# ------------------------------------------------------------
|
|
@@ -149,12 +151,6 @@ class UniqueAIPromptConfig(BaseModel):
|
|
|
149
151
|
)
|
|
150
152
|
|
|
151
153
|
|
|
152
|
-
DeactivatedNone = Annotated[
|
|
153
|
-
None,
|
|
154
|
-
Field(title="Deactivated", description="None"),
|
|
155
|
-
]
|
|
156
|
-
|
|
157
|
-
|
|
158
154
|
class UniqueAIServices(BaseModel):
|
|
159
155
|
"""Determine the services the agent is using
|
|
160
156
|
|
|
@@ -205,12 +201,9 @@ class InputTokenDistributionConfig(BaseModel):
|
|
|
205
201
|
return int(self.percent_for_history * max_input_token)
|
|
206
202
|
|
|
207
203
|
|
|
208
|
-
class
|
|
204
|
+
class SubAgentsReferencingConfig(BaseModel):
|
|
209
205
|
model_config = get_configuration_dict()
|
|
210
|
-
|
|
211
|
-
default=True,
|
|
212
|
-
description="Whether to use sub agent references in the main agent's response. Only has an effect if sub agents are used.",
|
|
213
|
-
)
|
|
206
|
+
|
|
214
207
|
referencing_instructions_for_system_prompt: str = Field(
|
|
215
208
|
default=REFERENCING_INSTRUCTIONS_FOR_SYSTEM_PROMPT,
|
|
216
209
|
description="Referencing instructions for the main agent's system prompt.",
|
|
@@ -221,6 +214,18 @@ class SubAgentsConfig(BaseModel):
|
|
|
221
214
|
)
|
|
222
215
|
|
|
223
216
|
|
|
217
|
+
class SubAgentsConfig(BaseModel):
|
|
218
|
+
model_config = get_configuration_dict()
|
|
219
|
+
|
|
220
|
+
referencing_config: (
|
|
221
|
+
Annotated[SubAgentsReferencingConfig, Field(title="Active")] | DeactivatedNone
|
|
222
|
+
) = SubAgentsReferencingConfig()
|
|
223
|
+
evaluation_config: (
|
|
224
|
+
Annotated[SubAgentEvaluationServiceConfig, Field(title="Active")]
|
|
225
|
+
| DeactivatedNone
|
|
226
|
+
) = SubAgentEvaluationServiceConfig()
|
|
227
|
+
|
|
228
|
+
|
|
224
229
|
class ExperimentalConfig(BaseModel):
|
|
225
230
|
"""Experimental features this part of the configuration might evolve in the future continuously"""
|
|
226
231
|
|
|
@@ -282,5 +287,5 @@ class UniqueAIConfig(BaseModel):
|
|
|
282
287
|
@model_validator(mode="after")
|
|
283
288
|
def disable_sub_agent_referencing_if_not_used(self) -> "UniqueAIConfig":
|
|
284
289
|
if not any(tool.is_sub_agent for tool in self.space.tools):
|
|
285
|
-
self.agent.experimental.sub_agents_config.
|
|
290
|
+
self.agent.experimental.sub_agents_config.referencing_config = None
|
|
286
291
|
return self
|
unique_orchestrator/unique_ai.py
CHANGED
|
@@ -71,6 +71,9 @@ class UniqueAI:
|
|
|
71
71
|
self._latest_assistant_id: str = event.payload.assistant_message.id
|
|
72
72
|
self._mcp_servers = mcp_servers
|
|
73
73
|
|
|
74
|
+
# Helper variable to support control loop
|
|
75
|
+
self._tool_took_control = False
|
|
76
|
+
|
|
74
77
|
############################################################
|
|
75
78
|
# Override of base methods
|
|
76
79
|
############################################################
|
|
@@ -125,8 +128,9 @@ class UniqueAI:
|
|
|
125
128
|
loop_response
|
|
126
129
|
)
|
|
127
130
|
|
|
131
|
+
# Only set completed_at if no tool took control. Tools that take control will set the message state to completed themselves.
|
|
128
132
|
await self._chat_service.modify_assistant_message_async(
|
|
129
|
-
set_completed_at=
|
|
133
|
+
set_completed_at=not self._tool_took_control,
|
|
130
134
|
)
|
|
131
135
|
|
|
132
136
|
# @track()
|
|
@@ -256,10 +260,15 @@ class UniqueAI:
|
|
|
256
260
|
|
|
257
261
|
query = self._event.payload.user_message.text
|
|
258
262
|
|
|
259
|
-
|
|
260
|
-
self._config.agent.experimental.sub_agents_config.
|
|
261
|
-
|
|
262
|
-
|
|
263
|
+
if (
|
|
264
|
+
self._config.agent.experimental.sub_agents_config.referencing_config
|
|
265
|
+
is not None
|
|
266
|
+
):
|
|
267
|
+
use_sub_agent_references = True
|
|
268
|
+
sub_agent_referencing_instructions = self._config.agent.experimental.sub_agents_config.referencing_config.referencing_instructions_for_user_prompt
|
|
269
|
+
else:
|
|
270
|
+
use_sub_agent_references = False
|
|
271
|
+
sub_agent_referencing_instructions = None
|
|
263
272
|
|
|
264
273
|
user_msg = user_message_template.render(
|
|
265
274
|
query=query,
|
|
@@ -290,10 +299,15 @@ class UniqueAI:
|
|
|
290
299
|
mcp_server.system_prompt for mcp_server in self._mcp_servers
|
|
291
300
|
]
|
|
292
301
|
|
|
293
|
-
|
|
294
|
-
self._config.agent.experimental.sub_agents_config.
|
|
295
|
-
|
|
296
|
-
|
|
302
|
+
if (
|
|
303
|
+
self._config.agent.experimental.sub_agents_config.referencing_config
|
|
304
|
+
is not None
|
|
305
|
+
):
|
|
306
|
+
use_sub_agent_references = True
|
|
307
|
+
sub_agent_referencing_instructions = self._config.agent.experimental.sub_agents_config.referencing_config.referencing_instructions_for_system_prompt
|
|
308
|
+
else:
|
|
309
|
+
use_sub_agent_references = False
|
|
310
|
+
sub_agent_referencing_instructions = None
|
|
297
311
|
|
|
298
312
|
system_message = system_prompt_template.render(
|
|
299
313
|
model_info=self._config.space.language_model.model_dump(mode="json"),
|
|
@@ -352,7 +366,10 @@ class UniqueAI:
|
|
|
352
366
|
self._reference_manager.extract_referenceable_chunks(tool_call_responses)
|
|
353
367
|
self._debug_info_manager.extract_tool_debug_info(tool_call_responses)
|
|
354
368
|
|
|
355
|
-
|
|
369
|
+
self._tool_took_control = self._tool_manager.does_a_tool_take_control(
|
|
370
|
+
tool_calls
|
|
371
|
+
)
|
|
372
|
+
return self._tool_took_control
|
|
356
373
|
|
|
357
374
|
async def _create_new_assistant_message_if_loop_response_contains_content(
|
|
358
375
|
self, loop_response: LanguageModelStreamResponse
|
|
@@ -178,12 +178,9 @@ def build_unique_ai(
|
|
|
178
178
|
postprocessor_manager.add_postprocessor(sub_agent_responses_postprocessor)
|
|
179
179
|
|
|
180
180
|
sub_agent_evaluation = None
|
|
181
|
-
if
|
|
182
|
-
config.agent.services.evaluation_config is not None
|
|
183
|
-
and config.agent.services.evaluation_config.sub_agents_config is not None
|
|
184
|
-
):
|
|
181
|
+
if config.agent.experimental.sub_agents_config.evaluation_config is not None:
|
|
185
182
|
sub_agent_evaluation = SubAgentEvaluationService(
|
|
186
|
-
config=config.agent.
|
|
183
|
+
config=config.agent.experimental.sub_agents_config.evaluation_config,
|
|
187
184
|
language_model_service=LanguageModelService.from_event(event),
|
|
188
185
|
)
|
|
189
186
|
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.
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary:
|
|
5
5
|
License: Proprietary
|
|
6
6
|
Author: Andreas Hauri
|
|
@@ -33,6 +33,12 @@ All notable changes to this project will be documented in this file.
|
|
|
33
33
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
34
34
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
35
35
|
|
|
36
|
+
## [1.3.0] - 2025-10-14
|
|
37
|
+
- Re-organize sub-agents configuration for clarity.
|
|
38
|
+
|
|
39
|
+
## [1.2.4] - 2025-10-14
|
|
40
|
+
- Let control taking tool itself set the message state to completed
|
|
41
|
+
|
|
36
42
|
## [1.2.3] - 2025-10-13
|
|
37
43
|
- Fix bug where follow-up questions were being generated even if the number of questions is set to 0 in the config.
|
|
38
44
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
unique_orchestrator/config.py,sha256=2A3pDEc37PlOULgQzJu_PoLchwLT7T0OEA1Gieue2Ow,9603
|
|
2
|
+
unique_orchestrator/prompts/generic_reference_prompt.jinja2,sha256=fYPaiE-N1gSoOqu85OeEBa_ttAim8grOhHuOHJjSHNU,2663
|
|
3
|
+
unique_orchestrator/prompts/system_prompt.jinja2,sha256=YXFdx3PG2p4TKfjEpz7guIw2GaKoY-4zRMEzXaKhHXE,7213
|
|
4
|
+
unique_orchestrator/prompts/user_message_prompt.jinja2,sha256=BQokpBh3H2J-rFk8i-PRph3jy4T1gAJPPb1mxxRWNuM,878
|
|
5
|
+
unique_orchestrator/tests/test_unique_ai_reference_order.py,sha256=8mZeVP1k8neH4qrFW3oa3zwIdaq2c7R1VvurC7kjBU8,4445
|
|
6
|
+
unique_orchestrator/unique_ai.py,sha256=4juvEzASX6FMQJywTYLzH-V-vaCNviqiu7HZ2jkrDSc,17148
|
|
7
|
+
unique_orchestrator/unique_ai_builder.py,sha256=knwm1cJ59SarJE1DsKGVS5WVpU1B_FCPbMHEFQg4uZY,7524
|
|
8
|
+
unique_orchestrator-1.3.0.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
|
|
9
|
+
unique_orchestrator-1.3.0.dist-info/METADATA,sha256=7jZHo2njuFcvuYZmSvQp2_9VaLT37a3P9Xwu5LrE6Ro,2556
|
|
10
|
+
unique_orchestrator-1.3.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
11
|
+
unique_orchestrator-1.3.0.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
unique_orchestrator/config.py,sha256=miZXSKSyYkYahk4VOvZ5v0u93QQX-z0RO6aC0mtJu4w,9519
|
|
2
|
-
unique_orchestrator/prompts/generic_reference_prompt.jinja2,sha256=fYPaiE-N1gSoOqu85OeEBa_ttAim8grOhHuOHJjSHNU,2663
|
|
3
|
-
unique_orchestrator/prompts/system_prompt.jinja2,sha256=YXFdx3PG2p4TKfjEpz7guIw2GaKoY-4zRMEzXaKhHXE,7213
|
|
4
|
-
unique_orchestrator/prompts/user_message_prompt.jinja2,sha256=BQokpBh3H2J-rFk8i-PRph3jy4T1gAJPPb1mxxRWNuM,878
|
|
5
|
-
unique_orchestrator/tests/test_unique_ai_reference_order.py,sha256=8mZeVP1k8neH4qrFW3oa3zwIdaq2c7R1VvurC7kjBU8,4445
|
|
6
|
-
unique_orchestrator/unique_ai.py,sha256=8sBD5P16XcJ_3BXywBuZRRa4h89ANAi8h3VA4V2G_sI,16471
|
|
7
|
-
unique_orchestrator/unique_ai_builder.py,sha256=FUIJAVv0lPTWDgWeMx-KuCyrIc8w8lWyEciFs3_7a3Q,7608
|
|
8
|
-
unique_orchestrator-1.2.3.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
|
|
9
|
-
unique_orchestrator-1.2.3.dist-info/METADATA,sha256=8AZVFC-ygH-hJlGryJr8To5D1qQGxVX-I-7a_oY5EQk,2386
|
|
10
|
-
unique_orchestrator-1.2.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
11
|
-
unique_orchestrator-1.2.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|