unique_toolkit 1.8.1__tar.gz → 1.9.1__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_toolkit-1.8.1 → unique_toolkit-1.9.1}/CHANGELOG.md +6 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/PKG-INFO +8 -2
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/README.md +1 -1
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/pyproject.toml +2 -1
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/api_calling/human_verification_manager.py +3 -2
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/chunk_relevancy_sorter/config.py +3 -3
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/chunk_relevancy_sorter/tests/test_service.py +1 -2
- unique_toolkit-1.9.1/unique_toolkit/_common/default_language_model.py +3 -0
- unique_toolkit-1.9.1/unique_toolkit/_common/endpoint_requestor.py +395 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/config.py +3 -2
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/context_relevancy/service.py +2 -2
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/history_manager/history_manager.py +3 -4
- unique_toolkit-1.8.1/unique_toolkit/_common/default_language_model.py +0 -6
- unique_toolkit-1.8.1/unique_toolkit/_common/endpoint_requestor.py +0 -204
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/LICENSE +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/_base_service.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/_time_utils.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/base_model_type_attribute.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/chunk_relevancy_sorter/exception.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/chunk_relevancy_sorter/schemas.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/chunk_relevancy_sorter/service.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/endpoint_builder.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/exception.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/feature_flags/schema.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/pydantic/rjsf_tags.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/pydantic_helpers.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/string_utilities.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/token/image_token_counting.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/token/token_counting.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/utils/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/utils/structured_output/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/utils/structured_output/schema.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/utils/write_configuration.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/validate_required_values.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/_common/validators.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/debug_info_manager/debug_info_manager.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/context_relevancy/prompts.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/context_relevancy/schema.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/evaluation_manager.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/exception.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/hallucination/constants.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/hallucination/hallucination_evaluation.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/hallucination/prompts.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/hallucination/service.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/hallucination/utils.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/output_parser.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/schemas.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/tests/test_context_relevancy_service.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/evaluation/tests/test_output_parser.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/history_manager/history_construction_with_contents.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/history_manager/loop_token_reducer.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/history_manager/utils.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/postprocessor/postprocessor_manager.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/reference_manager/reference_manager.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/short_term_memory_manager/persistent_short_term_memory_manager.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/thinking_manager/thinking_manager.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/config.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/evaluation/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/evaluation/_utils.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/evaluation/config.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/evaluation/evaluator.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/evaluation/summarization_user_message.j2 +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/manager.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/postprocessing/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/postprocessing/_display.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/postprocessing/_utils.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/postprocessing/config.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/postprocessing/postprocessor.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/postprocessing/test/test_consolidate_references.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/postprocessing/test/test_display.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/postprocessing/test/test_postprocessor_reference_functions.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/tool/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/tool/_memory.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/tool/_schema.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/tool/config.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/a2a/tool/service.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/agent_chunks_hanlder.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/config.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/factory.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/mcp/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/mcp/manager.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/mcp/models.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/mcp/tool_wrapper.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/schemas.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/test/test_mcp_manager.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/test/test_tool_progress_reporter.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/tool.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/tool_manager.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/tool_progress_reporter.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/utils/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/utils/execution/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/utils/execution/execution.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/utils/source_handling/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/utils/source_handling/schema.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/utils/source_handling/source_formatting.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/agentic/tools/utils/source_handling/tests/test_source_formatting.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/app/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/app/dev_util.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/app/init_logging.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/app/init_sdk.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/app/performance/async_tasks.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/app/performance/async_wrapper.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/app/schemas.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/app/unique_settings.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/app/verification.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/chat/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/chat/constants.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/chat/functions.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/chat/schemas.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/chat/service.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/chat/state.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/chat/utils.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/content/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/content/constants.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/content/functions.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/content/schemas.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/content/service.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/content/utils.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/embedding/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/embedding/constants.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/embedding/functions.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/embedding/schemas.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/embedding/service.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/embedding/utils.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/framework_utilities/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/framework_utilities/langchain/client.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/framework_utilities/langchain/history.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/framework_utilities/openai/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/framework_utilities/openai/client.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/framework_utilities/openai/message_builder.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/framework_utilities/utils.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/language_model/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/language_model/builder.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/language_model/constants.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/language_model/functions.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/language_model/infos.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/language_model/prompt.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/language_model/reference.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/language_model/schemas.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/language_model/service.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/language_model/utils.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/protocols/support.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/short_term_memory/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/short_term_memory/constants.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/short_term_memory/functions.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/short_term_memory/schemas.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/short_term_memory/service.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/smart_rules/__init__.py +0 -0
- {unique_toolkit-1.8.1 → unique_toolkit-1.9.1}/unique_toolkit/smart_rules/compile.py +0 -0
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [1.9.1] - 2025-10-06
|
9
|
+
- Switch default model used in evaluation service from `GPT-3.5-turbo (0125)` to `GPT-4o (1120)`
|
10
|
+
|
11
|
+
## [1.9.0] - 2026-10-04
|
12
|
+
- Define the RequestContext and add aihttp/httpx requestors
|
13
|
+
|
8
14
|
## [1.8.1] - 2026-10-03
|
9
15
|
- Fix bug where sub agent evaluation config variable `include_evaluation` did not include aliases for previous names.
|
10
16
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: unique_toolkit
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.9.1
|
4
4
|
Summary:
|
5
5
|
License: Proprietary
|
6
6
|
Author: Cedric Klinkert
|
@@ -88,7 +88,7 @@ The `unique_toolkit.embedding` module encompasses all embedding related function
|
|
88
88
|
The `unique_toolkit.language_model` module encompasses all language model related functionality and information on the different language models deployed through the
|
89
89
|
Unique platform.
|
90
90
|
|
91
|
-
- `infos.py` comprises the information on all language models deployed through the Unique platform. We recommend to use the LanguageModel class, initialized with the LanguageModelName, e.g., LanguageModel(LanguageModelName.
|
91
|
+
- `infos.py` comprises the information on all language models deployed through the Unique platform. We recommend to use the LanguageModel class, initialized with the LanguageModelName, e.g., LanguageModel(LanguageModelName.AZURE_GPT_4o_2024_1120) to get the information on the specific language model like the name, version, token limits or retirement date.
|
92
92
|
- `functions.py` comprises the functions to complete and stream complete to chat.
|
93
93
|
- `service.py` comprises the LanguageModelService and provides an interface to interact with the language models, e.g., complete.
|
94
94
|
- `schemas.py` comprises all relevant schemas, e.g., LanguageModelResponse, used in the LanguageModelService.
|
@@ -118,6 +118,12 @@ All notable changes to this project will be documented in this file.
|
|
118
118
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
119
119
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
120
120
|
|
121
|
+
## [1.9.1] - 2025-10-06
|
122
|
+
- Switch default model used in evaluation service from `GPT-3.5-turbo (0125)` to `GPT-4o (1120)`
|
123
|
+
|
124
|
+
## [1.9.0] - 2026-10-04
|
125
|
+
- Define the RequestContext and add aihttp/httpx requestors
|
126
|
+
|
121
127
|
## [1.8.1] - 2026-10-03
|
122
128
|
- Fix bug where sub agent evaluation config variable `include_evaluation` did not include aliases for previous names.
|
123
129
|
|
@@ -59,7 +59,7 @@ The `unique_toolkit.embedding` module encompasses all embedding related function
|
|
59
59
|
The `unique_toolkit.language_model` module encompasses all language model related functionality and information on the different language models deployed through the
|
60
60
|
Unique platform.
|
61
61
|
|
62
|
-
- `infos.py` comprises the information on all language models deployed through the Unique platform. We recommend to use the LanguageModel class, initialized with the LanguageModelName, e.g., LanguageModel(LanguageModelName.
|
62
|
+
- `infos.py` comprises the information on all language models deployed through the Unique platform. We recommend to use the LanguageModel class, initialized with the LanguageModelName, e.g., LanguageModel(LanguageModelName.AZURE_GPT_4o_2024_1120) to get the information on the specific language model like the name, version, token limits or retirement date.
|
63
63
|
- `functions.py` comprises the functions to complete and stream complete to chat.
|
64
64
|
- `service.py` comprises the LanguageModelService and provides an interface to interact with the language models, e.g., complete.
|
65
65
|
- `schemas.py` comprises all relevant schemas, e.g., LanguageModelResponse, used in the LanguageModelService.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "unique_toolkit"
|
3
|
-
version = "1.
|
3
|
+
version = "1.9.1"
|
4
4
|
description = ""
|
5
5
|
authors = [
|
6
6
|
"Cedric Klinkert <cedric.klinkert@unique.ch>",
|
@@ -62,6 +62,7 @@ entangled-cli = "^2.1.13"
|
|
62
62
|
mkdocs-entangled-plugin = "^0.4.0"
|
63
63
|
isort = "^6.0.1"
|
64
64
|
mkdocs-codeinclude-plugin = "^0.2.1"
|
65
|
+
aiohttp = "^3.12.15"
|
65
66
|
|
66
67
|
[build-system]
|
67
68
|
requires = ["poetry-core"]
|
@@ -15,6 +15,7 @@ from unique_toolkit._common.endpoint_builder import (
|
|
15
15
|
ResponseType,
|
16
16
|
)
|
17
17
|
from unique_toolkit._common.endpoint_requestor import (
|
18
|
+
RequestContext,
|
18
19
|
RequestorType,
|
19
20
|
build_requestor,
|
20
21
|
)
|
@@ -163,7 +164,7 @@ class HumanVerificationManagerForApiCalling(
|
|
163
164
|
def call_api(
|
164
165
|
self,
|
165
166
|
*,
|
166
|
-
|
167
|
+
context: RequestContext,
|
167
168
|
path_params: PathParamsType,
|
168
169
|
payload: PayloadType,
|
169
170
|
) -> ResponseType:
|
@@ -171,7 +172,7 @@ class HumanVerificationManagerForApiCalling(
|
|
171
172
|
params.update(payload.model_dump())
|
172
173
|
|
173
174
|
response = self._requestor.request(
|
174
|
-
|
175
|
+
context=context,
|
175
176
|
**params,
|
176
177
|
)
|
177
178
|
return self._operation.handle_response(response)
|
@@ -2,7 +2,7 @@ from typing import Annotated, Any
|
|
2
2
|
|
3
3
|
from pydantic import BaseModel, Field
|
4
4
|
|
5
|
-
from unique_toolkit._common.default_language_model import
|
5
|
+
from unique_toolkit._common.default_language_model import DEFAULT_GPT_4o
|
6
6
|
from unique_toolkit._common.validators import LMI, get_LMI_default_field
|
7
7
|
from unique_toolkit.agentic.evaluation.context_relevancy.schema import (
|
8
8
|
StructuredOutputConfig,
|
@@ -25,11 +25,11 @@ class ChunkRelevancySortConfig(BaseModel):
|
|
25
25
|
description="The relevancy level order.",
|
26
26
|
)
|
27
27
|
language_model: LMI = get_LMI_default_field(
|
28
|
-
|
28
|
+
DEFAULT_GPT_4o,
|
29
29
|
description="The language model to use for the chunk relevancy sort.",
|
30
30
|
)
|
31
31
|
fallback_language_model: LMI = get_LMI_default_field(
|
32
|
-
|
32
|
+
DEFAULT_GPT_4o,
|
33
33
|
description="The language model to use as a fallback.",
|
34
34
|
)
|
35
35
|
additional_llm_options: dict[str, Any] = Field(
|
@@ -14,7 +14,6 @@ from unique_toolkit._common.chunk_relevancy_sorter.schemas import (
|
|
14
14
|
)
|
15
15
|
from unique_toolkit._common.chunk_relevancy_sorter.service import ChunkRelevancySorter
|
16
16
|
from unique_toolkit._common.default_language_model import (
|
17
|
-
DEFAULT_GPT_35_TURBO,
|
18
17
|
DEFAULT_GPT_4o,
|
19
18
|
)
|
20
19
|
from unique_toolkit.agentic.evaluation.context_relevancy.schema import (
|
@@ -60,7 +59,7 @@ def config():
|
|
60
59
|
relevancy_levels_to_consider=["high", "medium", "low"],
|
61
60
|
relevancy_level_order={"high": 0, "medium": 1, "low": 2},
|
62
61
|
language_model=LanguageModelInfo.from_name(DEFAULT_GPT_4o),
|
63
|
-
fallback_language_model=LanguageModelInfo.from_name(
|
62
|
+
fallback_language_model=LanguageModelInfo.from_name(DEFAULT_GPT_4o),
|
64
63
|
structured_output_config=StructuredOutputConfig(
|
65
64
|
enabled=False,
|
66
65
|
extract_fact_list=False,
|
@@ -0,0 +1,395 @@
|
|
1
|
+
from enum import StrEnum
|
2
|
+
from typing import Any, Callable, Generic, Protocol, TypeVar
|
3
|
+
from urllib.parse import urljoin, urlparse
|
4
|
+
|
5
|
+
from pydantic import BaseModel
|
6
|
+
from typing_extensions import ParamSpec
|
7
|
+
|
8
|
+
from unique_toolkit._common.endpoint_builder import (
|
9
|
+
ApiOperationProtocol,
|
10
|
+
HttpMethods,
|
11
|
+
PathParamsSpec,
|
12
|
+
PathParamsType,
|
13
|
+
PayloadParamSpec,
|
14
|
+
PayloadType,
|
15
|
+
ResponseType,
|
16
|
+
)
|
17
|
+
|
18
|
+
# Paramspecs
|
19
|
+
CombinedParamsSpec = ParamSpec("CombinedParamsSpec")
|
20
|
+
|
21
|
+
# Type variables
|
22
|
+
CombinedParamsType = TypeVar("CombinedParamsType", bound=BaseModel)
|
23
|
+
|
24
|
+
|
25
|
+
ResponseT_co = TypeVar("ResponseT_co", bound=BaseModel, covariant=True)
|
26
|
+
|
27
|
+
|
28
|
+
def _construct_full_url(base_url: str, url: str) -> str:
|
29
|
+
"""
|
30
|
+
Construct full URL from base_url and url.
|
31
|
+
If base_url is provided and url is absolute, strip the scheme/netloc from url.
|
32
|
+
"""
|
33
|
+
if not base_url:
|
34
|
+
return url
|
35
|
+
|
36
|
+
parsed = urlparse(url)
|
37
|
+
if parsed.scheme:
|
38
|
+
# URL is absolute, extract only path + query + fragment
|
39
|
+
url = parsed._replace(scheme="", netloc="").geturl()
|
40
|
+
|
41
|
+
return urljoin(base_url, url)
|
42
|
+
|
43
|
+
|
44
|
+
class RequestContext(BaseModel):
|
45
|
+
base_url: str = ""
|
46
|
+
headers: dict[str, str] | None = None
|
47
|
+
|
48
|
+
|
49
|
+
class EndpointRequestorProtocol(Protocol, Generic[CombinedParamsSpec, ResponseT_co]):
|
50
|
+
@classmethod
|
51
|
+
def request(
|
52
|
+
cls,
|
53
|
+
context: RequestContext,
|
54
|
+
*args: CombinedParamsSpec.args,
|
55
|
+
**kwargs: CombinedParamsSpec.kwargs,
|
56
|
+
) -> ResponseT_co: ...
|
57
|
+
|
58
|
+
@classmethod
|
59
|
+
async def request_async(
|
60
|
+
cls,
|
61
|
+
context: RequestContext,
|
62
|
+
*args: CombinedParamsSpec.args,
|
63
|
+
**kwargs: CombinedParamsSpec.kwargs,
|
64
|
+
) -> ResponseT_co: ...
|
65
|
+
|
66
|
+
|
67
|
+
def build_fake_requestor(
|
68
|
+
operation_type: type[
|
69
|
+
ApiOperationProtocol[
|
70
|
+
PathParamsSpec,
|
71
|
+
PathParamsType,
|
72
|
+
PayloadParamSpec,
|
73
|
+
PayloadType,
|
74
|
+
ResponseType,
|
75
|
+
]
|
76
|
+
],
|
77
|
+
combined_model: Callable[CombinedParamsSpec, CombinedParamsType],
|
78
|
+
return_value: dict[str, Any],
|
79
|
+
) -> type[EndpointRequestorProtocol[CombinedParamsSpec, ResponseType]]:
|
80
|
+
class FakeRequestor(EndpointRequestorProtocol):
|
81
|
+
_operation = operation_type
|
82
|
+
|
83
|
+
@classmethod
|
84
|
+
def request(
|
85
|
+
cls,
|
86
|
+
context: RequestContext,
|
87
|
+
*args: CombinedParamsSpec.args,
|
88
|
+
**kwargs: CombinedParamsSpec.kwargs,
|
89
|
+
) -> ResponseType:
|
90
|
+
try:
|
91
|
+
path_params, payload_model = cls._operation.models_from_combined(
|
92
|
+
combined=kwargs
|
93
|
+
)
|
94
|
+
except Exception as e:
|
95
|
+
raise ValueError(
|
96
|
+
f"Invalid parameters passed to combined model {combined_model.__name__}: {e}"
|
97
|
+
)
|
98
|
+
|
99
|
+
return cls._operation.handle_response(return_value)
|
100
|
+
|
101
|
+
@classmethod
|
102
|
+
async def request_async(
|
103
|
+
cls,
|
104
|
+
context: RequestContext,
|
105
|
+
headers: dict[str, str] | None = None,
|
106
|
+
*args: CombinedParamsSpec.args,
|
107
|
+
**kwargs: CombinedParamsSpec.kwargs,
|
108
|
+
) -> ResponseType:
|
109
|
+
raise NotImplementedError(
|
110
|
+
"Async request not implemented for fake requestor"
|
111
|
+
)
|
112
|
+
|
113
|
+
return FakeRequestor
|
114
|
+
|
115
|
+
|
116
|
+
def build_request_requestor(
|
117
|
+
operation_type: type[
|
118
|
+
ApiOperationProtocol[
|
119
|
+
PathParamsSpec,
|
120
|
+
PathParamsType,
|
121
|
+
PayloadParamSpec,
|
122
|
+
PayloadType,
|
123
|
+
ResponseType,
|
124
|
+
]
|
125
|
+
],
|
126
|
+
combined_model: Callable[CombinedParamsSpec, CombinedParamsType],
|
127
|
+
) -> type[EndpointRequestorProtocol[CombinedParamsSpec, ResponseType]]:
|
128
|
+
import requests
|
129
|
+
|
130
|
+
class RequestRequestor(EndpointRequestorProtocol):
|
131
|
+
_operation = operation_type
|
132
|
+
|
133
|
+
@classmethod
|
134
|
+
def request(
|
135
|
+
cls,
|
136
|
+
context: RequestContext,
|
137
|
+
*args: CombinedParamsSpec.args,
|
138
|
+
**kwargs: CombinedParamsSpec.kwargs,
|
139
|
+
) -> ResponseType:
|
140
|
+
# Create separate instances for path params and payload using endpoint helper
|
141
|
+
path_params, payload_model = cls._operation.models_from_combined(
|
142
|
+
combined=kwargs
|
143
|
+
)
|
144
|
+
|
145
|
+
url = cls._operation.create_url_from_model(path_params)
|
146
|
+
payload = cls._operation.create_payload_from_model(payload_model)
|
147
|
+
|
148
|
+
response = requests.request(
|
149
|
+
method=cls._operation.request_method(),
|
150
|
+
url=_construct_full_url(context.base_url, url),
|
151
|
+
headers=context.headers,
|
152
|
+
json=payload,
|
153
|
+
)
|
154
|
+
return cls._operation.handle_response(response.json())
|
155
|
+
|
156
|
+
@classmethod
|
157
|
+
async def request_async(
|
158
|
+
cls,
|
159
|
+
base_url: str = "",
|
160
|
+
headers: dict[str, str] | None = None,
|
161
|
+
*args: CombinedParamsSpec.args,
|
162
|
+
**kwargs: CombinedParamsSpec.kwargs,
|
163
|
+
) -> ResponseType:
|
164
|
+
raise NotImplementedError(
|
165
|
+
"Async request not implemented for request requestor"
|
166
|
+
)
|
167
|
+
|
168
|
+
return RequestRequestor
|
169
|
+
|
170
|
+
|
171
|
+
def build_httpx_requestor(
|
172
|
+
operation_type: type[
|
173
|
+
ApiOperationProtocol[
|
174
|
+
PathParamsSpec,
|
175
|
+
PathParamsType,
|
176
|
+
PayloadParamSpec,
|
177
|
+
PayloadType,
|
178
|
+
ResponseType,
|
179
|
+
]
|
180
|
+
],
|
181
|
+
combined_model: Callable[CombinedParamsSpec, CombinedParamsType],
|
182
|
+
) -> type[EndpointRequestorProtocol[CombinedParamsSpec, ResponseType]]:
|
183
|
+
import httpx
|
184
|
+
|
185
|
+
class HttpxRequestor(EndpointRequestorProtocol):
|
186
|
+
_operation = operation_type
|
187
|
+
|
188
|
+
@classmethod
|
189
|
+
def request(
|
190
|
+
cls,
|
191
|
+
context: RequestContext,
|
192
|
+
*args: CombinedParamsSpec.args,
|
193
|
+
**kwargs: CombinedParamsSpec.kwargs,
|
194
|
+
) -> ResponseType:
|
195
|
+
headers = context.headers or {}
|
196
|
+
|
197
|
+
path_params, payload_model = cls._operation.models_from_combined(
|
198
|
+
combined=kwargs
|
199
|
+
)
|
200
|
+
|
201
|
+
with httpx.Client() as client:
|
202
|
+
response = client.request(
|
203
|
+
method=cls._operation.request_method(),
|
204
|
+
url=_construct_full_url(
|
205
|
+
base_url=context.base_url,
|
206
|
+
url=cls._operation.create_url_from_model(path_params),
|
207
|
+
),
|
208
|
+
headers=headers,
|
209
|
+
json=cls._operation.create_payload_from_model(payload_model),
|
210
|
+
)
|
211
|
+
return cls._operation.handle_response(response.json())
|
212
|
+
|
213
|
+
@classmethod
|
214
|
+
async def request_async(
|
215
|
+
cls,
|
216
|
+
context: RequestContext,
|
217
|
+
*args: CombinedParamsSpec.args,
|
218
|
+
**kwargs: CombinedParamsSpec.kwargs,
|
219
|
+
) -> ResponseType:
|
220
|
+
headers = context.headers or {}
|
221
|
+
|
222
|
+
path_params, payload_model = cls._operation.models_from_combined(
|
223
|
+
combined=kwargs
|
224
|
+
)
|
225
|
+
|
226
|
+
async with httpx.AsyncClient() as client:
|
227
|
+
response = await client.request(
|
228
|
+
method=cls._operation.request_method(),
|
229
|
+
url=_construct_full_url(
|
230
|
+
base_url=context.base_url,
|
231
|
+
url=cls._operation.create_url_from_model(path_params),
|
232
|
+
),
|
233
|
+
headers=headers,
|
234
|
+
json=cls._operation.create_payload_from_model(payload_model),
|
235
|
+
)
|
236
|
+
return cls._operation.handle_response(response.json())
|
237
|
+
|
238
|
+
return HttpxRequestor
|
239
|
+
|
240
|
+
|
241
|
+
def build_aiohttp_requestor(
|
242
|
+
operation_type: type[
|
243
|
+
ApiOperationProtocol[
|
244
|
+
PathParamsSpec,
|
245
|
+
PathParamsType,
|
246
|
+
PayloadParamSpec,
|
247
|
+
PayloadType,
|
248
|
+
ResponseType,
|
249
|
+
]
|
250
|
+
],
|
251
|
+
combined_model: Callable[CombinedParamsSpec, CombinedParamsType],
|
252
|
+
) -> type[EndpointRequestorProtocol[CombinedParamsSpec, ResponseType]]:
|
253
|
+
import aiohttp
|
254
|
+
|
255
|
+
class AiohttpRequestor(EndpointRequestorProtocol):
|
256
|
+
_operation = operation_type
|
257
|
+
|
258
|
+
@classmethod
|
259
|
+
def request(
|
260
|
+
cls,
|
261
|
+
context: RequestContext,
|
262
|
+
*args: CombinedParamsSpec.args,
|
263
|
+
**kwargs: CombinedParamsSpec.kwargs,
|
264
|
+
) -> ResponseType:
|
265
|
+
raise NotImplementedError(
|
266
|
+
"Sync request not implemented for aiohttp requestor"
|
267
|
+
)
|
268
|
+
|
269
|
+
@classmethod
|
270
|
+
async def request_async(
|
271
|
+
cls,
|
272
|
+
context: RequestContext,
|
273
|
+
headers: dict[str, str] | None = None,
|
274
|
+
*args: CombinedParamsSpec.args,
|
275
|
+
**kwargs: CombinedParamsSpec.kwargs,
|
276
|
+
) -> ResponseType:
|
277
|
+
headers = context.headers or {}
|
278
|
+
|
279
|
+
path_params, payload_model = cls._operation.models_from_combined(
|
280
|
+
combined=kwargs
|
281
|
+
)
|
282
|
+
|
283
|
+
async with aiohttp.ClientSession() as session:
|
284
|
+
response = await session.request(
|
285
|
+
method=cls._operation.request_method(),
|
286
|
+
url=_construct_full_url(
|
287
|
+
base_url=context.base_url,
|
288
|
+
url=cls._operation.create_url_from_model(path_params),
|
289
|
+
),
|
290
|
+
headers=headers,
|
291
|
+
json=cls._operation.create_payload_from_model(payload_model),
|
292
|
+
)
|
293
|
+
return cls._operation.handle_response(await response.json())
|
294
|
+
|
295
|
+
return AiohttpRequestor
|
296
|
+
|
297
|
+
|
298
|
+
class RequestorType(StrEnum):
|
299
|
+
REQUESTS = "requests"
|
300
|
+
FAKE = "fake"
|
301
|
+
HTTPIX = "httpx"
|
302
|
+
AIOHTTP = "aiohttp"
|
303
|
+
|
304
|
+
|
305
|
+
def build_requestor(
|
306
|
+
requestor_type: RequestorType,
|
307
|
+
operation_type: type[
|
308
|
+
ApiOperationProtocol[
|
309
|
+
PathParamsSpec,
|
310
|
+
PathParamsType,
|
311
|
+
PayloadParamSpec,
|
312
|
+
PayloadType,
|
313
|
+
ResponseType,
|
314
|
+
]
|
315
|
+
],
|
316
|
+
combined_model: Callable[CombinedParamsSpec, CombinedParamsType],
|
317
|
+
return_value: dict[str, Any] | None = None,
|
318
|
+
**kwargs: Any,
|
319
|
+
) -> type[EndpointRequestorProtocol]:
|
320
|
+
match requestor_type:
|
321
|
+
case RequestorType.REQUESTS:
|
322
|
+
return build_request_requestor(
|
323
|
+
operation_type=operation_type, combined_model=combined_model
|
324
|
+
)
|
325
|
+
case RequestorType.FAKE:
|
326
|
+
if return_value is None:
|
327
|
+
raise ValueError("return_value is required for fake requestor")
|
328
|
+
return build_fake_requestor(
|
329
|
+
operation_type=operation_type,
|
330
|
+
combined_model=combined_model,
|
331
|
+
return_value=return_value,
|
332
|
+
)
|
333
|
+
case RequestorType.HTTPIX:
|
334
|
+
return build_httpx_requestor(
|
335
|
+
operation_type=operation_type, combined_model=combined_model
|
336
|
+
)
|
337
|
+
case RequestorType.AIOHTTP:
|
338
|
+
return build_aiohttp_requestor(
|
339
|
+
operation_type=operation_type, combined_model=combined_model
|
340
|
+
)
|
341
|
+
|
342
|
+
|
343
|
+
if __name__ == "__main__":
|
344
|
+
from string import Template
|
345
|
+
|
346
|
+
from unique_toolkit._common.endpoint_builder import build_api_operation
|
347
|
+
|
348
|
+
class GetUserPathParams(BaseModel):
|
349
|
+
user_id: int
|
350
|
+
|
351
|
+
class GetUserRequestBody(BaseModel):
|
352
|
+
include_profile: bool = False
|
353
|
+
|
354
|
+
class UserResponse(BaseModel):
|
355
|
+
id: int
|
356
|
+
name: str
|
357
|
+
|
358
|
+
class CombinedParams(GetUserPathParams, GetUserRequestBody):
|
359
|
+
pass
|
360
|
+
|
361
|
+
UserEndpoint = build_api_operation(
|
362
|
+
method=HttpMethods.GET,
|
363
|
+
url_template=Template("https://api.example.com/users/{user_id}"),
|
364
|
+
path_params_constructor=GetUserPathParams,
|
365
|
+
payload_constructor=GetUserRequestBody,
|
366
|
+
response_model_type=UserResponse,
|
367
|
+
)
|
368
|
+
|
369
|
+
FakeUserRequestor = build_fake_requestor(
|
370
|
+
operation_type=UserEndpoint,
|
371
|
+
combined_model=CombinedParams,
|
372
|
+
return_value={"id": 100, "name": "John Doe"},
|
373
|
+
)
|
374
|
+
|
375
|
+
# Note that the return value is a pydantic UserResponse object
|
376
|
+
response = FakeUserRequestor().request(
|
377
|
+
context=RequestContext(headers={"a": "b"}),
|
378
|
+
user_id=123,
|
379
|
+
include_profile=True,
|
380
|
+
)
|
381
|
+
|
382
|
+
RequestRequestor = build_request_requestor(
|
383
|
+
operation_type=UserEndpoint,
|
384
|
+
combined_model=CombinedParams,
|
385
|
+
)
|
386
|
+
|
387
|
+
# Check type hints
|
388
|
+
response = RequestRequestor().request(
|
389
|
+
context=RequestContext(headers={"a": "b"}), user_id=123, include_profile=True
|
390
|
+
)
|
391
|
+
|
392
|
+
print(response.model_dump())
|
393
|
+
print(response.model_json_schema())
|
394
|
+
print(response.id)
|
395
|
+
print(response.name)
|
@@ -3,8 +3,9 @@ from typing import Any
|
|
3
3
|
from humps import camelize
|
4
4
|
from pydantic import BaseModel, ConfigDict, Field
|
5
5
|
|
6
|
+
from unique_toolkit._common.default_language_model import DEFAULT_GPT_4o
|
6
7
|
from unique_toolkit._common.validators import LMI
|
7
|
-
from unique_toolkit.language_model.infos import LanguageModelInfo
|
8
|
+
from unique_toolkit.language_model.infos import LanguageModelInfo
|
8
9
|
|
9
10
|
from .schemas import (
|
10
11
|
EvaluationMetricName,
|
@@ -24,7 +25,7 @@ class EvaluationMetricConfig(BaseModel):
|
|
24
25
|
enabled: bool = False
|
25
26
|
name: EvaluationMetricName
|
26
27
|
language_model: LMI = LanguageModelInfo.from_name(
|
27
|
-
|
28
|
+
DEFAULT_GPT_4o,
|
28
29
|
)
|
29
30
|
additional_llm_options: dict[str, Any] = Field(
|
30
31
|
default={},
|
@@ -4,7 +4,7 @@ from typing import overload
|
|
4
4
|
from pydantic import BaseModel, ValidationError
|
5
5
|
from typing_extensions import deprecated
|
6
6
|
|
7
|
-
from unique_toolkit._common.default_language_model import
|
7
|
+
from unique_toolkit._common.default_language_model import DEFAULT_GPT_4o
|
8
8
|
from unique_toolkit._common.validate_required_values import (
|
9
9
|
validate_required_values,
|
10
10
|
)
|
@@ -49,7 +49,7 @@ USER_MSG_KEY = "userPrompt"
|
|
49
49
|
default_config = EvaluationMetricConfig(
|
50
50
|
enabled=False,
|
51
51
|
name=EvaluationMetricName.CONTEXT_RELEVANCY,
|
52
|
-
language_model=LanguageModelInfo.from_name(
|
52
|
+
language_model=LanguageModelInfo.from_name(DEFAULT_GPT_4o),
|
53
53
|
custom_prompts={
|
54
54
|
SYSTEM_MSG_KEY: CONTEXT_RELEVANCY_METRIC_SYSTEM_MSG,
|
55
55
|
USER_MSG_KEY: CONTEXT_RELEVANCY_METRIC_USER_MSG,
|
@@ -3,6 +3,7 @@ from typing import Annotated, Awaitable, Callable
|
|
3
3
|
|
4
4
|
from pydantic import BaseModel, Field
|
5
5
|
|
6
|
+
from unique_toolkit._common.default_language_model import DEFAULT_GPT_4o
|
6
7
|
from unique_toolkit._common.validators import LMI
|
7
8
|
from unique_toolkit.agentic.history_manager.loop_token_reducer import LoopTokenReducer
|
8
9
|
from unique_toolkit.agentic.history_manager.utils import transform_chunks_to_string
|
@@ -10,7 +11,7 @@ from unique_toolkit.agentic.reference_manager.reference_manager import Reference
|
|
10
11
|
from unique_toolkit.agentic.tools.config import get_configuration_dict
|
11
12
|
from unique_toolkit.agentic.tools.schemas import ToolCallResponse
|
12
13
|
from unique_toolkit.app.schemas import ChatEvent
|
13
|
-
from unique_toolkit.language_model.infos import LanguageModelInfo
|
14
|
+
from unique_toolkit.language_model.infos import LanguageModelInfo
|
14
15
|
from unique_toolkit.language_model.schemas import (
|
15
16
|
LanguageModelAssistantMessage,
|
16
17
|
LanguageModelFunction,
|
@@ -61,9 +62,7 @@ class HistoryManagerConfig(BaseModel):
|
|
61
62
|
description="The fraction of the max input tokens that will be reserved for the history.",
|
62
63
|
)
|
63
64
|
|
64
|
-
language_model: LMI = LanguageModelInfo.from_name(
|
65
|
-
LanguageModelName.AZURE_GPT_4o_2024_1120
|
66
|
-
)
|
65
|
+
language_model: LMI = LanguageModelInfo.from_name(DEFAULT_GPT_4o)
|
67
66
|
|
68
67
|
@property
|
69
68
|
def max_history_tokens(self) -> int:
|
@@ -1,6 +0,0 @@
|
|
1
|
-
from unique_toolkit.language_model.infos import LanguageModelName
|
2
|
-
|
3
|
-
DEFAULT_GPT_35_TURBO = LanguageModelName.AZURE_GPT_35_TURBO_0125
|
4
|
-
DEFAULT_GPT_4o = LanguageModelName.AZURE_GPT_4o_2024_1120
|
5
|
-
DEFAULT_GPT_4o_STRUCTURED_OUTPUT = LanguageModelName.AZURE_GPT_4o_2024_0806
|
6
|
-
DEFAULT_GPT_4o_MINI = LanguageModelName.AZURE_GPT_4o_MINI_2024_0718
|