unique_orchestrator 2026.32.0.dev1__tar.gz → 2026.32.0.dev3__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.
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/PKG-INFO +4 -4
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/pyproject.toml +4 -4
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_unique_ai_token_usage.py +22 -2
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/unique_ai_builder.py +37 -7
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/README.md +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/__init__.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/_builders/__init__.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/_builders/history_manager.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/_builders/inject_tool_reminders.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/_builders/loop_iteration_runner.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/_builders/open_file_setup.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/_builders/skill_setup.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/config.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/prompts/generic_reference_prompt.jinja2 +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/prompts/system_prompt.jinja2 +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/prompts/user_message_prompt.jinja2 +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/settings.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_agent_config_rjsf_ui_schema.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_build_loop_iteration_runner.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_config_services_validators.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_qwen_max_loop_iterations.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_register_code_interpreter_postprocessors.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_unique_ai_async_modify.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_unique_ai_execution_timing.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_unique_ai_get_filtered_user_metadata.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_unique_ai_log_tool_calls.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_unique_ai_loop_debug_params.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_unique_ai_persist_tool_calls.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_unique_ai_plan_or_execute_include.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_unique_ai_reference_order.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_unique_ai_render_system_prompt_user_instructions.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/tests/test_utils_resolve_other_options.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/unique_ai.py +0 -0
- {unique_orchestrator-2026.32.0.dev1 → unique_orchestrator-2026.32.0.dev3}/unique_orchestrator/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: unique-orchestrator
|
|
3
|
-
Version: 2026.32.0.
|
|
3
|
+
Version: 2026.32.0.dev3
|
|
4
4
|
Summary:
|
|
5
5
|
Author: Andreas Hauri
|
|
6
6
|
Author-email: Andreas Hauri <andreas.hauri@unique.ai>
|
|
@@ -9,15 +9,15 @@ Requires-Dist: pydantic>=2.8.2,<3
|
|
|
9
9
|
Requires-Dist: pydantic-settings>=2.10.1,<3
|
|
10
10
|
Requires-Dist: typing-extensions>=4.9.0,<5
|
|
11
11
|
Requires-Dist: jinja2>=3.1.0,<4
|
|
12
|
-
Requires-Dist: unique-toolkit>=2026.32.0.
|
|
12
|
+
Requires-Dist: unique-toolkit>=2026.32.0.dev8,<2026.32.0rc0
|
|
13
13
|
Requires-Dist: unique-stock-ticker>=2026.32.0.dev1,<2026.32.0rc0
|
|
14
14
|
Requires-Dist: unique-follow-up-questions>=2026.32.0.dev0,<2026.32.0rc0
|
|
15
15
|
Requires-Dist: unique-internal-search>=2026.32.0.dev1,<2026.32.0rc0
|
|
16
16
|
Requires-Dist: unique-deep-research>=2026.32.0.dev1,<2026.32.0rc0
|
|
17
|
-
Requires-Dist: unique-web-search>=2026.32.0.
|
|
17
|
+
Requires-Dist: unique-web-search>=2026.32.0.dev2,<2026.32.0rc0
|
|
18
18
|
Requires-Dist: unique-swot>=2026.32.0.dev0,<2026.32.0rc0
|
|
19
19
|
Requires-Dist: unique-skill-tool>=2026.32.0.dev0,<2026.32.0rc0
|
|
20
|
-
Requires-Dist: unique-user-memory>=2026.32.0.
|
|
20
|
+
Requires-Dist: unique-user-memory>=2026.32.0.dev3,<2026.32.0rc0
|
|
21
21
|
Requires-Dist: openai>=1.109.1,<3
|
|
22
22
|
Requires-Python: >=3.12, <4
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "unique_orchestrator"
|
|
3
|
-
version = "2026.32.0.
|
|
3
|
+
version = "2026.32.0.dev3"
|
|
4
4
|
description = ""
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = { text = "Proprietary" }
|
|
@@ -13,15 +13,15 @@ dependencies = [
|
|
|
13
13
|
"pydantic-settings>=2.10.1,<3",
|
|
14
14
|
"typing-extensions>=4.9.0,<5",
|
|
15
15
|
"jinja2>=3.1.0,<4",
|
|
16
|
-
"unique-toolkit>=2026.32.0.
|
|
16
|
+
"unique-toolkit>=2026.32.0.dev8,<2026.32.0rc0",
|
|
17
17
|
"unique-stock-ticker>=2026.32.0.dev1,<2026.32.0rc0",
|
|
18
18
|
"unique-follow-up-questions>=2026.32.0.dev0,<2026.32.0rc0",
|
|
19
19
|
"unique-internal-search>=2026.32.0.dev1,<2026.32.0rc0",
|
|
20
20
|
"unique-deep-research>=2026.32.0.dev1,<2026.32.0rc0",
|
|
21
|
-
"unique-web-search>=2026.32.0.
|
|
21
|
+
"unique-web-search>=2026.32.0.dev2,<2026.32.0rc0",
|
|
22
22
|
"unique-swot>=2026.32.0.dev0,<2026.32.0rc0",
|
|
23
23
|
"unique-skill-tool>=2026.32.0.dev0,<2026.32.0rc0",
|
|
24
|
-
"unique-user-memory>=2026.32.0.
|
|
24
|
+
"unique-user-memory>=2026.32.0.dev3,<2026.32.0rc0",
|
|
25
25
|
"openai>=1.109.1,<3",
|
|
26
26
|
]
|
|
27
27
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from pathlib import Path
|
|
1
2
|
from unittest.mock import AsyncMock, MagicMock
|
|
2
3
|
|
|
3
4
|
import pytest
|
|
@@ -7,6 +8,7 @@ from unique_toolkit.agentic.debug_info_manager.debug_info_manager import (
|
|
|
7
8
|
from unique_toolkit.agentic.loop_runner import SupportsInvocationStats
|
|
8
9
|
from unique_toolkit.agentic.tools.schemas import ToolCallResponse
|
|
9
10
|
from unique_toolkit.language_model.invocation_stats import LanguageModelInvocationStats
|
|
11
|
+
from unique_toolkit.language_model.model_costs import MODEL_COSTS_FILE_ENV
|
|
10
12
|
from unique_toolkit.language_model.schemas import LanguageModelTokenUsage
|
|
11
13
|
|
|
12
14
|
from unique_orchestrator.unique_ai import UniqueAI
|
|
@@ -211,9 +213,25 @@ class TestAccumulateUsage:
|
|
|
211
213
|
class TestRunTokenUsageIntegration:
|
|
212
214
|
@pytest.mark.ai
|
|
213
215
|
@pytest.mark.asyncio
|
|
214
|
-
async def test_run__debug_info_manager__receives_llm_invocations_key(
|
|
216
|
+
async def test_run__debug_info_manager__receives_llm_invocations_key(
|
|
217
|
+
self,
|
|
218
|
+
tmp_path: Path,
|
|
219
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
220
|
+
):
|
|
215
221
|
"""A single-iteration run with real usage on the loop response must
|
|
216
222
|
surface it under debug_info's 'llm_invocations' key."""
|
|
223
|
+
cost_file = tmp_path / "costs.yaml"
|
|
224
|
+
cost_file.write_text(
|
|
225
|
+
f"""
|
|
226
|
+
costSchemaVersion: 1
|
|
227
|
+
models:
|
|
228
|
+
{MODEL_NAME}:
|
|
229
|
+
input: 2
|
|
230
|
+
completion: 8
|
|
231
|
+
""",
|
|
232
|
+
encoding="utf-8",
|
|
233
|
+
)
|
|
234
|
+
monkeypatch.setenv(MODEL_COSTS_FILE_ENV, str(cost_file))
|
|
217
235
|
loop_response = _make_loop_response(
|
|
218
236
|
LanguageModelTokenUsage(
|
|
219
237
|
completion_tokens=12, prompt_tokens=34, total_tokens=46
|
|
@@ -231,6 +249,7 @@ class TestRunTokenUsageIntegration:
|
|
|
231
249
|
assert len(payload) == 1
|
|
232
250
|
assert payload[0]["modelName"] == MODEL_NAME
|
|
233
251
|
assert payload[0]["source"] == "main_loop[1]"
|
|
252
|
+
assert payload[0]["costUsd"] == pytest.approx(0.000164)
|
|
234
253
|
assert payload[0]["tokenUsage"] == {
|
|
235
254
|
"completionTokens": 12,
|
|
236
255
|
"promptTokens": 34,
|
|
@@ -712,7 +731,8 @@ class TestRunTokenUsageIntegration:
|
|
|
712
731
|
assert [
|
|
713
732
|
invocation["source"] for invocation in debug_info["llm_invocations"]
|
|
714
733
|
] == ["deep_research.clarification", "main_loop[1]"]
|
|
715
|
-
assert debug_info["analytics"]["
|
|
734
|
+
assert debug_info["analytics"]["consumption_by_llm"][0]["total_tokens"] == 35
|
|
735
|
+
assert debug_info["analytics"]["consumption"]["total_tokens"] == 35
|
|
716
736
|
assert debug_info["llm_invocations_complete"] is True
|
|
717
737
|
|
|
718
738
|
@pytest.mark.ai
|
|
@@ -70,6 +70,7 @@ from unique_toolkit.experimental.integrations.openai.streaming.event_routing imp
|
|
|
70
70
|
from unique_toolkit.language_model.infos import LanguageModelInfo, ModelCapabilities
|
|
71
71
|
from unique_toolkit.protocols.support import ResponsesSupportCompleteWithReferences
|
|
72
72
|
from unique_user_memory.user_memory import load_user_memory
|
|
73
|
+
from unique_user_memory.user_memory_message_log import UserMemoryMessageLogger
|
|
73
74
|
from unique_user_memory.user_memory_postprocessor import UserMemoryPostprocessor
|
|
74
75
|
|
|
75
76
|
from unique_orchestrator._builders import (
|
|
@@ -298,6 +299,7 @@ async def _build_common(
|
|
|
298
299
|
config: UniqueAIConfig,
|
|
299
300
|
) -> _CommonComponents:
|
|
300
301
|
chat_service = ChatService(event)
|
|
302
|
+
message_step_logger = MessageStepLogger(chat_service)
|
|
301
303
|
|
|
302
304
|
llm_service = LanguageModelService.from_event(event)
|
|
303
305
|
|
|
@@ -393,13 +395,37 @@ async def _build_common(
|
|
|
393
395
|
if user_memory_config.use_orchestrator_language_model
|
|
394
396
|
else user_memory_config.language_model
|
|
395
397
|
)
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
config=user_memory_config,
|
|
399
|
-
language_model=memory_language_model,
|
|
398
|
+
memory_message_step_logger = UserMemoryMessageLogger(
|
|
399
|
+
message_step_logger,
|
|
400
400
|
logger=logger,
|
|
401
401
|
)
|
|
402
|
-
|
|
402
|
+
await memory_message_step_logger.log_loading_start()
|
|
403
|
+
user_memory_state = None
|
|
404
|
+
load_succeeded = False
|
|
405
|
+
try:
|
|
406
|
+
user_memory_state = await load_user_memory(
|
|
407
|
+
event=event,
|
|
408
|
+
config=user_memory_config,
|
|
409
|
+
language_model=memory_language_model,
|
|
410
|
+
logger=logger,
|
|
411
|
+
)
|
|
412
|
+
load_succeeded = True
|
|
413
|
+
except Exception as exc:
|
|
414
|
+
# Soft-fail like a None return: keep the turn running without
|
|
415
|
+
# memory, but always close the RUNNING loading Step first.
|
|
416
|
+
logger.warning(
|
|
417
|
+
"[user-memory] load raised - running without memory: [%s] %s",
|
|
418
|
+
type(exc).__name__,
|
|
419
|
+
exc,
|
|
420
|
+
)
|
|
421
|
+
finally:
|
|
422
|
+
if not load_succeeded:
|
|
423
|
+
await memory_message_step_logger.log_loading_failed()
|
|
424
|
+
|
|
425
|
+
if load_succeeded and user_memory_state is not None:
|
|
426
|
+
await memory_message_step_logger.log_loading_complete(
|
|
427
|
+
with_settings_entry=True
|
|
428
|
+
)
|
|
403
429
|
user_memory_text = user_memory_state.text
|
|
404
430
|
postprocessor_manager.add_postprocessor(
|
|
405
431
|
UserMemoryPostprocessor(
|
|
@@ -408,9 +434,13 @@ async def _build_common(
|
|
|
408
434
|
event=event,
|
|
409
435
|
state=user_memory_state,
|
|
410
436
|
logger=logger,
|
|
411
|
-
|
|
437
|
+
message_step_logger=memory_message_step_logger,
|
|
412
438
|
)
|
|
413
439
|
)
|
|
440
|
+
elif load_succeeded:
|
|
441
|
+
await memory_message_step_logger.log_loading_complete(
|
|
442
|
+
with_settings_entry=False
|
|
443
|
+
)
|
|
414
444
|
|
|
415
445
|
return _CommonComponents(
|
|
416
446
|
chat_service=chat_service,
|
|
@@ -429,7 +459,7 @@ async def _build_common(
|
|
|
429
459
|
user_memory_text=user_memory_text,
|
|
430
460
|
postprocessor_manager=postprocessor_manager,
|
|
431
461
|
response_watcher=response_watcher,
|
|
432
|
-
message_step_logger=
|
|
462
|
+
message_step_logger=message_step_logger,
|
|
433
463
|
)
|
|
434
464
|
|
|
435
465
|
|
|
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
|