unique_orchestrator 2026.46.0.dev3__tar.gz → 2026.46.0.dev5__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.
Files changed (34) hide show
  1. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/PKG-INFO +3 -3
  2. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/pyproject.toml +3 -3
  3. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/config.py +21 -0
  4. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/unique_ai.py +37 -0
  5. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/unique_ai_builder.py +25 -1
  6. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/README.md +0 -0
  7. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/__init__.py +0 -0
  8. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/_builders/__init__.py +0 -0
  9. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/_builders/history_manager.py +0 -0
  10. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/_builders/inject_tool_reminders.py +0 -0
  11. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/_builders/loop_iteration_runner.py +0 -0
  12. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/_builders/open_file_setup.py +0 -0
  13. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/_builders/skill_setup.py +0 -0
  14. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/prompts/generic_reference_prompt.jinja2 +0 -0
  15. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/prompts/system_prompt.jinja2 +0 -0
  16. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/prompts/user_message_prompt.jinja2 +0 -0
  17. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/settings.py +0 -0
  18. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_agent_config_rjsf_ui_schema.py +0 -0
  19. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_build_loop_iteration_runner.py +0 -0
  20. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_config_services_validators.py +0 -0
  21. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_qwen_max_loop_iterations.py +0 -0
  22. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_register_code_interpreter_postprocessors.py +0 -0
  23. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_unique_ai_async_modify.py +0 -0
  24. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_unique_ai_execution_timing.py +0 -0
  25. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_unique_ai_get_filtered_user_metadata.py +0 -0
  26. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_unique_ai_log_tool_calls.py +0 -0
  27. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_unique_ai_loop_debug_params.py +0 -0
  28. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_unique_ai_persist_tool_calls.py +0 -0
  29. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_unique_ai_plan_or_execute_include.py +0 -0
  30. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_unique_ai_reference_order.py +0 -0
  31. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_unique_ai_render_system_prompt_user_instructions.py +0 -0
  32. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_unique_ai_token_usage.py +0 -0
  33. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/tests/test_utils_resolve_other_options.py +0 -0
  34. {unique_orchestrator-2026.46.0.dev3 → unique_orchestrator-2026.46.0.dev5}/unique_orchestrator/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: unique-orchestrator
3
- Version: 2026.46.0.dev3
3
+ Version: 2026.46.0.dev5
4
4
  Summary:
5
5
  Author: Andreas Hauri
6
6
  Author-email: Andreas Hauri <andreas.hauri@unique.ai>
@@ -8,12 +8,12 @@ License: Proprietary
8
8
  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
- Requires-Dist: unique-toolkit>=2026.46.0.dev5,<2026.46.0rc0
11
+ Requires-Dist: unique-toolkit>=2026.46.0.dev10,<2026.46.0rc0
12
12
  Requires-Dist: unique-stock-ticker>=2026.46.0.dev1,<2026.46.0rc0
13
13
  Requires-Dist: unique-follow-up-questions>=2026.46.0.dev2,<2026.46.0rc0
14
14
  Requires-Dist: unique-internal-search>=2026.46.0.dev1,<2026.46.0rc0
15
15
  Requires-Dist: unique-deep-research>=2026.46.0.dev1,<2026.46.0rc0
16
- Requires-Dist: unique-web-search>=2026.46.0.dev3,<2026.46.0rc0
16
+ Requires-Dist: unique-web-search>=2026.46.0.dev4,<2026.46.0rc0
17
17
  Requires-Dist: unique-swot>=2026.46.0.dev2,<2026.46.0rc0
18
18
  Requires-Dist: unique-skill-tool>=2026.46.0.dev1,<2026.46.0rc0
19
19
  Requires-Dist: unique-user-memory>=2026.46.0.dev1,<2026.46.0rc0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "unique_orchestrator"
3
- version = "2026.46.0.dev3"
3
+ version = "2026.46.0.dev5"
4
4
  description = ""
5
5
  readme = "README.md"
6
6
  license = { text = "Proprietary" }
@@ -12,12 +12,12 @@ dependencies = [
12
12
  "pydantic>=2.8.2,<3",
13
13
  "pydantic-settings>=2.10.1,<3",
14
14
  "typing-extensions>=4.9.0,<5",
15
- "unique-toolkit>=2026.46.0.dev5,<2026.46.0rc0",
15
+ "unique-toolkit>=2026.46.0.dev10,<2026.46.0rc0",
16
16
  "unique-stock-ticker>=2026.46.0.dev1,<2026.46.0rc0",
17
17
  "unique-follow-up-questions>=2026.46.0.dev2,<2026.46.0rc0",
18
18
  "unique-internal-search>=2026.46.0.dev1,<2026.46.0rc0",
19
19
  "unique-deep-research>=2026.46.0.dev1,<2026.46.0rc0",
20
- "unique-web-search>=2026.46.0.dev3,<2026.46.0rc0",
20
+ "unique-web-search>=2026.46.0.dev4,<2026.46.0rc0",
21
21
  "unique-swot>=2026.46.0.dev2,<2026.46.0rc0",
22
22
  "unique-skill-tool>=2026.46.0.dev1,<2026.46.0rc0",
23
23
  "unique-user-memory>=2026.46.0.dev1,<2026.46.0rc0",
@@ -21,6 +21,11 @@ from unique_internal_search.uploaded_search.config import (
21
21
  from unique_stock_ticker.config import StockTickerConfig
22
22
  from unique_swot import SwotAnalysisTool, SwotAnalysisToolConfig
23
23
  from unique_toolkit._common.pydantic.rjsf_tags import RJSFMetaTag
24
+ from unique_toolkit._common.pydantic_helpers import get_configuration_dict
25
+ from unique_toolkit._common.utils.jinja.sandbox import (
26
+ TemplateError,
27
+ validate_sandboxed_template,
28
+ )
24
29
  from unique_toolkit._common.validators import (
25
30
  LMI,
26
31
  ClipInt,
@@ -68,6 +73,7 @@ from unique_toolkit.agentic.tools.tool_progress_reporter import (
68
73
  )
69
74
  from unique_toolkit.language_model.default_language_model import DEFAULT_GPT_4o
70
75
  from unique_toolkit.language_model.infos import LanguageModelName, ModelCapabilities
76
+ from unique_toolkit.log_redaction import redact_text
71
77
  from unique_user_memory.config import UserMemoryConfig
72
78
  from unique_web_search.config import WebSearchConfig
73
79
  from unique_web_search.service import WebSearchTool
@@ -284,6 +290,8 @@ class EvaluationConfig(BaseToolConfig):
284
290
 
285
291
 
286
292
  class UniqueAIPromptConfig(BaseToolConfig):
293
+ model_config = get_configuration_dict(hide_input_in_errors=True)
294
+
287
295
  system_prompt_template: Annotated[
288
296
  str,
289
297
  RJSFMetaTag.StringWidget.textarea(rows=25),
@@ -310,6 +318,17 @@ class UniqueAIPromptConfig(BaseToolConfig):
310
318
  description="User metadata fields to be ingested in the system prompt.",
311
319
  )
312
320
 
321
+ @field_validator("system_prompt_template", "user_message_prompt_template")
322
+ @classmethod
323
+ def validate_prompt_template(cls, value: str) -> str:
324
+ try:
325
+ return validate_sandboxed_template(value)
326
+ except TemplateError as exc:
327
+ redacted = redact_text(value, label="prompt")
328
+ raise ValueError(
329
+ f"Invalid prompt template {redacted} ({type(exc).__name__})."
330
+ ) from None
331
+
313
332
 
314
333
  class UniqueAIServices(BaseToolConfig):
315
334
  """Determine the services the agent is using
@@ -545,6 +564,8 @@ GPT_FRONTIER_MODELS: frozenset[LanguageModelName] = frozenset(
545
564
 
546
565
 
547
566
  class UniqueAIConfig(BaseToolConfig):
567
+ model_config = get_configuration_dict(hide_input_in_errors=True)
568
+
548
569
  space: UniqueAISpaceConfig = UniqueAISpaceConfig()
549
570
 
550
571
  agent: UniqueAIAgentConfig = UniqueAIAgentConfig()
@@ -7,6 +7,7 @@ from typing import Any, cast, overload
7
7
  from typing_extensions import deprecated
8
8
  from unique_skill_tool.service import SkillTool
9
9
  from unique_toolkit._common.utils.jinja.sandbox import sandboxed_template
10
+ from unique_toolkit.agentic.chat_title import ChatTitleGenerator
10
11
  from unique_toolkit.agentic.debug_info_manager.debug_info_manager import (
11
12
  AnalyticsLanguageModel,
12
13
  DebugInfoManager,
@@ -73,6 +74,9 @@ from unique_orchestrator.config import UniqueAIConfig
73
74
  from unique_orchestrator.settings import env_settings
74
75
  from unique_orchestrator.utils import resolve_other_options
75
76
 
77
+ # Holds back message completion when the answer finishes before the title.
78
+ _CHAT_TITLE_WAIT_SECONDS = 15
79
+
76
80
 
77
81
  def _load_invocation_stats_from_debug_info(
78
82
  debug_info: dict[str, Any],
@@ -124,6 +128,7 @@ class UniqueAI:
124
128
  uploaded_documents: list[Content] | None = None,
125
129
  user_memory_text: str = "",
126
130
  selected_uploaded_content_ids: frozenset[str] | None = None,
131
+ chat_title_generator: ChatTitleGenerator | None = None,
127
132
  ) -> None: ...
128
133
 
129
134
  # Responses API Dependencies
@@ -150,6 +155,7 @@ class UniqueAI:
150
155
  uploaded_documents: list[Content] | None = None,
151
156
  user_memory_text: str = "",
152
157
  selected_uploaded_content_ids: frozenset[str] | None = None,
158
+ chat_title_generator: ChatTitleGenerator | None = None,
153
159
  ) -> None: ...
154
160
 
155
161
  def __init__(
@@ -175,6 +181,7 @@ class UniqueAI:
175
181
  uploaded_documents: list[Content] | None = None,
176
182
  user_memory_text: str = "",
177
183
  selected_uploaded_content_ids: frozenset[str] | None = None,
184
+ chat_title_generator: ChatTitleGenerator | None = None,
178
185
  ) -> None:
179
186
  self._logger = logger
180
187
  self._event = event
@@ -196,6 +203,7 @@ class UniqueAI:
196
203
 
197
204
  self._evaluation_manager = evaluation_manager
198
205
  self._postprocessor_manager = postprocessor_manager
206
+ self._chat_title_generator = chat_title_generator
199
207
  self._latest_assistant_id: str = event.payload.assistant_message.id
200
208
  self._mcp_servers = mcp_servers
201
209
  self._streaming_handler = streaming_handler
@@ -246,6 +254,31 @@ class UniqueAI:
246
254
  set_completed_at=True,
247
255
  )
248
256
 
257
+ def _start_chat_title_generation(self) -> asyncio.Task[str | None] | None:
258
+ if self._chat_title_generator is None:
259
+ return None
260
+ user_message = self._event.payload.user_message
261
+ return asyncio.create_task(
262
+ self._chat_title_generator.run(
263
+ user_message.original_text or user_message.text
264
+ )
265
+ )
266
+
267
+ async def _finish_chat_title_generation(
268
+ self, task: asyncio.Task[str | None] | None
269
+ ) -> None:
270
+ if task is None or self._chat_title_generator is None:
271
+ return
272
+ if self._chat_service.cancellation.is_cancelled:
273
+ task.cancel()
274
+ return
275
+ try:
276
+ await asyncio.wait_for(task, timeout=_CHAT_TITLE_WAIT_SECONDS)
277
+ except TimeoutError:
278
+ self._logger.warning("Chat title generation timed out.")
279
+ return
280
+ self._invocation_stats.extend(self._chat_title_generator.invocation_stats)
281
+
249
282
  # @track(name="loop_agent_run") # Group traces together
250
283
  async def run(self):
251
284
  """
@@ -284,6 +317,7 @@ class UniqueAI:
284
317
  sub = self._chat_service.cancellation.on_cancellation.subscribe(
285
318
  self._on_cancellation
286
319
  )
320
+ chat_title_task = self._start_chat_title_generation()
287
321
  try:
288
322
  max_iterations = self._config.effective_max_loop_iterations
289
323
  for i in range(max_iterations):
@@ -387,6 +421,7 @@ class UniqueAI:
387
421
  },
388
422
  )
389
423
  self._debug_info_manager.add("loop_params", self._loop_debug_params)
424
+ await self._finish_chat_title_generation(chat_title_task)
390
425
  skills_debug_info = self._get_activated_skills_debug_info()
391
426
  self._debug_info_manager.add("skills", skills_debug_info)
392
427
  tool_names = {
@@ -486,6 +521,8 @@ class UniqueAI:
486
521
  await self._chat_service.update_debug_info_async(debug_info=debug_info)
487
522
  invocations_persisted = True
488
523
  finally:
524
+ if chat_title_task is not None and not chat_title_task.done():
525
+ chat_title_task.cancel()
489
526
  if not invocations_persisted:
490
527
  if isinstance(self._loop_iteration_runner, SupportsInvocationStats):
491
528
  self._invocation_stats.extend(
@@ -14,6 +14,7 @@ from unique_stock_ticker.stock_ticker_postprocessor import (
14
14
  StockTickerPostprocessor,
15
15
  )
16
16
  from unique_toolkit import LanguageModelService, get_async_openai_client
17
+ from unique_toolkit.agentic.chat_title import ChatTitleGenerator
17
18
  from unique_toolkit.agentic.debug_info_manager.debug_info_manager import (
18
19
  DebugInfoManager,
19
20
  )
@@ -161,13 +162,19 @@ async def build_unique_ai(
161
162
  logger: Logger,
162
163
  config: UniqueAIConfig,
163
164
  debug_info_manager: DebugInfoManager,
165
+ enable_chat_title_generation: bool = False,
164
166
  ) -> UniqueAI:
165
167
  config = _apply_model_choice_override(event=event, logger=logger, config=config)
166
168
  _record_language_model_debug_info(
167
169
  debug_info_manager=debug_info_manager,
168
170
  config=config,
169
171
  )
170
- common_components = await _build_common(event, logger, config)
172
+ common_components = await _build_common(
173
+ event,
174
+ logger,
175
+ config,
176
+ enable_chat_title_generation=enable_chat_title_generation,
177
+ )
171
178
 
172
179
  if (
173
180
  config.agent.experimental.responses_api_config.use_responses_api
@@ -209,6 +216,7 @@ class _CommonComponents(NamedTuple):
209
216
  a2a_manager: A2AManager
210
217
  mcp_servers: list[McpServer]
211
218
  user_memory_text: str
219
+ chat_title_generator: ChatTitleGenerator | None
212
220
 
213
221
 
214
222
  def _apply_model_choice_override(
@@ -309,6 +317,8 @@ async def _build_common(
309
317
  event: ChatEvent,
310
318
  logger: Logger,
311
319
  config: UniqueAIConfig,
320
+ *,
321
+ enable_chat_title_generation: bool = False,
312
322
  ) -> _CommonComponents:
313
323
  chat_service = ChatService(event)
314
324
  message_step_logger = MessageStepLogger(chat_service)
@@ -456,6 +466,17 @@ async def _build_common(
456
466
  with_settings_entry=False
457
467
  )
458
468
 
469
+ chat_title_generator = (
470
+ ChatTitleGenerator(
471
+ logger=logger,
472
+ chat_service=chat_service,
473
+ llm_service=llm_service,
474
+ language_model=config.space.language_model,
475
+ )
476
+ if enable_chat_title_generation
477
+ else None
478
+ )
479
+
459
480
  return _CommonComponents(
460
481
  chat_service=chat_service,
461
482
  content_service=content_service,
@@ -474,6 +495,7 @@ async def _build_common(
474
495
  postprocessor_manager=postprocessor_manager,
475
496
  response_watcher=response_watcher,
476
497
  message_step_logger=message_step_logger,
498
+ chat_title_generator=chat_title_generator,
477
499
  )
478
500
 
479
501
 
@@ -712,6 +734,7 @@ async def _build_responses(
712
734
  if selected_uploaded_content_ids is not None
713
735
  else None
714
736
  ),
737
+ chat_title_generator=common_components.chat_title_generator,
715
738
  )
716
739
 
717
740
 
@@ -809,6 +832,7 @@ async def _build_completions(
809
832
  message_step_logger=common_components.message_step_logger,
810
833
  loop_iteration_runner=loop_iteration_runner,
811
834
  user_memory_text=common_components.user_memory_text,
835
+ chat_title_generator=common_components.chat_title_generator,
812
836
  )
813
837
 
814
838