unique_toolkit 1.8.1__py3-none-any.whl → 1.23.0__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_toolkit might be problematic. Click here for more details.
- unique_toolkit/__init__.py +20 -0
- unique_toolkit/_common/api_calling/human_verification_manager.py +121 -28
- unique_toolkit/_common/chunk_relevancy_sorter/config.py +3 -3
- unique_toolkit/_common/chunk_relevancy_sorter/tests/test_service.py +2 -5
- unique_toolkit/_common/default_language_model.py +9 -3
- unique_toolkit/_common/docx_generator/__init__.py +7 -0
- unique_toolkit/_common/docx_generator/config.py +12 -0
- unique_toolkit/_common/docx_generator/schemas.py +80 -0
- unique_toolkit/_common/docx_generator/service.py +252 -0
- unique_toolkit/_common/docx_generator/template/Doc Template.docx +0 -0
- unique_toolkit/_common/endpoint_builder.py +138 -117
- unique_toolkit/_common/endpoint_requestor.py +240 -14
- unique_toolkit/_common/exception.py +20 -0
- unique_toolkit/_common/feature_flags/schema.py +1 -5
- unique_toolkit/_common/referencing.py +53 -0
- unique_toolkit/_common/string_utilities.py +52 -1
- unique_toolkit/_common/tests/test_referencing.py +521 -0
- unique_toolkit/_common/tests/test_string_utilities.py +506 -0
- unique_toolkit/_common/utils/files.py +43 -0
- unique_toolkit/agentic/debug_info_manager/debug_info_manager.py +16 -6
- unique_toolkit/agentic/debug_info_manager/test/test_debug_info_manager.py +278 -0
- unique_toolkit/agentic/evaluation/config.py +3 -2
- unique_toolkit/agentic/evaluation/context_relevancy/service.py +2 -2
- unique_toolkit/agentic/evaluation/evaluation_manager.py +9 -5
- unique_toolkit/agentic/evaluation/hallucination/constants.py +1 -1
- unique_toolkit/agentic/evaluation/hallucination/hallucination_evaluation.py +26 -3
- unique_toolkit/agentic/history_manager/history_manager.py +14 -11
- unique_toolkit/agentic/history_manager/loop_token_reducer.py +3 -4
- unique_toolkit/agentic/history_manager/utils.py +10 -87
- unique_toolkit/agentic/postprocessor/postprocessor_manager.py +107 -16
- unique_toolkit/agentic/reference_manager/reference_manager.py +1 -1
- unique_toolkit/agentic/responses_api/__init__.py +19 -0
- unique_toolkit/agentic/responses_api/postprocessors/code_display.py +63 -0
- unique_toolkit/agentic/responses_api/postprocessors/generated_files.py +145 -0
- unique_toolkit/agentic/responses_api/stream_handler.py +15 -0
- unique_toolkit/agentic/tools/a2a/__init__.py +18 -2
- unique_toolkit/agentic/tools/a2a/evaluation/__init__.py +2 -0
- unique_toolkit/agentic/tools/a2a/evaluation/_utils.py +3 -3
- unique_toolkit/agentic/tools/a2a/evaluation/config.py +1 -1
- unique_toolkit/agentic/tools/a2a/evaluation/evaluator.py +143 -91
- unique_toolkit/agentic/tools/a2a/manager.py +7 -1
- unique_toolkit/agentic/tools/a2a/postprocessing/__init__.py +11 -3
- unique_toolkit/agentic/tools/a2a/postprocessing/_display_utils.py +185 -0
- unique_toolkit/agentic/tools/a2a/postprocessing/_ref_utils.py +73 -0
- unique_toolkit/agentic/tools/a2a/postprocessing/config.py +21 -0
- unique_toolkit/agentic/tools/a2a/postprocessing/display.py +180 -0
- unique_toolkit/agentic/tools/a2a/postprocessing/references.py +101 -0
- unique_toolkit/agentic/tools/a2a/postprocessing/test/test_display_utils.py +1335 -0
- unique_toolkit/agentic/tools/a2a/postprocessing/test/test_ref_utils.py +603 -0
- unique_toolkit/agentic/tools/a2a/prompts.py +46 -0
- unique_toolkit/agentic/tools/a2a/response_watcher/__init__.py +6 -0
- unique_toolkit/agentic/tools/a2a/response_watcher/service.py +91 -0
- unique_toolkit/agentic/tools/a2a/tool/config.py +15 -5
- unique_toolkit/agentic/tools/a2a/tool/service.py +69 -36
- unique_toolkit/agentic/tools/config.py +16 -2
- unique_toolkit/agentic/tools/factory.py +4 -0
- unique_toolkit/agentic/tools/mcp/tool_wrapper.py +7 -35
- unique_toolkit/agentic/tools/openai_builtin/__init__.py +11 -0
- unique_toolkit/agentic/tools/openai_builtin/base.py +30 -0
- unique_toolkit/agentic/tools/openai_builtin/code_interpreter/__init__.py +8 -0
- unique_toolkit/agentic/tools/openai_builtin/code_interpreter/config.py +57 -0
- unique_toolkit/agentic/tools/openai_builtin/code_interpreter/service.py +230 -0
- unique_toolkit/agentic/tools/openai_builtin/manager.py +62 -0
- unique_toolkit/agentic/tools/test/test_mcp_manager.py +95 -7
- unique_toolkit/agentic/tools/test/test_tool_progress_reporter.py +240 -0
- unique_toolkit/agentic/tools/tool.py +0 -11
- unique_toolkit/agentic/tools/tool_manager.py +337 -122
- unique_toolkit/agentic/tools/tool_progress_reporter.py +81 -15
- unique_toolkit/agentic/tools/utils/__init__.py +18 -0
- unique_toolkit/agentic/tools/utils/execution/execution.py +8 -4
- unique_toolkit/agentic/tools/utils/source_handling/schema.py +1 -1
- unique_toolkit/chat/__init__.py +8 -1
- unique_toolkit/chat/deprecated/service.py +232 -0
- unique_toolkit/chat/functions.py +54 -40
- unique_toolkit/chat/rendering.py +34 -0
- unique_toolkit/chat/responses_api.py +461 -0
- unique_toolkit/chat/schemas.py +1 -1
- unique_toolkit/chat/service.py +96 -1569
- unique_toolkit/content/functions.py +116 -1
- unique_toolkit/content/schemas.py +59 -0
- unique_toolkit/content/service.py +5 -37
- unique_toolkit/content/smart_rules.py +301 -0
- unique_toolkit/framework_utilities/langchain/client.py +27 -3
- unique_toolkit/framework_utilities/openai/client.py +12 -1
- unique_toolkit/framework_utilities/openai/message_builder.py +85 -1
- unique_toolkit/language_model/default_language_model.py +3 -0
- unique_toolkit/language_model/functions.py +25 -9
- unique_toolkit/language_model/infos.py +72 -4
- unique_toolkit/language_model/schemas.py +246 -40
- unique_toolkit/protocols/support.py +91 -9
- unique_toolkit/services/__init__.py +7 -0
- unique_toolkit/services/chat_service.py +1630 -0
- unique_toolkit/services/knowledge_base.py +861 -0
- unique_toolkit/smart_rules/compile.py +56 -301
- unique_toolkit/test_utilities/events.py +197 -0
- {unique_toolkit-1.8.1.dist-info → unique_toolkit-1.23.0.dist-info}/METADATA +173 -3
- {unique_toolkit-1.8.1.dist-info → unique_toolkit-1.23.0.dist-info}/RECORD +99 -67
- unique_toolkit/agentic/tools/a2a/postprocessing/_display.py +0 -122
- unique_toolkit/agentic/tools/a2a/postprocessing/_utils.py +0 -19
- unique_toolkit/agentic/tools/a2a/postprocessing/postprocessor.py +0 -230
- unique_toolkit/agentic/tools/a2a/postprocessing/test/test_consolidate_references.py +0 -665
- unique_toolkit/agentic/tools/a2a/postprocessing/test/test_display.py +0 -391
- unique_toolkit/agentic/tools/a2a/postprocessing/test/test_postprocessor_reference_functions.py +0 -256
- {unique_toolkit-1.8.1.dist-info → unique_toolkit-1.23.0.dist-info}/LICENSE +0 -0
- {unique_toolkit-1.8.1.dist-info → unique_toolkit-1.23.0.dist-info}/WHEEL +0 -0
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import base64
|
|
2
|
+
import mimetypes
|
|
1
3
|
from collections.abc import Iterable
|
|
2
|
-
from
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Self, overload
|
|
3
6
|
|
|
4
7
|
from openai.types.chat.chat_completion_assistant_message_param import (
|
|
5
8
|
Audio,
|
|
@@ -7,6 +10,10 @@ from openai.types.chat.chat_completion_assistant_message_param import (
|
|
|
7
10
|
ContentArrayOfContentPart,
|
|
8
11
|
FunctionCall,
|
|
9
12
|
)
|
|
13
|
+
from openai.types.chat.chat_completion_content_part_image_param import (
|
|
14
|
+
ChatCompletionContentPartImageParam,
|
|
15
|
+
ImageURL,
|
|
16
|
+
)
|
|
10
17
|
from openai.types.chat.chat_completion_content_part_param import (
|
|
11
18
|
ChatCompletionContentPartParam,
|
|
12
19
|
)
|
|
@@ -32,6 +39,83 @@ from openai.types.chat.chat_completion_tool_message_param import (
|
|
|
32
39
|
from openai.types.chat.chat_completion_user_message_param import (
|
|
33
40
|
ChatCompletionUserMessageParam,
|
|
34
41
|
)
|
|
42
|
+
from typing_extensions import Literal
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class OpenAIUserMessageBuilder:
|
|
46
|
+
def __init__(
|
|
47
|
+
self,
|
|
48
|
+
) -> None:
|
|
49
|
+
self._messages: list[ChatCompletionContentPartParam] = []
|
|
50
|
+
|
|
51
|
+
def append_text(self, content: str) -> Self:
|
|
52
|
+
part = ChatCompletionContentPartTextParam(
|
|
53
|
+
type="text",
|
|
54
|
+
text=content,
|
|
55
|
+
)
|
|
56
|
+
self._messages.append(part)
|
|
57
|
+
return self
|
|
58
|
+
|
|
59
|
+
@overload
|
|
60
|
+
def append_image(
|
|
61
|
+
self, *, url: str, detail: Literal["auto", "low", "high"] = "auto"
|
|
62
|
+
) -> Self: ...
|
|
63
|
+
|
|
64
|
+
@overload
|
|
65
|
+
def append_image(
|
|
66
|
+
self, *, path: Path, detail: Literal["auto", "low", "high"] = "auto"
|
|
67
|
+
) -> Self: ...
|
|
68
|
+
|
|
69
|
+
@overload
|
|
70
|
+
def append_image(
|
|
71
|
+
self,
|
|
72
|
+
*,
|
|
73
|
+
content: bytes,
|
|
74
|
+
mime_type: str,
|
|
75
|
+
detail: Literal["auto", "low", "high"] = "auto",
|
|
76
|
+
) -> Self: ...
|
|
77
|
+
|
|
78
|
+
def append_image(
|
|
79
|
+
self,
|
|
80
|
+
*,
|
|
81
|
+
url: str | None = None,
|
|
82
|
+
path: Path | None = None,
|
|
83
|
+
content: bytes | None = None,
|
|
84
|
+
mime_type: str | None = None,
|
|
85
|
+
detail: Literal["auto", "low", "high"] = "auto",
|
|
86
|
+
) -> Self:
|
|
87
|
+
if url is None and path is None and (content is None or mime_type is None):
|
|
88
|
+
raise ValueError("Either url or path must be provided")
|
|
89
|
+
|
|
90
|
+
if path is not None:
|
|
91
|
+
# Read image file and encode as base64 data URI
|
|
92
|
+
image_data = path.read_bytes()
|
|
93
|
+
base64_image = base64.b64encode(image_data).decode("utf-8")
|
|
94
|
+
mime_type = mimetypes.guess_type(str(path))[0] or "image/jpeg"
|
|
95
|
+
url = f"data:{mime_type};base64,{base64_image}"
|
|
96
|
+
|
|
97
|
+
if content is not None and mime_type is not None:
|
|
98
|
+
base64_image = base64.b64encode(content).decode("utf-8")
|
|
99
|
+
url = f"data:{mime_type};base64,{base64_image}"
|
|
100
|
+
|
|
101
|
+
image_url = ImageURL(url=url or "", detail=detail)
|
|
102
|
+
part = ChatCompletionContentPartImageParam(
|
|
103
|
+
type="image_url",
|
|
104
|
+
image_url=image_url,
|
|
105
|
+
)
|
|
106
|
+
self._messages.append(part)
|
|
107
|
+
return self
|
|
108
|
+
|
|
109
|
+
@property
|
|
110
|
+
def user_message(self) -> ChatCompletionUserMessageParam:
|
|
111
|
+
return ChatCompletionUserMessageParam(
|
|
112
|
+
content=self._messages,
|
|
113
|
+
role="user",
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
@property
|
|
117
|
+
def iterable_content(self) -> Iterable[ChatCompletionContentPartParam]:
|
|
118
|
+
return self._messages
|
|
35
119
|
|
|
36
120
|
|
|
37
121
|
class OpenAIMessageBuilder:
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import copy
|
|
2
2
|
import logging
|
|
3
3
|
from datetime import UTC, datetime
|
|
4
|
-
from typing import Any, cast
|
|
4
|
+
from typing import Any, Sequence, cast
|
|
5
5
|
|
|
6
6
|
import humps
|
|
7
7
|
import unique_sdk
|
|
8
|
+
from openai.types.chat import ChatCompletionToolChoiceOptionParam
|
|
8
9
|
from openai.types.chat.chat_completion_message_param import ChatCompletionMessageParam
|
|
9
10
|
from pydantic import BaseModel
|
|
10
11
|
|
|
@@ -159,7 +160,7 @@ async def complete_async(
|
|
|
159
160
|
|
|
160
161
|
def _add_tools_to_options(
|
|
161
162
|
options: dict,
|
|
162
|
-
tools:
|
|
163
|
+
tools: Sequence[LanguageModelTool | LanguageModelToolDescription] | None,
|
|
163
164
|
) -> dict:
|
|
164
165
|
if tools:
|
|
165
166
|
options["tools"] = [
|
|
@@ -172,7 +173,12 @@ def _add_tools_to_options(
|
|
|
172
173
|
return options
|
|
173
174
|
|
|
174
175
|
|
|
175
|
-
|
|
176
|
+
SearchContext = list[unique_sdk.Integrated.SearchResult]
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def _to_search_context(
|
|
180
|
+
chunks: list[ContentChunk],
|
|
181
|
+
) -> SearchContext | None:
|
|
176
182
|
if not chunks:
|
|
177
183
|
return None
|
|
178
184
|
return [
|
|
@@ -211,12 +217,12 @@ def _prepare_completion_params_util(
|
|
|
211
217
|
messages: LanguageModelMessages,
|
|
212
218
|
model_name: LanguageModelName | str,
|
|
213
219
|
temperature: float,
|
|
214
|
-
tools:
|
|
220
|
+
tools: Sequence[LanguageModelTool | LanguageModelToolDescription] | None = None,
|
|
215
221
|
other_options: dict | None = None,
|
|
216
222
|
content_chunks: list[ContentChunk] | None = None,
|
|
217
223
|
structured_output_model: type[BaseModel] | None = None,
|
|
218
224
|
structured_output_enforce_schema: bool = False,
|
|
219
|
-
) -> tuple[dict, str, dict,
|
|
225
|
+
) -> tuple[dict, str, dict, SearchContext | None]:
|
|
220
226
|
"""Prepare common parameters for completion requests.
|
|
221
227
|
|
|
222
228
|
Returns
|
|
@@ -259,12 +265,12 @@ def _prepare_completion_params_util(
|
|
|
259
265
|
def _prepare_openai_completion_params_util(
|
|
260
266
|
model_name: LanguageModelName | str,
|
|
261
267
|
temperature: float,
|
|
262
|
-
tools:
|
|
268
|
+
tools: Sequence[LanguageModelTool | LanguageModelToolDescription] | None = None,
|
|
263
269
|
other_options: dict | None = None,
|
|
264
270
|
content_chunks: list[ContentChunk] | None = None,
|
|
265
271
|
structured_output_model: type[BaseModel] | None = None,
|
|
266
272
|
structured_output_enforce_schema: bool = False,
|
|
267
|
-
) -> tuple[dict, str,
|
|
273
|
+
) -> tuple[dict, str, SearchContext | None]:
|
|
268
274
|
"""Prepare common parameters for completion requests.
|
|
269
275
|
|
|
270
276
|
Returns
|
|
@@ -330,18 +336,28 @@ def _prepare_all_completions_params_util(
|
|
|
330
336
|
messages: LanguageModelMessages | list[ChatCompletionMessageParam],
|
|
331
337
|
model_name: LanguageModelName | str,
|
|
332
338
|
temperature: float,
|
|
333
|
-
tools:
|
|
339
|
+
tools: Sequence[LanguageModelTool | LanguageModelToolDescription] | None = None,
|
|
334
340
|
other_options: dict | None = None,
|
|
335
341
|
content_chunks: list[ContentChunk] | None = None,
|
|
342
|
+
tool_choice: ChatCompletionToolChoiceOptionParam | None = None,
|
|
336
343
|
structured_output_model: type[BaseModel] | None = None,
|
|
337
344
|
structured_output_enforce_schema: bool = False,
|
|
338
345
|
) -> tuple[
|
|
339
346
|
dict,
|
|
340
347
|
str,
|
|
341
348
|
list[unique_sdk.Integrated.ChatCompletionRequestMessage],
|
|
342
|
-
|
|
349
|
+
SearchContext | None,
|
|
343
350
|
]:
|
|
344
351
|
model_info = None
|
|
352
|
+
|
|
353
|
+
other_options = copy.deepcopy(other_options)
|
|
354
|
+
|
|
355
|
+
if tool_choice is not None:
|
|
356
|
+
if other_options is None:
|
|
357
|
+
other_options = {}
|
|
358
|
+
if "toolChoice" not in other_options:
|
|
359
|
+
other_options["toolChoice"] = tool_choice # Backend expects CamelCase
|
|
360
|
+
|
|
345
361
|
if isinstance(model_name, LanguageModelName):
|
|
346
362
|
model_info = LanguageModelInfo.from_name(model_name)
|
|
347
363
|
other_options = _prepare_other_options(
|
|
@@ -19,6 +19,7 @@ class LanguageModelName(StrEnum):
|
|
|
19
19
|
AZURE_GPT_5_MINI_2025_0807 = "AZURE_GPT_5_MINI_2025_0807"
|
|
20
20
|
AZURE_GPT_5_NANO_2025_0807 = "AZURE_GPT_5_NANO_2025_0807"
|
|
21
21
|
AZURE_GPT_5_CHAT_2025_0807 = "AZURE_GPT_5_CHAT_2025_0807"
|
|
22
|
+
AZURE_GPT_5_PRO_2025_1006 = "AZURE_GPT_5_PRO_2025_1006"
|
|
22
23
|
AZURE_GPT_4o_2024_0513 = "AZURE_GPT_4o_2024_0513"
|
|
23
24
|
AZURE_GPT_4o_2024_0806 = "AZURE_GPT_4o_2024_0806"
|
|
24
25
|
AZURE_GPT_4o_2024_1120 = "AZURE_GPT_4o_2024_1120"
|
|
@@ -36,6 +37,7 @@ class LanguageModelName(StrEnum):
|
|
|
36
37
|
ANTHROPIC_CLAUDE_3_7_SONNET_THINKING = (
|
|
37
38
|
"litellm:anthropic-claude-3-7-sonnet-thinking"
|
|
38
39
|
)
|
|
40
|
+
ANTHROPIC_CLAUDE_HAIKU_4_5 = "litellm:anthropic-claude-haiku-4-5"
|
|
39
41
|
ANTHROPIC_CLAUDE_SONNET_4 = "litellm:anthropic-claude-sonnet-4"
|
|
40
42
|
ANTHROPIC_CLAUDE_SONNET_4_5 = "litellm:anthropic-claude-sonnet-4-5"
|
|
41
43
|
ANTHROPIC_CLAUDE_OPUS_4 = "litellm:anthropic-claude-opus-4"
|
|
@@ -51,6 +53,7 @@ class LanguageModelName(StrEnum):
|
|
|
51
53
|
LITELLM_OPENAI_GPT_5_MINI = "litellm:openai-gpt-5-mini"
|
|
52
54
|
LITELLM_OPENAI_GPT_5_NANO = "litellm:openai-gpt-5-nano"
|
|
53
55
|
LITELLM_OPENAI_GPT_5_CHAT = "litellm:openai-gpt-5-chat"
|
|
56
|
+
LITELLM_OPENAI_GPT_5_PRO = "litellm:openai-gpt-5-pro"
|
|
54
57
|
LITELLM_OPENAI_O1 = "litellm:openai-o1"
|
|
55
58
|
LITELLM_OPENAI_O3 = "litellm:openai-o3"
|
|
56
59
|
LITELLM_OPENAI_O3_DEEP_RESEARCH = "litellm:openai-o3-deep-research"
|
|
@@ -90,10 +93,12 @@ def get_encoder_name(model_name: LanguageModelName) -> EncoderName:
|
|
|
90
93
|
| LMN.AZURE_GPT_5_MINI_2025_0807
|
|
91
94
|
| LMN.AZURE_GPT_5_NANO_2025_0807
|
|
92
95
|
| LMN.AZURE_GPT_5_CHAT_2025_0807
|
|
96
|
+
| LMN.AZURE_GPT_5_PRO_2025_1006
|
|
93
97
|
| LMN.LITELLM_OPENAI_GPT_5
|
|
94
98
|
| LMN.LITELLM_OPENAI_GPT_5_MINI
|
|
95
99
|
| LMN.LITELLM_OPENAI_GPT_5_NANO
|
|
96
100
|
| LMN.LITELLM_OPENAI_GPT_5_CHAT
|
|
101
|
+
| LMN.LITELLM_OPENAI_GPT_5_PRO
|
|
97
102
|
| LMN.LITELLM_OPENAI_O1
|
|
98
103
|
| LMN.LITELLM_OPENAI_O3
|
|
99
104
|
| LMN.LITELLM_OPENAI_O3_DEEP_RESEARCH
|
|
@@ -333,6 +338,27 @@ class LanguageModelInfo(BaseModel):
|
|
|
333
338
|
deprecated_at=date(2026, 8, 7),
|
|
334
339
|
retirement_at=date(2026, 8, 7),
|
|
335
340
|
)
|
|
341
|
+
case LanguageModelName.AZURE_GPT_5_PRO_2025_1006:
|
|
342
|
+
return cls(
|
|
343
|
+
name=model_name,
|
|
344
|
+
provider=LanguageModelProvider.AZURE,
|
|
345
|
+
version="2025-10-06",
|
|
346
|
+
encoder_name=EncoderName.O200K_BASE,
|
|
347
|
+
capabilities=[
|
|
348
|
+
ModelCapabilities.FUNCTION_CALLING,
|
|
349
|
+
ModelCapabilities.REASONING,
|
|
350
|
+
ModelCapabilities.VISION,
|
|
351
|
+
ModelCapabilities.STRUCTURED_OUTPUT,
|
|
352
|
+
],
|
|
353
|
+
token_limits=LanguageModelTokenLimits(
|
|
354
|
+
token_limit_input=272000, token_limit_output=128000
|
|
355
|
+
),
|
|
356
|
+
info_cutoff_at=date(2024, 10, 30),
|
|
357
|
+
published_at=date(2025, 10, 6),
|
|
358
|
+
temperature_bounds=TemperatureBounds(
|
|
359
|
+
min_temperature=1.0, max_temperature=1.0
|
|
360
|
+
),
|
|
361
|
+
)
|
|
336
362
|
case LanguageModelName.AZURE_GPT_4_TURBO_2024_0409:
|
|
337
363
|
return cls(
|
|
338
364
|
name=model_name,
|
|
@@ -620,7 +646,7 @@ class LanguageModelInfo(BaseModel):
|
|
|
620
646
|
token_limits=LanguageModelTokenLimits(
|
|
621
647
|
# Input limit is 200_000, we leave 20_000 tokens as buffer due to tokenizer mismatch
|
|
622
648
|
token_limit_input=180_000,
|
|
623
|
-
token_limit_output=
|
|
649
|
+
token_limit_output=64_000,
|
|
624
650
|
),
|
|
625
651
|
info_cutoff_at=date(2024, 10, 31),
|
|
626
652
|
published_at=date(2025, 2, 24),
|
|
@@ -640,11 +666,31 @@ class LanguageModelInfo(BaseModel):
|
|
|
640
666
|
token_limits=LanguageModelTokenLimits(
|
|
641
667
|
# Input limit is 200_000, we leave 20_000 tokens as buffer due to tokenizer mismatch
|
|
642
668
|
token_limit_input=180_000,
|
|
643
|
-
token_limit_output=
|
|
669
|
+
token_limit_output=64_000,
|
|
644
670
|
),
|
|
645
671
|
info_cutoff_at=date(2024, 10, 31),
|
|
646
672
|
published_at=date(2025, 2, 24),
|
|
647
673
|
)
|
|
674
|
+
case LanguageModelName.ANTHROPIC_CLAUDE_HAIKU_4_5:
|
|
675
|
+
return cls(
|
|
676
|
+
name=model_name,
|
|
677
|
+
capabilities=[
|
|
678
|
+
ModelCapabilities.FUNCTION_CALLING,
|
|
679
|
+
ModelCapabilities.STREAMING,
|
|
680
|
+
ModelCapabilities.VISION,
|
|
681
|
+
ModelCapabilities.REASONING,
|
|
682
|
+
],
|
|
683
|
+
provider=LanguageModelProvider.LITELLM,
|
|
684
|
+
version="claude-haiku-4-5",
|
|
685
|
+
encoder_name=EncoderName.O200K_BASE, # TODO: Update encoder with litellm
|
|
686
|
+
token_limits=LanguageModelTokenLimits(
|
|
687
|
+
# Input limit is 200_000, we leave 20_000 tokens as buffer due to tokenizer mismatch
|
|
688
|
+
token_limit_input=180_000,
|
|
689
|
+
token_limit_output=64_000,
|
|
690
|
+
),
|
|
691
|
+
info_cutoff_at=date(2025, 2, 1),
|
|
692
|
+
published_at=date(2025, 10, 1),
|
|
693
|
+
)
|
|
648
694
|
case LanguageModelName.ANTHROPIC_CLAUDE_SONNET_4:
|
|
649
695
|
return cls(
|
|
650
696
|
name=model_name,
|
|
@@ -679,7 +725,7 @@ class LanguageModelInfo(BaseModel):
|
|
|
679
725
|
encoder_name=EncoderName.O200K_BASE, # TODO: Update encoder with litellm
|
|
680
726
|
token_limits=LanguageModelTokenLimits(
|
|
681
727
|
# Input limit is 200_000, we leave 20_000 tokens as buffer due to tokenizer mismatch
|
|
682
|
-
token_limit_input=
|
|
728
|
+
token_limit_input=180_000,
|
|
683
729
|
token_limit_output=64_000,
|
|
684
730
|
),
|
|
685
731
|
info_cutoff_at=date(2025, 7, 1),
|
|
@@ -718,7 +764,8 @@ class LanguageModelInfo(BaseModel):
|
|
|
718
764
|
version="claude-opus-4",
|
|
719
765
|
encoder_name=EncoderName.O200K_BASE, # TODO: Update encoder with litellm
|
|
720
766
|
token_limits=LanguageModelTokenLimits(
|
|
721
|
-
|
|
767
|
+
# Input limit is 200_000, we leave 20_000 tokens as buffer due to tokenizer mismatch
|
|
768
|
+
token_limit_input=180_000,
|
|
722
769
|
token_limit_output=32_000,
|
|
723
770
|
),
|
|
724
771
|
info_cutoff_at=date(2025, 3, 1),
|
|
@@ -959,6 +1006,27 @@ class LanguageModelInfo(BaseModel):
|
|
|
959
1006
|
deprecated_at=date(2026, 8, 7),
|
|
960
1007
|
retirement_at=date(2026, 8, 7),
|
|
961
1008
|
)
|
|
1009
|
+
case LanguageModelName.LITELLM_OPENAI_GPT_5_PRO:
|
|
1010
|
+
return cls(
|
|
1011
|
+
name=model_name,
|
|
1012
|
+
provider=LanguageModelProvider.LITELLM,
|
|
1013
|
+
version="2025-10-06",
|
|
1014
|
+
encoder_name=EncoderName.O200K_BASE,
|
|
1015
|
+
capabilities=[
|
|
1016
|
+
ModelCapabilities.FUNCTION_CALLING,
|
|
1017
|
+
ModelCapabilities.REASONING,
|
|
1018
|
+
ModelCapabilities.VISION,
|
|
1019
|
+
ModelCapabilities.STRUCTURED_OUTPUT,
|
|
1020
|
+
],
|
|
1021
|
+
token_limits=LanguageModelTokenLimits(
|
|
1022
|
+
token_limit_input=272000, token_limit_output=128000
|
|
1023
|
+
),
|
|
1024
|
+
info_cutoff_at=date(2024, 10, 30),
|
|
1025
|
+
published_at=date(2025, 10, 6),
|
|
1026
|
+
temperature_bounds=TemperatureBounds(
|
|
1027
|
+
min_temperature=1.0, max_temperature=1.0
|
|
1028
|
+
),
|
|
1029
|
+
)
|
|
962
1030
|
case LanguageModelName.LITELLM_OPENAI_O1:
|
|
963
1031
|
return cls(
|
|
964
1032
|
name=model_name,
|