unique_orchestrator 2026.30.0.dev1__tar.gz → 2026.30.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.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/PKG-INFO +3 -3
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/pyproject.toml +3 -3
- unique_orchestrator-2026.30.0.dev3/unique_orchestrator/_builders/history_manager.py +97 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/_builders/open_file_setup.py +5 -43
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/config.py +5 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_unique_ai_loop_debug_params.py +8 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/unique_ai.py +3 -4
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/unique_ai_builder.py +58 -51
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/README.md +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/__init__.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/_builders/__init__.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/_builders/inject_tool_reminders.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/_builders/loop_iteration_runner.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/_builders/skill_setup.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/prompts/generic_reference_prompt.jinja2 +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/prompts/system_prompt.jinja2 +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/prompts/user_message_prompt.jinja2 +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/settings.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_agent_config_rjsf_ui_schema.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_build_loop_iteration_runner.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_config_services_validators.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_qwen_max_loop_iterations.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_register_code_interpreter_postprocessors.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_unique_ai_async_modify.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_unique_ai_execution_timing.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_unique_ai_get_filtered_user_metadata.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_unique_ai_log_tool_calls.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_unique_ai_persist_tool_calls.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_unique_ai_plan_or_execute_include.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_unique_ai_reference_order.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_unique_ai_render_system_prompt_user_instructions.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.0.dev3}/unique_orchestrator/tests/test_utils_resolve_other_options.py +0 -0
- {unique_orchestrator-2026.30.0.dev1 → unique_orchestrator-2026.30.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.30.0.
|
|
3
|
+
Version: 2026.30.0.dev3
|
|
4
4
|
Summary:
|
|
5
5
|
Author: Andreas Hauri
|
|
6
6
|
Author-email: Andreas Hauri <andreas.hauri@unique.ai>
|
|
@@ -9,12 +9,12 @@ 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.30.0.
|
|
12
|
+
Requires-Dist: unique-toolkit>=2026.30.0.dev14,<2026.30.0rc0
|
|
13
13
|
Requires-Dist: unique-stock-ticker>=2026.30.0.dev0,<2026.30.0rc0
|
|
14
14
|
Requires-Dist: unique-follow-up-questions>=2026.30.0.dev0,<2026.30.0rc0
|
|
15
15
|
Requires-Dist: unique-internal-search>=2026.30.0.dev0,<2026.30.0rc0
|
|
16
16
|
Requires-Dist: unique-deep-research>=2026.30.0.dev0,<2026.30.0rc0
|
|
17
|
-
Requires-Dist: unique-web-search>=2026.30.0.
|
|
17
|
+
Requires-Dist: unique-web-search>=2026.30.0.dev2,<2026.30.0rc0
|
|
18
18
|
Requires-Dist: unique-swot>=2026.30.0.dev0,<2026.30.0rc0
|
|
19
19
|
Requires-Dist: unique-skill-tool>=2026.30.0.dev0,<2026.30.0rc0
|
|
20
20
|
Requires-Dist: unique-user-memory>=2026.30.0.dev0,<2026.30.0rc0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "unique_orchestrator"
|
|
3
|
-
version = "2026.30.0.
|
|
3
|
+
version = "2026.30.0.dev3"
|
|
4
4
|
description = ""
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = { text = "Proprietary" }
|
|
@@ -13,12 +13,12 @@ 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.30.0.
|
|
16
|
+
"unique-toolkit>=2026.30.0.dev14,<2026.30.0rc0",
|
|
17
17
|
"unique-stock-ticker>=2026.30.0.dev0,<2026.30.0rc0",
|
|
18
18
|
"unique-follow-up-questions>=2026.30.0.dev0,<2026.30.0rc0",
|
|
19
19
|
"unique-internal-search>=2026.30.0.dev0,<2026.30.0rc0",
|
|
20
20
|
"unique-deep-research>=2026.30.0.dev0,<2026.30.0rc0",
|
|
21
|
-
"unique-web-search>=2026.30.0.
|
|
21
|
+
"unique-web-search>=2026.30.0.dev2,<2026.30.0rc0",
|
|
22
22
|
"unique-swot>=2026.30.0.dev0,<2026.30.0rc0",
|
|
23
23
|
"unique-skill-tool>=2026.30.0.dev0,<2026.30.0rc0",
|
|
24
24
|
"unique-user-memory>=2026.30.0.dev0,<2026.30.0rc0",
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
from functools import partial
|
|
2
|
+
from logging import Logger
|
|
3
|
+
|
|
4
|
+
from unique_internal_search.uploaded_search.service import UploadedSearchTool
|
|
5
|
+
from unique_toolkit.agentic.history_manager import (
|
|
6
|
+
history_manager as history_manager_module,
|
|
7
|
+
)
|
|
8
|
+
from unique_toolkit.agentic.history_manager.history_construction_with_contents import (
|
|
9
|
+
FileContentSerializer,
|
|
10
|
+
)
|
|
11
|
+
from unique_toolkit.agentic.history_manager.history_manager import (
|
|
12
|
+
HistoryManager,
|
|
13
|
+
HistoryManagerConfig,
|
|
14
|
+
)
|
|
15
|
+
from unique_toolkit.agentic.reference_manager.reference_manager import ReferenceManager
|
|
16
|
+
from unique_toolkit.agentic.tools.openai_builtin.base import OpenAIBuiltInToolName
|
|
17
|
+
from unique_toolkit.agentic.tools.openai_builtin.code_interpreter.postprocessors.artifacts import (
|
|
18
|
+
load_code_execution_metadata,
|
|
19
|
+
)
|
|
20
|
+
from unique_toolkit.agentic.tools.tool_manager import (
|
|
21
|
+
ResponsesApiToolManager,
|
|
22
|
+
ToolManager,
|
|
23
|
+
)
|
|
24
|
+
from unique_toolkit.app.schemas import ChatEvent
|
|
25
|
+
from unique_toolkit.content import Content
|
|
26
|
+
|
|
27
|
+
from unique_orchestrator.config import UniqueAIConfig
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def serialize_uploaded_file_for_history(
|
|
31
|
+
content: Content,
|
|
32
|
+
*,
|
|
33
|
+
uploaded_search_available: bool,
|
|
34
|
+
code_interpreter_available: bool,
|
|
35
|
+
) -> str | None:
|
|
36
|
+
"""Serialize user-uploaded file metadata for model history."""
|
|
37
|
+
if load_code_execution_metadata(content) is not None:
|
|
38
|
+
return None
|
|
39
|
+
|
|
40
|
+
lines = [f"User uploaded file: {content.key} ({content.id})"]
|
|
41
|
+
if (
|
|
42
|
+
uploaded_search_available
|
|
43
|
+
and content.is_ingested(default_if_unknown=True)
|
|
44
|
+
and not content.is_expired()
|
|
45
|
+
):
|
|
46
|
+
lines.append("- Searchable using UploadedSearchTool")
|
|
47
|
+
if code_interpreter_available:
|
|
48
|
+
lines.append("- Available for processing in the code execution container")
|
|
49
|
+
return "\n".join(lines)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _get_file_content_serializer(
|
|
53
|
+
config: UniqueAIConfig,
|
|
54
|
+
tool_manager: ToolManager | ResponsesApiToolManager,
|
|
55
|
+
) -> FileContentSerializer | None:
|
|
56
|
+
if not config.agent.input_token_distribution.serialize_uploaded_files_in_user_message:
|
|
57
|
+
return None
|
|
58
|
+
|
|
59
|
+
return partial(
|
|
60
|
+
serialize_uploaded_file_for_history,
|
|
61
|
+
uploaded_search_available=(
|
|
62
|
+
tool_manager.get_tool_by_name(UploadedSearchTool.name) is not None
|
|
63
|
+
),
|
|
64
|
+
code_interpreter_available=(
|
|
65
|
+
tool_manager.get_tool_by_name(OpenAIBuiltInToolName.CODE_INTERPRETER)
|
|
66
|
+
is not None
|
|
67
|
+
),
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def build_history_manager(
|
|
72
|
+
*,
|
|
73
|
+
event: ChatEvent,
|
|
74
|
+
logger: Logger,
|
|
75
|
+
config: UniqueAIConfig,
|
|
76
|
+
reference_manager: ReferenceManager,
|
|
77
|
+
tool_manager: ToolManager | ResponsesApiToolManager,
|
|
78
|
+
) -> HistoryManager:
|
|
79
|
+
"""Build a history manager after the active tools are known."""
|
|
80
|
+
history_manager_config = HistoryManagerConfig(
|
|
81
|
+
experimental_features=history_manager_module.ExperimentalFeatures(),
|
|
82
|
+
percent_of_max_tokens_for_history=config.agent.input_token_distribution.percent_for_history,
|
|
83
|
+
language_model=config.space.language_model,
|
|
84
|
+
uploaded_content_config=config.agent.services.uploaded_content_config,
|
|
85
|
+
enable_tool_call_persistence=config.agent.input_token_distribution.enable_tool_call_persistence,
|
|
86
|
+
)
|
|
87
|
+
return HistoryManager(
|
|
88
|
+
logger,
|
|
89
|
+
event,
|
|
90
|
+
history_manager_config,
|
|
91
|
+
config.space.language_model,
|
|
92
|
+
reference_manager,
|
|
93
|
+
file_content_serializer=_get_file_content_serializer(
|
|
94
|
+
config=config,
|
|
95
|
+
tool_manager=tool_manager,
|
|
96
|
+
),
|
|
97
|
+
)
|
|
@@ -8,30 +8,16 @@ from __future__ import annotations
|
|
|
8
8
|
|
|
9
9
|
from datetime import datetime, timezone
|
|
10
10
|
from logging import Logger
|
|
11
|
-
from typing import TYPE_CHECKING
|
|
12
11
|
|
|
13
|
-
from unique_toolkit.agentic.history_manager import (
|
|
14
|
-
history_manager as history_manager_module,
|
|
15
|
-
)
|
|
16
|
-
from unique_toolkit.agentic.history_manager.history_manager import (
|
|
17
|
-
HistoryManager,
|
|
18
|
-
HistoryManagerConfig,
|
|
19
|
-
)
|
|
20
12
|
from unique_toolkit.agentic.tools.experimental.open_file_tool import OpenFileTool
|
|
21
13
|
from unique_toolkit.agentic.tools.tool_manager import (
|
|
22
14
|
ResponsesApiToolManager,
|
|
23
15
|
)
|
|
24
16
|
from unique_toolkit.app.schemas import ChatEvent
|
|
25
17
|
from unique_toolkit.content import Content
|
|
26
|
-
from unique_toolkit.language_model.infos import LanguageModelInfo
|
|
27
18
|
|
|
28
19
|
from unique_orchestrator.config import UniqueAIConfig
|
|
29
20
|
|
|
30
|
-
if TYPE_CHECKING:
|
|
31
|
-
from unique_toolkit.agentic.reference_manager.reference_manager import (
|
|
32
|
-
ReferenceManager,
|
|
33
|
-
)
|
|
34
|
-
|
|
35
21
|
|
|
36
22
|
def handle_uploaded_file_tool_choices(
|
|
37
23
|
config: UniqueAIConfig,
|
|
@@ -76,39 +62,15 @@ def handle_uploaded_file_tool_choices(
|
|
|
76
62
|
def configure_file_payload(
|
|
77
63
|
config: UniqueAIConfig,
|
|
78
64
|
event: ChatEvent,
|
|
79
|
-
logger: Logger,
|
|
80
|
-
history_manager: HistoryManager,
|
|
81
|
-
reference_manager: ReferenceManager,
|
|
82
|
-
language_model: LanguageModelInfo,
|
|
83
65
|
tool_manager: ResponsesApiToolManager,
|
|
84
|
-
) ->
|
|
66
|
+
) -> list[str]:
|
|
85
67
|
"""Configure file-in-payload handling for the Responses API.
|
|
86
68
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
(which would duplicate what the input_file parts already provide).
|
|
69
|
+
Registers the OpenFileTool when send_files_in_payload is enabled, backed by
|
|
70
|
+
a shared registry for agent-requested KB file IDs.
|
|
90
71
|
|
|
91
|
-
|
|
92
|
-
backed by a shared registry for agent-requested KB file IDs.
|
|
93
|
-
|
|
94
|
-
Returns the (possibly updated) history_manager and the agent file registry.
|
|
72
|
+
Returns the registry shared with the OpenFileTool.
|
|
95
73
|
"""
|
|
96
|
-
if config.agent.experimental.open_file_tool_config.send_uploaded_files_in_payload:
|
|
97
|
-
upload_free_config = HistoryManagerConfig(
|
|
98
|
-
experimental_features=history_manager_module.ExperimentalFeatures(),
|
|
99
|
-
percent_of_max_tokens_for_history=config.agent.input_token_distribution.percent_for_history,
|
|
100
|
-
language_model=language_model,
|
|
101
|
-
uploaded_content_config=None,
|
|
102
|
-
enable_tool_call_persistence=config.agent.input_token_distribution.enable_tool_call_persistence,
|
|
103
|
-
)
|
|
104
|
-
history_manager = HistoryManager(
|
|
105
|
-
logger,
|
|
106
|
-
event,
|
|
107
|
-
upload_free_config,
|
|
108
|
-
language_model,
|
|
109
|
-
reference_manager,
|
|
110
|
-
)
|
|
111
|
-
|
|
112
74
|
agent_file_registry: list[str] = []
|
|
113
75
|
|
|
114
76
|
if config.agent.experimental.open_file_tool_config.send_files_in_payload:
|
|
@@ -120,4 +82,4 @@ def configure_file_payload(
|
|
|
120
82
|
)
|
|
121
83
|
)
|
|
122
84
|
|
|
123
|
-
return
|
|
85
|
+
return agent_file_registry
|
|
@@ -348,6 +348,11 @@ class HistoryConfig(BaseToolConfig):
|
|
|
348
348
|
description="Persist tool calls and reconstruct tool call history across turns.",
|
|
349
349
|
)
|
|
350
350
|
|
|
351
|
+
serialize_uploaded_files_in_user_message: bool = Field(
|
|
352
|
+
default=False,
|
|
353
|
+
description="Include an indication of each uploaded file in the user message.",
|
|
354
|
+
)
|
|
355
|
+
|
|
351
356
|
def max_history_tokens(self, max_input_token: int) -> int:
|
|
352
357
|
return int(self.percent_for_history * max_input_token)
|
|
353
358
|
|
|
@@ -353,6 +353,14 @@ class TestRunLoopDebugParams:
|
|
|
353
353
|
]
|
|
354
354
|
assert "loop_params" in keys_written
|
|
355
355
|
assert "skills" in keys_written
|
|
356
|
+
skills_call = next(
|
|
357
|
+
c
|
|
358
|
+
for c in ua._debug_info_manager.add.call_args_list
|
|
359
|
+
if c.args[0] == "skills"
|
|
360
|
+
)
|
|
361
|
+
ua._debug_info_manager.add_analytics.assert_called_once_with(
|
|
362
|
+
skills_call.args[1]
|
|
363
|
+
)
|
|
356
364
|
|
|
357
365
|
@pytest.mark.ai
|
|
358
366
|
@pytest.mark.asyncio
|
|
@@ -316,10 +316,9 @@ class UniqueAI:
|
|
|
316
316
|
},
|
|
317
317
|
)
|
|
318
318
|
self._debug_info_manager.add("loop_params", self._loop_debug_params)
|
|
319
|
-
self.
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
)
|
|
319
|
+
skills_debug_info = self._get_activated_skills_debug_info()
|
|
320
|
+
self._debug_info_manager.add("skills", skills_debug_info)
|
|
321
|
+
self._debug_info_manager.add_analytics(skills_debug_info)
|
|
323
322
|
|
|
324
323
|
tool_names = [
|
|
325
324
|
tool["name"] for tool in self._debug_info_manager.get()["tools"]
|
|
@@ -20,13 +20,7 @@ from unique_toolkit.agentic.evaluation.evaluation_manager import EvaluationManag
|
|
|
20
20
|
from unique_toolkit.agentic.evaluation.hallucination.hallucination_evaluation import (
|
|
21
21
|
HallucinationEvaluation,
|
|
22
22
|
)
|
|
23
|
-
from unique_toolkit.agentic.history_manager import
|
|
24
|
-
history_manager as history_manager_module,
|
|
25
|
-
)
|
|
26
|
-
from unique_toolkit.agentic.history_manager.history_manager import (
|
|
27
|
-
HistoryManager,
|
|
28
|
-
HistoryManagerConfig,
|
|
29
|
-
)
|
|
23
|
+
from unique_toolkit.agentic.history_manager.history_manager import HistoryManager
|
|
30
24
|
from unique_toolkit.agentic.message_log_manager.service import MessageStepLogger
|
|
31
25
|
from unique_toolkit.agentic.postprocessor.postprocessor_manager import (
|
|
32
26
|
PostprocessorManager,
|
|
@@ -81,6 +75,7 @@ from unique_orchestrator._builders import (
|
|
|
81
75
|
build_loop_iteration_runner,
|
|
82
76
|
build_responses_loop_iteration_runner,
|
|
83
77
|
)
|
|
78
|
+
from unique_orchestrator._builders.history_manager import build_history_manager
|
|
84
79
|
from unique_orchestrator._builders.open_file_setup import (
|
|
85
80
|
configure_file_payload,
|
|
86
81
|
handle_uploaded_file_tool_choices,
|
|
@@ -98,6 +93,27 @@ from unique_orchestrator.unique_ai import UniqueAI
|
|
|
98
93
|
from unique_orchestrator.utils import filter_uploaded_documents_by_selection
|
|
99
94
|
|
|
100
95
|
|
|
96
|
+
def _configure_follow_up_questions(
|
|
97
|
+
*,
|
|
98
|
+
config: UniqueAIConfig,
|
|
99
|
+
event: ChatEvent,
|
|
100
|
+
logger: Logger,
|
|
101
|
+
history_manager: HistoryManager,
|
|
102
|
+
postprocessor_manager: PostprocessorManager,
|
|
103
|
+
) -> None:
|
|
104
|
+
follow_up_config = config.agent.services.follow_up_questions_config
|
|
105
|
+
if follow_up_config and follow_up_config.number_of_questions > 0:
|
|
106
|
+
postprocessor_manager.set_last_postprocessor(
|
|
107
|
+
FollowUpPostprocessor(
|
|
108
|
+
logger=logger,
|
|
109
|
+
config=follow_up_config,
|
|
110
|
+
event=event,
|
|
111
|
+
historyManager=history_manager,
|
|
112
|
+
llm_service=LanguageModelService.from_event(event),
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
|
|
101
117
|
class ResponsesStreamingHandler(ResponsesSupportCompleteWithReferences):
|
|
102
118
|
"""Streaming handler for Responses API runs.
|
|
103
119
|
|
|
@@ -190,7 +206,6 @@ class _CommonComponents(NamedTuple):
|
|
|
190
206
|
uploaded_images: list[Content]
|
|
191
207
|
thinking_manager: ThinkingManager
|
|
192
208
|
reference_manager: ReferenceManager
|
|
193
|
-
history_manager: HistoryManager
|
|
194
209
|
evaluation_manager: EvaluationManager
|
|
195
210
|
postprocessor_manager: PostprocessorManager
|
|
196
211
|
message_step_logger: MessageStepLogger
|
|
@@ -312,21 +327,6 @@ async def _build_common(
|
|
|
312
327
|
|
|
313
328
|
reference_manager = ReferenceManager()
|
|
314
329
|
|
|
315
|
-
history_manager_config = HistoryManagerConfig(
|
|
316
|
-
experimental_features=history_manager_module.ExperimentalFeatures(),
|
|
317
|
-
percent_of_max_tokens_for_history=config.agent.input_token_distribution.percent_for_history,
|
|
318
|
-
language_model=config.space.language_model,
|
|
319
|
-
uploaded_content_config=config.agent.services.uploaded_content_config,
|
|
320
|
-
enable_tool_call_persistence=config.agent.input_token_distribution.enable_tool_call_persistence,
|
|
321
|
-
)
|
|
322
|
-
history_manager = HistoryManager(
|
|
323
|
-
logger,
|
|
324
|
-
event,
|
|
325
|
-
history_manager_config,
|
|
326
|
-
config.space.language_model,
|
|
327
|
-
reference_manager,
|
|
328
|
-
)
|
|
329
|
-
|
|
330
330
|
evaluation_manager = EvaluationManager(logger=logger, chat_service=chat_service)
|
|
331
331
|
if config.agent.services.evaluation_config:
|
|
332
332
|
evaluation_manager.add_evaluation(
|
|
@@ -370,21 +370,6 @@ async def _build_common(
|
|
|
370
370
|
)
|
|
371
371
|
)
|
|
372
372
|
|
|
373
|
-
if (
|
|
374
|
-
config.agent.services.follow_up_questions_config
|
|
375
|
-
and config.agent.services.follow_up_questions_config.number_of_questions > 0
|
|
376
|
-
):
|
|
377
|
-
# Should run last to make sure the follow up questions are displayed last.
|
|
378
|
-
postprocessor_manager.set_last_postprocessor(
|
|
379
|
-
FollowUpPostprocessor(
|
|
380
|
-
logger=logger,
|
|
381
|
-
config=config.agent.services.follow_up_questions_config,
|
|
382
|
-
event=event,
|
|
383
|
-
historyManager=history_manager,
|
|
384
|
-
llm_service=LanguageModelService.from_event(event),
|
|
385
|
-
)
|
|
386
|
-
)
|
|
387
|
-
|
|
388
373
|
user_memory_text = ""
|
|
389
374
|
if config.space.allow_user_memory:
|
|
390
375
|
user_memory_config = config.agent.services.user_memory_config
|
|
@@ -423,7 +408,6 @@ async def _build_common(
|
|
|
423
408
|
uploaded_images=uploaded_images,
|
|
424
409
|
thinking_manager=thinking_manager,
|
|
425
410
|
reference_manager=reference_manager,
|
|
426
|
-
history_manager=history_manager,
|
|
427
411
|
evaluation_manager=evaluation_manager,
|
|
428
412
|
tool_progress_reporter=tool_progress_reporter,
|
|
429
413
|
mcp_manager=mcp_manager,
|
|
@@ -565,18 +549,26 @@ async def _build_responses(
|
|
|
565
549
|
|
|
566
550
|
agent_file_registry: list[str] = []
|
|
567
551
|
if config.agent.experimental.open_file_tool_config.enabled:
|
|
568
|
-
|
|
552
|
+
agent_file_registry = configure_file_payload(
|
|
569
553
|
config,
|
|
570
554
|
event,
|
|
571
|
-
logger,
|
|
572
|
-
common_components.history_manager,
|
|
573
|
-
common_components.reference_manager,
|
|
574
|
-
config.space.language_model,
|
|
575
555
|
tool_manager,
|
|
576
556
|
)
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
557
|
+
|
|
558
|
+
history_manager = build_history_manager(
|
|
559
|
+
event=event,
|
|
560
|
+
logger=logger,
|
|
561
|
+
config=config,
|
|
562
|
+
reference_manager=common_components.reference_manager,
|
|
563
|
+
tool_manager=tool_manager,
|
|
564
|
+
)
|
|
565
|
+
_configure_follow_up_questions(
|
|
566
|
+
config=config,
|
|
567
|
+
event=event,
|
|
568
|
+
logger=logger,
|
|
569
|
+
history_manager=history_manager,
|
|
570
|
+
postprocessor_manager=postprocessor_manager,
|
|
571
|
+
)
|
|
580
572
|
|
|
581
573
|
await configure_skill_tool(
|
|
582
574
|
config=config,
|
|
@@ -590,7 +582,7 @@ async def _build_responses(
|
|
|
590
582
|
|
|
591
583
|
loop_iteration_runner = build_responses_loop_iteration_runner(
|
|
592
584
|
config=config,
|
|
593
|
-
history_manager=
|
|
585
|
+
history_manager=history_manager,
|
|
594
586
|
openai_client=client,
|
|
595
587
|
)
|
|
596
588
|
|
|
@@ -637,7 +629,7 @@ async def _build_responses(
|
|
|
637
629
|
tool_manager=tool_manager,
|
|
638
630
|
thinking_manager=common_components.thinking_manager,
|
|
639
631
|
streaming_handler=streaming_handler,
|
|
640
|
-
history_manager=
|
|
632
|
+
history_manager=history_manager,
|
|
641
633
|
reference_manager=common_components.reference_manager,
|
|
642
634
|
evaluation_manager=common_components.evaluation_manager,
|
|
643
635
|
postprocessor_manager=postprocessor_manager,
|
|
@@ -677,6 +669,21 @@ async def _build_completions(
|
|
|
677
669
|
if force_uploaded_search:
|
|
678
670
|
tool_manager.add_forced_tool(UploadedSearchTool.name)
|
|
679
671
|
|
|
672
|
+
history_manager = build_history_manager(
|
|
673
|
+
event=event,
|
|
674
|
+
logger=logger,
|
|
675
|
+
config=config,
|
|
676
|
+
reference_manager=common_components.reference_manager,
|
|
677
|
+
tool_manager=tool_manager,
|
|
678
|
+
)
|
|
679
|
+
_configure_follow_up_questions(
|
|
680
|
+
config=config,
|
|
681
|
+
event=event,
|
|
682
|
+
logger=logger,
|
|
683
|
+
history_manager=history_manager,
|
|
684
|
+
postprocessor_manager=common_components.postprocessor_manager,
|
|
685
|
+
)
|
|
686
|
+
|
|
680
687
|
await configure_skill_tool(
|
|
681
688
|
config=config,
|
|
682
689
|
logger=logger,
|
|
@@ -705,7 +712,7 @@ async def _build_completions(
|
|
|
705
712
|
|
|
706
713
|
loop_iteration_runner = build_loop_iteration_runner(
|
|
707
714
|
config=config,
|
|
708
|
-
history_manager=
|
|
715
|
+
history_manager=history_manager,
|
|
709
716
|
llm_service=common_components.llm_service,
|
|
710
717
|
chat_service=common_components.chat_service,
|
|
711
718
|
)
|
|
@@ -719,7 +726,7 @@ async def _build_completions(
|
|
|
719
726
|
uploaded_documents=common_components.uploaded_documents,
|
|
720
727
|
tool_manager=tool_manager,
|
|
721
728
|
thinking_manager=common_components.thinking_manager,
|
|
722
|
-
history_manager=
|
|
729
|
+
history_manager=history_manager,
|
|
723
730
|
reference_manager=common_components.reference_manager,
|
|
724
731
|
streaming_handler=common_components.chat_service,
|
|
725
732
|
evaluation_manager=common_components.evaluation_manager,
|
|
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
|