unique_orchestrator 0.0.1__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 +505 -0
- unique_orchestrator/prompts/generic_reference_prompt.jinja2 +46 -0
- unique_orchestrator/prompts/system_prompt.jinja2 +141 -0
- unique_orchestrator/prompts/user_message_prompt.jinja2 +18 -0
- unique_orchestrator/tests/test_config.py +115 -0
- unique_orchestrator/tests/test_unique_ai_reference_order.py +127 -0
- unique_orchestrator/unique_ai.py +375 -0
- unique_orchestrator/unique_ai_builder.py +178 -0
- unique_orchestrator-0.0.1.dist-info/LICENSE +1 -0
- unique_orchestrator-0.0.1.dist-info/METADATA +39 -0
- unique_orchestrator-0.0.1.dist-info/RECORD +12 -0
- unique_orchestrator-0.0.1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
from logging import Logger
|
|
2
|
+
|
|
3
|
+
from unique_follow_up_questions.follow_up_postprocessor import (
|
|
4
|
+
FollowUpPostprocessor,
|
|
5
|
+
)
|
|
6
|
+
from unique_internal_search.uploaded_search.config import (
|
|
7
|
+
UploadedSearchConfig,
|
|
8
|
+
)
|
|
9
|
+
from unique_internal_search.uploaded_search.service import (
|
|
10
|
+
UploadedSearchTool,
|
|
11
|
+
)
|
|
12
|
+
from unique_stock_ticker.stock_ticker_postprocessor import (
|
|
13
|
+
StockTickerPostprocessor,
|
|
14
|
+
)
|
|
15
|
+
from unique_toolkit import LanguageModelService
|
|
16
|
+
from unique_toolkit.app.schemas import ChatEvent
|
|
17
|
+
from unique_toolkit.chat.service import ChatService
|
|
18
|
+
from unique_toolkit.content.service import ContentService
|
|
19
|
+
from unique_toolkit.debug_info_manager.debug_info_manager import (
|
|
20
|
+
DebugInfoManager,
|
|
21
|
+
)
|
|
22
|
+
from unique_toolkit.evals.evaluation_manager import EvaluationManager
|
|
23
|
+
from unique_toolkit.evals.hallucination.hallucination_evaluation import (
|
|
24
|
+
HallucinationEvaluation,
|
|
25
|
+
)
|
|
26
|
+
from unique_toolkit.history_manager import (
|
|
27
|
+
history_manager as history_manager_module,
|
|
28
|
+
)
|
|
29
|
+
from unique_toolkit.history_manager.history_manager import (
|
|
30
|
+
HistoryManager,
|
|
31
|
+
HistoryManagerConfig,
|
|
32
|
+
)
|
|
33
|
+
from unique_toolkit.postprocessor.postprocessor_manager import (
|
|
34
|
+
PostprocessorManager,
|
|
35
|
+
)
|
|
36
|
+
from unique_toolkit.reference_manager.reference_manager import ReferenceManager
|
|
37
|
+
from unique_toolkit.thinking_manager.thinking_manager import (
|
|
38
|
+
ThinkingManager,
|
|
39
|
+
ThinkingManagerConfig,
|
|
40
|
+
)
|
|
41
|
+
from unique_toolkit.tools.a2a.manager import A2AManager
|
|
42
|
+
from unique_toolkit.tools.config import ToolBuildConfig
|
|
43
|
+
from unique_toolkit.tools.mcp.manager import MCPManager
|
|
44
|
+
from unique_toolkit.tools.tool_manager import ToolManager, ToolManagerConfig
|
|
45
|
+
from unique_toolkit.tools.tool_progress_reporter import ToolProgressReporter
|
|
46
|
+
|
|
47
|
+
from unique_orchestrator.config import UniqueAIConfig
|
|
48
|
+
from unique_orchestrator.unique_ai import UniqueAI
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def build_unique_ai(
|
|
52
|
+
event: ChatEvent,
|
|
53
|
+
logger: Logger,
|
|
54
|
+
config: UniqueAIConfig,
|
|
55
|
+
debug_info_manager: DebugInfoManager,
|
|
56
|
+
) -> UniqueAI:
|
|
57
|
+
chat_service = ChatService(event)
|
|
58
|
+
|
|
59
|
+
content_service = ContentService.from_event(event)
|
|
60
|
+
tool_progress_reporter = ToolProgressReporter(chat_service=chat_service)
|
|
61
|
+
reference_manager = ReferenceManager()
|
|
62
|
+
thinking_manager_config = ThinkingManagerConfig(
|
|
63
|
+
thinking_steps_display=config.agent.experimental.thinking_steps_display
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
thinking_manager = ThinkingManager(
|
|
67
|
+
logger=logger,
|
|
68
|
+
config=thinking_manager_config,
|
|
69
|
+
tool_progress_reporter=tool_progress_reporter,
|
|
70
|
+
chat_service=chat_service,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
uploaded_documents = content_service.get_documents_uploaded_to_chat()
|
|
74
|
+
if len(uploaded_documents) > 0:
|
|
75
|
+
logger.info(
|
|
76
|
+
f"Adding UploadedSearchTool with {len(uploaded_documents)} documents"
|
|
77
|
+
)
|
|
78
|
+
config.space.tools.append(
|
|
79
|
+
ToolBuildConfig(
|
|
80
|
+
name=UploadedSearchTool.name,
|
|
81
|
+
display_name=UploadedSearchTool.name,
|
|
82
|
+
configuration=UploadedSearchConfig(),
|
|
83
|
+
),
|
|
84
|
+
)
|
|
85
|
+
event.payload.tool_choices.append(str(UploadedSearchTool.name))
|
|
86
|
+
|
|
87
|
+
mcp_manager = MCPManager(
|
|
88
|
+
mcp_servers=event.payload.mcp_servers,
|
|
89
|
+
event=event,
|
|
90
|
+
tool_progress_reporter=tool_progress_reporter,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
a2a_manager = A2AManager(
|
|
94
|
+
logger=logger,
|
|
95
|
+
tool_progress_reporter=tool_progress_reporter,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
tool_config = ToolManagerConfig(
|
|
99
|
+
tools=config.space.tools,
|
|
100
|
+
max_tool_calls=config.agent.experimental.loop_configuration.max_tool_calls_per_iteration,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
tool_manager = ToolManager(
|
|
104
|
+
logger=logger,
|
|
105
|
+
config=tool_config,
|
|
106
|
+
event=event,
|
|
107
|
+
tool_progress_reporter=tool_progress_reporter,
|
|
108
|
+
mcp_manager=mcp_manager,
|
|
109
|
+
a2a_manager=a2a_manager,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
history_manager_config = HistoryManagerConfig(
|
|
113
|
+
experimental_features=history_manager_module.ExperimentalFeatures(
|
|
114
|
+
full_sources_serialize_dump=False,
|
|
115
|
+
),
|
|
116
|
+
percent_of_max_tokens_for_history=config.agent.input_token_distribution.percent_for_history,
|
|
117
|
+
language_model=config.space.language_model,
|
|
118
|
+
uploaded_content_config=config.agent.services.uploaded_content_config,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
history_manager = HistoryManager(
|
|
122
|
+
logger,
|
|
123
|
+
event,
|
|
124
|
+
history_manager_config,
|
|
125
|
+
config.space.language_model,
|
|
126
|
+
reference_manager,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
evaluation_manager = EvaluationManager(logger=logger, chat_service=chat_service)
|
|
130
|
+
|
|
131
|
+
if config.agent.services.evaluation_config:
|
|
132
|
+
evaluation_manager.add_evaluation(
|
|
133
|
+
HallucinationEvaluation(
|
|
134
|
+
config.agent.services.evaluation_config.hallucination_config,
|
|
135
|
+
event,
|
|
136
|
+
reference_manager,
|
|
137
|
+
)
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
postprocessor_manager = PostprocessorManager(
|
|
141
|
+
logger=logger,
|
|
142
|
+
chat_service=chat_service,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
if config.agent.services.stock_ticker_config:
|
|
146
|
+
postprocessor_manager.add_postprocessor(
|
|
147
|
+
StockTickerPostprocessor(
|
|
148
|
+
config=config.agent.services.stock_ticker_config,
|
|
149
|
+
event=event,
|
|
150
|
+
)
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
if config.agent.services.follow_up_questions_config:
|
|
154
|
+
postprocessor_manager.add_postprocessor(
|
|
155
|
+
FollowUpPostprocessor(
|
|
156
|
+
logger=logger,
|
|
157
|
+
config=config.agent.services.follow_up_questions_config,
|
|
158
|
+
event=event,
|
|
159
|
+
historyManager=history_manager,
|
|
160
|
+
llm_service=LanguageModelService.from_event(event),
|
|
161
|
+
)
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
return UniqueAI(
|
|
165
|
+
event=event,
|
|
166
|
+
config=config,
|
|
167
|
+
logger=logger,
|
|
168
|
+
chat_service=chat_service,
|
|
169
|
+
content_service=content_service,
|
|
170
|
+
tool_manager=tool_manager,
|
|
171
|
+
thinking_manager=thinking_manager,
|
|
172
|
+
history_manager=history_manager,
|
|
173
|
+
reference_manager=reference_manager,
|
|
174
|
+
evaluation_manager=evaluation_manager,
|
|
175
|
+
postprocessor_manager=postprocessor_manager,
|
|
176
|
+
debug_info_manager=debug_info_manager,
|
|
177
|
+
mcp_servers=event.payload.mcp_servers,
|
|
178
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
`unique_toolkit` is covered by the [`Unique License v1`](https://github.com/Unique-AG/license/releases/tag/unique-license.v1), unless the/a header or a nested LICENSE specifies another license.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: unique_orchestrator
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary:
|
|
5
|
+
License: Proprietary
|
|
6
|
+
Author: Martin Fadler
|
|
7
|
+
Author-email: martin.fadler@unique.ch
|
|
8
|
+
Requires-Python: >=3.11,<4.0
|
|
9
|
+
Classifier: License :: Other/Proprietary License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Requires-Dist: pydantic (>=2.8.2,<3.0.0)
|
|
14
|
+
Requires-Dist: pydantic-settings (>=2.10.1,<3.0.0)
|
|
15
|
+
Requires-Dist: pytest (>=8.4.1,<9.0.0)
|
|
16
|
+
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
|
17
|
+
Requires-Dist: typing-extensions (>=4.9.0,<5.0.0)
|
|
18
|
+
Requires-Dist: unique-deep-research (>=0.0.10,<0.0.11)
|
|
19
|
+
Requires-Dist: unique-follow-up-questions (>=0.0.4,<0.0.5)
|
|
20
|
+
Requires-Dist: unique-internal-search (==0.0.5)
|
|
21
|
+
Requires-Dist: unique-sdk (>=0.10.0,<0.11.0)
|
|
22
|
+
Requires-Dist: unique-stock-ticker (>=0.0.5,<0.0.6)
|
|
23
|
+
Requires-Dist: unique-toolkit (>=0.8.57,<0.9.0)
|
|
24
|
+
Requires-Dist: unique-web-search (>=0.1.0,<0.2.0)
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# Internal Search Tool
|
|
28
|
+
|
|
29
|
+
Internal Search Tool to find documents in the Knowledge Base
|
|
30
|
+
# Changelog
|
|
31
|
+
|
|
32
|
+
All notable changes to this project will be documented in this file.
|
|
33
|
+
|
|
34
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
35
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [0.0.1] - 2025-08-18
|
|
39
|
+
- Initial release of `orchestrator`.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
unique_orchestrator/config.py,sha256=y5keSY9hDrtinV6LnMxpIwEOQIJ1zEfwKfr8EQvX-wY,16652
|
|
2
|
+
unique_orchestrator/prompts/generic_reference_prompt.jinja2,sha256=fYPaiE-N1gSoOqu85OeEBa_ttAim8grOhHuOHJjSHNU,2663
|
|
3
|
+
unique_orchestrator/prompts/system_prompt.jinja2,sha256=2Dy8GHrT018Sj9UkYGxSfjt7fvTTDvD53BxjDMZRPVY,6897
|
|
4
|
+
unique_orchestrator/prompts/user_message_prompt.jinja2,sha256=KLCfbxMu5R7_V8-AHkdXEmVorcSHNej_xM_7xJyNkl0,692
|
|
5
|
+
unique_orchestrator/tests/test_config.py,sha256=P7QkVlVv0ppiK77s5i4rE4IOzdtdBCZZkeIA3KRc82k,4070
|
|
6
|
+
unique_orchestrator/tests/test_unique_ai_reference_order.py,sha256=8mZeVP1k8neH4qrFW3oa3zwIdaq2c7R1VvurC7kjBU8,4445
|
|
7
|
+
unique_orchestrator/unique_ai.py,sha256=xGQogDbxA7qjfk8R85t5m8PI_XDY7tk-s4tkvp8on_Q,15574
|
|
8
|
+
unique_orchestrator/unique_ai_builder.py,sha256=J73_Lg3XjI9JKirUmC6juWTefk7gPkG67NPLdUL4zr0,5991
|
|
9
|
+
unique_orchestrator-0.0.1.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
|
|
10
|
+
unique_orchestrator-0.0.1.dist-info/METADATA,sha256=z1CJYqVYKbGHsQe8ScjDIf4jXHuBkAM9wWiDPBUaRlE,1408
|
|
11
|
+
unique_orchestrator-0.0.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
12
|
+
unique_orchestrator-0.0.1.dist-info/RECORD,,
|