unique_toolkit 0.7.2__py3-none-any.whl → 0.7.4__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.
@@ -2,6 +2,8 @@ from typing_extensions import Self
2
2
 
3
3
  from unique_toolkit.language_model import (
4
4
  LanguageModelAssistantMessage,
5
+ LanguageModelFunction,
6
+ LanguageModelFunctionCall,
5
7
  LanguageModelMessage,
6
8
  LanguageModelMessageRole,
7
9
  LanguageModelMessages,
@@ -48,11 +50,22 @@ class MessagesBuilder:
48
50
  self.messages.append(message)
49
51
  return self
50
52
 
51
- def assistant_message_append(self, content: str) -> Self:
53
+ def assistant_message_append(
54
+ self, content: str, tool_calls: list[LanguageModelFunction] | None = None
55
+ ) -> Self:
52
56
  """Appends an assistant message to the messages list."""
53
57
  message = LanguageModelAssistantMessage(content=content)
58
+ if tool_calls:
59
+ message.tool_calls = [
60
+ LanguageModelFunctionCall(
61
+ id=tool_call.id,
62
+ type="function",
63
+ function=tool_call,
64
+ )
65
+ for tool_call in tool_calls
66
+ ]
54
67
  self.messages.append(message)
55
- return self # Return self to allow method chaining
68
+ return self
56
69
 
57
70
  def tool_message_append(self, name: str, tool_call_id: str, content: str) -> Self:
58
71
  """Appends a tool message to the messages list."""
@@ -60,7 +73,7 @@ class MessagesBuilder:
60
73
  name=name, tool_call_id=tool_call_id, content=content
61
74
  )
62
75
  self.messages.append(message)
63
- return self # Return self to allow method chaining
76
+ return self
64
77
 
65
78
  def build(self, reset: bool = True) -> LanguageModelMessages:
66
79
  """Returns the list of messages and resets the builder"""
@@ -20,6 +20,7 @@ class LanguageModelName(StrEnum):
20
20
  AZURE_o1_2024_1217 = "AZURE_o1_2024_1217"
21
21
  AZURE_o1_MINI_2024_0912 = "AZURE_o1_MINI_2024_0912"
22
22
  AZURE_o3_MINI_2025_0131 = "AZURE_o3_MINI_2025_0131"
23
+ AZURE_GPT_45_PREVIEW_2025_0227 = "AZURE_GPT_45_PREVIEW_2025_0227"
23
24
 
24
25
 
25
26
  class EncoderName(StrEnum):
@@ -275,6 +276,24 @@ class LanguageModelInfo(BaseModel):
275
276
  info_cutoff_at=date(2023, 10, 1),
276
277
  published_at=date(2025, 1, 31),
277
278
  )
279
+ case LanguageModelName.AZURE_GPT_45_PREVIEW_2025_0227:
280
+ return cls(
281
+ name=model_name,
282
+ capabilities=[
283
+ ModelCapabilities.STRUCTURED_OUTPUT,
284
+ ModelCapabilities.FUNCTION_CALLING,
285
+ ModelCapabilities.STREAMING,
286
+ ModelCapabilities.VISION,
287
+ ],
288
+ provider=LanguageModelProvider.AZURE,
289
+ version="2025-02-27",
290
+ encoder_name=EncoderName.O200K_BASE,
291
+ token_limits=LanguageModelTokenLimits(
292
+ token_limit_input=128_000, token_limit_output=16_384
293
+ ),
294
+ info_cutoff_at=date(2023, 10, 1),
295
+ published_at=date(2025, 2, 27),
296
+ )
278
297
  case _:
279
298
  if isinstance(model_name, LanguageModelName):
280
299
  raise ValueError(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 0.7.2
3
+ Version: 0.7.4
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Martin Fadler
@@ -111,6 +111,11 @@ All notable changes to this project will be documented in this file.
111
111
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
112
112
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
113
113
 
114
+ ## [0.7.4] - 2025-03-20
115
+ - add `AZURE_GPT_45_PREVIEW_2025_0227` as part of the models
116
+
117
+ ## [0.7.3] - 2025-03-20
118
+ - Enable handling tool calls in message builder
114
119
 
115
120
  ## [0.7.2] - 2025-03-17
116
121
  - HotFix `ContentService.search_content_chunks` to use `chat_id` from event if provided.
@@ -45,10 +45,10 @@ unique_toolkit/evaluators/hallucination/utils.py,sha256=4KTJH8low_fBzOcuVlcHB2FR
45
45
  unique_toolkit/evaluators/output_parser.py,sha256=eI72qkzK1dZyUvnfP2SOAQCGBj_-PwX5wy_aLPMsJMY,883
46
46
  unique_toolkit/evaluators/schemas.py,sha256=Jaue6Uhx75X1CyHKWj8sT3RE1JZXTqoLtfLt2xQNCX8,2507
47
47
  unique_toolkit/language_model/__init__.py,sha256=jWko_vQj48wjnpTtlkg8iNdef0SMI3FN2kGywXRTMzg,1880
48
- unique_toolkit/language_model/builder.py,sha256=_lUL2shMN1Je2LLYu2PiehOvfWtn5pg1yUuYyiw3f_c,2710
48
+ unique_toolkit/language_model/builder.py,sha256=aIAXWWUoB5G-HONJiAt3MdRGd4jdP8nA-HYX2D2WlSI,3048
49
49
  unique_toolkit/language_model/constants.py,sha256=B-topqW0r83dkC_25DeQfnPk3n53qzIHUCBS7YJ0-1U,119
50
50
  unique_toolkit/language_model/functions.py,sha256=I5jHhHsKoq7GwEQyTrM8LXB2n_6dvMAk7UklenjuHSY,7945
51
- unique_toolkit/language_model/infos.py,sha256=HRdQLG3oetwc-bPHtsXvDRRLsK7fSsC1q8FubvxLMsw,16459
51
+ unique_toolkit/language_model/infos.py,sha256=2X5Y6jBKYAysa9Gmz2YYhjySlJn5uyOD4wZJ0r_Im9w,17383
52
52
  unique_toolkit/language_model/prompt.py,sha256=JSawaLjQg3VR-E2fK8engFyJnNdk21zaO8pPIodzN4Q,3991
53
53
  unique_toolkit/language_model/schemas.py,sha256=rrwzUgKANFOrdehCULW8Hh03uRW3tsE5dXpWqxmClfg,8618
54
54
  unique_toolkit/language_model/service.py,sha256=GupYD4uDZjy1TfVQW3jichmgQwiSgQCj350FtL4O0W4,5569
@@ -58,7 +58,7 @@ unique_toolkit/short_term_memory/constants.py,sha256=698CL6-wjup2MvU19RxSmQk3gX7
58
58
  unique_toolkit/short_term_memory/functions.py,sha256=3WiK-xatY5nh4Dr5zlDUye1k3E6kr41RiscwtTplw5k,4484
59
59
  unique_toolkit/short_term_memory/schemas.py,sha256=OhfcXyF6ACdwIXW45sKzjtZX_gkcJs8FEZXcgQTNenw,1406
60
60
  unique_toolkit/short_term_memory/service.py,sha256=0wrwuo6K17Edcuiwp5LMCvxFuBSDP82HF0_5qwi0nYc,5307
61
- unique_toolkit-0.7.2.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
62
- unique_toolkit-0.7.2.dist-info/METADATA,sha256=grlxS6ihrKZ5fk-IeNN7iGqMK0iKVkAPMOzN8Kx-u28,20871
63
- unique_toolkit-0.7.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
64
- unique_toolkit-0.7.2.dist-info/RECORD,,
61
+ unique_toolkit-0.7.4.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
62
+ unique_toolkit-0.7.4.dist-info/METADATA,sha256=PxjJfBaWJRBkKB0HxMbsOuuAHacJatew_91BK7IK6Ow,21029
63
+ unique_toolkit-0.7.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
64
+ unique_toolkit-0.7.4.dist-info/RECORD,,