unique_toolkit 0.8.7__tar.gz → 0.8.9__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-0.8.7 → unique_toolkit-0.8.9}/CHANGELOG.md +6 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/PKG-INFO +7 -1
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/pyproject.toml +1 -1
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/chat/schemas.py +48 -2
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/chat/service.py +3 -3
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/language_model/infos.py +12 -4
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/language_model/schemas.py +30 -4
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/LICENSE +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/README.md +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/__init__.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/_common/_base_service.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/_common/_time_utils.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/_common/exception.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/_common/validate_required_values.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/_common/validators.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/app/__init__.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/app/dev_util.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/app/init_logging.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/app/init_sdk.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/app/performance/async_tasks.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/app/performance/async_wrapper.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/app/schemas.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/app/unique_settings.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/app/verification.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/chat/__init__.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/chat/constants.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/chat/functions.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/chat/state.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/chat/utils.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/content/__init__.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/content/constants.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/content/functions.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/content/schemas.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/content/service.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/content/utils.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/embedding/__init__.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/embedding/constants.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/embedding/functions.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/embedding/schemas.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/embedding/service.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/embedding/utils.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/__init__.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/config.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/constants.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/context_relevancy/constants.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/context_relevancy/prompts.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/context_relevancy/service.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/context_relevancy/utils.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/exception.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/hallucination/constants.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/hallucination/prompts.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/hallucination/service.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/hallucination/utils.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/output_parser.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/schemas.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/framework_utilities/langchain/client.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/framework_utilities/langchain/history.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/framework_utilities/openai/client.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/framework_utilities/openai/message_builder.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/framework_utilities/utils.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/language_model/__init__.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/language_model/builder.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/language_model/constants.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/language_model/functions.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/language_model/prompt.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/language_model/reference.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/language_model/service.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/language_model/utils.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/protocols/support.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/reference_manager/reference_manager.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/short_term_memory/__init__.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/short_term_memory/constants.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/short_term_memory/functions.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/short_term_memory/schemas.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/short_term_memory/service.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/smart_rules/__init__.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/smart_rules/compile.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/agent_chunks_handler.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/config.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/factory.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/schemas.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/test/test_tool_progress_reporter.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/tool.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/tool_manager.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/tool_progress_reporter.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/utils/execution/execution.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/utils/source_handling/schema.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/utils/source_handling/source_formatting.py +0 -0
- {unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/utils/source_handling/tests/test_source_formatting.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
|
+
## [0.8.9] - 2025-08-15
|
|
9
|
+
- Reduce input token limits for `ANTHROPIC_CLAUDE_3_7_SONNET_THINKING`, `ANTHROPIC_CLAUDE_3_7_SONNET`, `ANTHROPIC_CLAUDE_OPUS_4` and `ANTHROPIC_CLAUDE_SONNET_4` to 180_000 from 200_000
|
|
10
|
+
|
|
11
|
+
## [0.8.8] - 2025-08-11
|
|
12
|
+
- Make chat service openai stream response openai compatible
|
|
13
|
+
- Make `ChatMessage` openai compatible
|
|
8
14
|
|
|
9
15
|
## [0.8.7] - 2025-08-11
|
|
10
16
|
- Make chat service openai compatible
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unique_toolkit
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.9
|
|
4
4
|
Summary:
|
|
5
5
|
License: Proprietary
|
|
6
6
|
Author: Martin Fadler
|
|
@@ -114,6 +114,12 @@ All notable changes to this project will be documented in this file.
|
|
|
114
114
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
115
115
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
116
116
|
|
|
117
|
+
## [0.8.9] - 2025-08-15
|
|
118
|
+
- Reduce input token limits for `ANTHROPIC_CLAUDE_3_7_SONNET_THINKING`, `ANTHROPIC_CLAUDE_3_7_SONNET`, `ANTHROPIC_CLAUDE_OPUS_4` and `ANTHROPIC_CLAUDE_SONNET_4` to 180_000 from 200_000
|
|
119
|
+
|
|
120
|
+
## [0.8.8] - 2025-08-11
|
|
121
|
+
- Make chat service openai stream response openai compatible
|
|
122
|
+
- Make `ChatMessage` openai compatible
|
|
117
123
|
|
|
118
124
|
## [0.8.7] - 2025-08-11
|
|
119
125
|
- Make chat service openai compatible
|
|
@@ -2,6 +2,16 @@ from datetime import datetime
|
|
|
2
2
|
from enum import StrEnum
|
|
3
3
|
|
|
4
4
|
from humps import camelize
|
|
5
|
+
from openai.types.chat import (
|
|
6
|
+
ChatCompletionAssistantMessageParam,
|
|
7
|
+
ChatCompletionUserMessageParam,
|
|
8
|
+
)
|
|
9
|
+
from openai.types.chat.chat_completion_message_function_tool_call_param import (
|
|
10
|
+
ChatCompletionMessageFunctionToolCallParam,
|
|
11
|
+
)
|
|
12
|
+
from openai.types.chat.chat_completion_message_function_tool_call_param import (
|
|
13
|
+
Function as OpenAIFunction,
|
|
14
|
+
)
|
|
5
15
|
from pydantic import (
|
|
6
16
|
BaseModel,
|
|
7
17
|
ConfigDict,
|
|
@@ -14,14 +24,15 @@ from unique_toolkit.content.schemas import ContentReference
|
|
|
14
24
|
|
|
15
25
|
# set config to convert camelCase to snake_case
|
|
16
26
|
model_config = ConfigDict(
|
|
17
|
-
alias_generator=camelize,
|
|
27
|
+
alias_generator=camelize,
|
|
28
|
+
populate_by_name=True,
|
|
18
29
|
)
|
|
19
30
|
|
|
20
31
|
|
|
21
32
|
class ChatMessageRole(StrEnum):
|
|
22
33
|
USER = "user"
|
|
23
34
|
ASSISTANT = "assistant"
|
|
24
|
-
TOOL = "tool"
|
|
35
|
+
TOOL = "tool" # TODO: Unused according @unique-fabian. To be removed in separate PR
|
|
25
36
|
|
|
26
37
|
|
|
27
38
|
class Function(BaseModel):
|
|
@@ -30,6 +41,12 @@ class Function(BaseModel):
|
|
|
30
41
|
name: str
|
|
31
42
|
arguments: str
|
|
32
43
|
|
|
44
|
+
def to_openai(self) -> OpenAIFunction:
|
|
45
|
+
return OpenAIFunction(
|
|
46
|
+
arguments=self.arguments,
|
|
47
|
+
name=self.name,
|
|
48
|
+
)
|
|
49
|
+
|
|
33
50
|
|
|
34
51
|
class ToolCall(BaseModel):
|
|
35
52
|
model_config = model_config
|
|
@@ -38,8 +55,16 @@ class ToolCall(BaseModel):
|
|
|
38
55
|
type: str
|
|
39
56
|
function: Function
|
|
40
57
|
|
|
58
|
+
def to_openai_param(self) -> ChatCompletionMessageFunctionToolCallParam:
|
|
59
|
+
return ChatCompletionMessageFunctionToolCallParam(
|
|
60
|
+
id=self.id,
|
|
61
|
+
function=self.function.to_openai(),
|
|
62
|
+
type="function",
|
|
63
|
+
)
|
|
64
|
+
|
|
41
65
|
|
|
42
66
|
class ChatMessage(BaseModel):
|
|
67
|
+
# TODO: The below seems not to be True anymore @irina-unique. To be checked in separate PR
|
|
43
68
|
# This model should strictly meets https://github.com/Unique-AG/monorepo/blob/master/node/apps/node-chat/src/public-api/2023-12-06/dtos/message/public-message.dto.ts
|
|
44
69
|
model_config = model_config
|
|
45
70
|
|
|
@@ -71,6 +96,27 @@ class ChatMessage(BaseModel):
|
|
|
71
96
|
raise ValueError("tool_call_ids is required when role is 'tool'")
|
|
72
97
|
return self
|
|
73
98
|
|
|
99
|
+
def to_openai_param(self):
|
|
100
|
+
match self.role:
|
|
101
|
+
case ChatMessageRole.USER:
|
|
102
|
+
return ChatCompletionUserMessageParam(
|
|
103
|
+
role="user",
|
|
104
|
+
content=self.content or "",
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
case ChatMessageRole.ASSISTANT:
|
|
108
|
+
return ChatCompletionAssistantMessageParam(
|
|
109
|
+
role="assistant",
|
|
110
|
+
audio=None,
|
|
111
|
+
content=self.content or "",
|
|
112
|
+
function_call=None,
|
|
113
|
+
refusal=None,
|
|
114
|
+
tool_calls=[t.to_openai_param() for t in self.tool_calls or []],
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
case ChatMessageRole.TOOL:
|
|
118
|
+
raise NotImplementedError
|
|
119
|
+
|
|
74
120
|
|
|
75
121
|
class ChatMessageAssessmentStatus(StrEnum):
|
|
76
122
|
PENDING = "PENDING"
|
|
@@ -329,9 +329,9 @@ class ChatService:
|
|
|
329
329
|
|
|
330
330
|
Args:
|
|
331
331
|
content (str): The new content for the message.
|
|
332
|
-
references (list[ContentReference]): list of ContentReference objects.
|
|
333
|
-
debug_info (dict[str, Any]]]): Debug information.
|
|
334
|
-
message_id (str, optional): The message ID
|
|
332
|
+
references (list[ContentReference]): list of ContentReference objects.
|
|
333
|
+
debug_info (dict[str, Any]]]): Debug information.
|
|
334
|
+
message_id (str, optional): The message ID, if not specified the last user message is edited.
|
|
335
335
|
set_completed_at (Optional[bool]): Whether to set the completedAt field with the current date time. Defaults to False.
|
|
336
336
|
|
|
337
337
|
Returns:
|
|
@@ -507,7 +507,9 @@ class LanguageModelInfo(BaseModel):
|
|
|
507
507
|
version="claude-3-7-sonnet",
|
|
508
508
|
encoder_name=EncoderName.O200K_BASE, # TODO: Update encoder with litellm
|
|
509
509
|
token_limits=LanguageModelTokenLimits(
|
|
510
|
-
|
|
510
|
+
# Input limit is 200_000, we leave 20_000 tokens as buffer due to tokenizer mismatch
|
|
511
|
+
token_limit_input=180_000,
|
|
512
|
+
token_limit_output=128_000,
|
|
511
513
|
),
|
|
512
514
|
info_cutoff_at=date(2024, 10, 31),
|
|
513
515
|
published_at=date(2025, 2, 24),
|
|
@@ -525,7 +527,9 @@ class LanguageModelInfo(BaseModel):
|
|
|
525
527
|
version="claude-3-7-sonnet-thinking",
|
|
526
528
|
encoder_name=EncoderName.O200K_BASE, # TODO: Update encoder with litellm
|
|
527
529
|
token_limits=LanguageModelTokenLimits(
|
|
528
|
-
|
|
530
|
+
# Input limit is 200_000, we leave 20_000 tokens as buffer due to tokenizer mismatch
|
|
531
|
+
token_limit_input=180_000,
|
|
532
|
+
token_limit_output=128_000,
|
|
529
533
|
),
|
|
530
534
|
info_cutoff_at=date(2024, 10, 31),
|
|
531
535
|
published_at=date(2025, 2, 24),
|
|
@@ -543,7 +547,9 @@ class LanguageModelInfo(BaseModel):
|
|
|
543
547
|
version="claude-sonnet-4",
|
|
544
548
|
encoder_name=EncoderName.O200K_BASE, # TODO: Update encoder with litellm
|
|
545
549
|
token_limits=LanguageModelTokenLimits(
|
|
546
|
-
|
|
550
|
+
# Input limit is 200_000, we leave 20_000 tokens as buffer due to tokenizer mismatch
|
|
551
|
+
token_limit_input=180_000,
|
|
552
|
+
token_limit_output=64_000,
|
|
547
553
|
),
|
|
548
554
|
info_cutoff_at=date(2025, 3, 1),
|
|
549
555
|
published_at=date(2025, 5, 1),
|
|
@@ -561,7 +567,9 @@ class LanguageModelInfo(BaseModel):
|
|
|
561
567
|
version="claude-opus-4",
|
|
562
568
|
encoder_name=EncoderName.O200K_BASE, # TODO: Update encoder with litellm
|
|
563
569
|
token_limits=LanguageModelTokenLimits(
|
|
564
|
-
|
|
570
|
+
# Input limit is 200_000, we leave 20_000 tokens as buffer due to tokenizer mismatch
|
|
571
|
+
token_limit_input=180_000,
|
|
572
|
+
token_limit_output=32_000,
|
|
565
573
|
),
|
|
566
574
|
info_cutoff_at=date(2025, 3, 1),
|
|
567
575
|
published_at=date(2025, 5, 1),
|
|
@@ -5,6 +5,11 @@ from typing import Any, Self
|
|
|
5
5
|
from uuid import uuid4
|
|
6
6
|
|
|
7
7
|
from humps import camelize
|
|
8
|
+
from openai.types.chat import ChatCompletionAssistantMessageParam
|
|
9
|
+
from openai.types.chat.chat_completion_message_function_tool_call_param import (
|
|
10
|
+
ChatCompletionMessageFunctionToolCallParam,
|
|
11
|
+
Function,
|
|
12
|
+
)
|
|
8
13
|
from openai.types.chat.chat_completion_tool_param import ChatCompletionToolParam
|
|
9
14
|
from openai.types.shared_params.function_definition import FunctionDefinition
|
|
10
15
|
from pydantic import (
|
|
@@ -88,9 +93,7 @@ class LanguageModelFunction(BaseModel):
|
|
|
88
93
|
return seralization
|
|
89
94
|
|
|
90
95
|
def __eq__(self, other: Self) -> bool:
|
|
91
|
-
"""
|
|
92
|
-
Compare two tool calls based on name and arguments.
|
|
93
|
-
"""
|
|
96
|
+
"""Compare two tool calls based on name and arguments."""
|
|
94
97
|
if not isinstance(other, LanguageModelFunction):
|
|
95
98
|
return False
|
|
96
99
|
|
|
@@ -105,6 +108,19 @@ class LanguageModelFunction(BaseModel):
|
|
|
105
108
|
|
|
106
109
|
return True
|
|
107
110
|
|
|
111
|
+
def to_openai_param(self) -> ChatCompletionMessageFunctionToolCallParam:
|
|
112
|
+
arguments = ""
|
|
113
|
+
if isinstance(self.arguments, dict):
|
|
114
|
+
arguments = json.dumps(self.arguments)
|
|
115
|
+
elif isinstance(self.arguments, str):
|
|
116
|
+
arguments = self.arguments
|
|
117
|
+
|
|
118
|
+
return ChatCompletionMessageFunctionToolCallParam(
|
|
119
|
+
type="function",
|
|
120
|
+
id=self.id or "unknown_id",
|
|
121
|
+
function=Function(name=self.name, arguments=arguments),
|
|
122
|
+
)
|
|
123
|
+
|
|
108
124
|
|
|
109
125
|
# This is tailored to the unique backend
|
|
110
126
|
class LanguageModelStreamResponse(BaseModel):
|
|
@@ -113,6 +129,16 @@ class LanguageModelStreamResponse(BaseModel):
|
|
|
113
129
|
message: LanguageModelStreamResponseMessage
|
|
114
130
|
tool_calls: list[LanguageModelFunction] | None = None
|
|
115
131
|
|
|
132
|
+
def to_openai_param(self) -> ChatCompletionAssistantMessageParam:
|
|
133
|
+
return ChatCompletionAssistantMessageParam(
|
|
134
|
+
role="assistant",
|
|
135
|
+
audio=None,
|
|
136
|
+
content=self.message.text,
|
|
137
|
+
function_call=None,
|
|
138
|
+
refusal=None,
|
|
139
|
+
tool_calls=[t.to_openai_param() for t in self.tool_calls or []],
|
|
140
|
+
)
|
|
141
|
+
|
|
116
142
|
|
|
117
143
|
class LanguageModelFunctionCall(BaseModel):
|
|
118
144
|
model_config = model_config
|
|
@@ -126,7 +152,7 @@ class LanguageModelFunctionCall(BaseModel):
|
|
|
126
152
|
@staticmethod
|
|
127
153
|
def create_assistant_message_from_tool_calls(
|
|
128
154
|
tool_calls: list[LanguageModelFunction],
|
|
129
|
-
):
|
|
155
|
+
) -> "LanguageModelAssistantMessage":
|
|
130
156
|
assistant_message = LanguageModelAssistantMessage(
|
|
131
157
|
content="",
|
|
132
158
|
tool_calls=[
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/_common/validate_required_values.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/app/performance/async_wrapper.py
RENAMED
|
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
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/context_relevancy/prompts.py
RENAMED
|
File without changes
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/context_relevancy/service.py
RENAMED
|
File without changes
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/context_relevancy/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/hallucination/constants.py
RENAMED
|
File without changes
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/hallucination/prompts.py
RENAMED
|
File without changes
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/hallucination/service.py
RENAMED
|
File without changes
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/evaluators/hallucination/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/framework_utilities/langchain/client.py
RENAMED
|
File without changes
|
|
File without changes
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/framework_utilities/openai/client.py
RENAMED
|
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
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/reference_manager/reference_manager.py
RENAMED
|
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
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/tool_progress_reporter.py
RENAMED
|
File without changes
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/utils/execution/execution.py
RENAMED
|
File without changes
|
{unique_toolkit-0.8.7 → unique_toolkit-0.8.9}/unique_toolkit/tools/utils/source_handling/schema.py
RENAMED
|
File without changes
|
|
File without changes
|