unique_toolkit 0.8.32__py3-none-any.whl → 0.8.34__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.
@@ -78,6 +78,30 @@ def get_event_generator(
78
78
  continue
79
79
 
80
80
 
81
+ def get_event_stream(
82
+ event_type: type[T] = BaseEvent,
83
+ settings_config: UniqueSettings | str | None = None,
84
+ ) -> Generator[T, None, None]:
85
+ """
86
+ Get an event stream from the SSE client.
87
+
88
+ Args:
89
+ event_type: The type of event to get
90
+ settings_or_filename: The settings or filename to use to setup the Unique settings object
91
+ """
92
+
93
+ if isinstance(settings_config, str):
94
+ unique_settings = UniqueSettings.from_env_auto_with_sdk_init(
95
+ filename=settings_config
96
+ )
97
+ elif isinstance(settings_config, UniqueSettings):
98
+ unique_settings = settings_config
99
+ else:
100
+ unique_settings = UniqueSettings.from_env_auto_with_sdk_init()
101
+
102
+ return get_event_generator(unique_settings, event_type)
103
+
104
+
81
105
  def run_demo_with_sse_client(
82
106
  unique_settings: UniqueSettings,
83
107
  handler: Callable[[BaseEvent], Awaitable[None] | None],
@@ -135,11 +135,19 @@ class ContentService:
135
135
 
136
136
  @classmethod
137
137
  def from_settings(
138
- cls, settings: UniqueSettings, metadata_filter: dict | None = None
138
+ cls,
139
+ settings: UniqueSettings | str | None = None,
140
+ metadata_filter: dict | None = None,
139
141
  ):
140
142
  """
141
- Initialize the ContentService with a settings object.
143
+ Initialize the ContentService with a settings object and metadata filter.
142
144
  """
145
+
146
+ if settings is None:
147
+ settings = UniqueSettings.from_env_auto_with_sdk_init()
148
+ elif isinstance(settings, str):
149
+ settings = UniqueSettings.from_env_auto_with_sdk_init(filename=settings)
150
+
143
151
  return cls(
144
152
  company_id=settings.auth.company_id.get_secret_value(),
145
153
  user_id=settings.auth.user_id.get_secret_value(),
@@ -56,10 +56,16 @@ class EmbeddingService(BaseService):
56
56
  return cls(company_id=event.company_id, user_id=event.user_id)
57
57
 
58
58
  @classmethod
59
- def from_settings(cls, settings: UniqueSettings):
59
+ def from_settings(cls, settings: UniqueSettings | str | None = None):
60
60
  """
61
61
  Initialize the EmbeddingService with a settings object.
62
62
  """
63
+
64
+ if settings is None:
65
+ settings = UniqueSettings.from_env_auto_with_sdk_init()
66
+ elif isinstance(settings, str):
67
+ settings = UniqueSettings.from_env_auto_with_sdk_init(filename=settings)
68
+
63
69
  return cls(
64
70
  company_id=settings.auth.company_id.get_secret_value(),
65
71
  user_id=settings.auth.user_id.get_secret_value(),
@@ -91,10 +91,15 @@ class LanguageModelService:
91
91
  return cls(company_id=event.company_id, user_id=event.user_id)
92
92
 
93
93
  @classmethod
94
- def from_settings(cls, settings: UniqueSettings):
94
+ def from_settings(cls, settings: UniqueSettings | str | None = None):
95
95
  """
96
96
  Initialize the LanguageModelService with a settings object.
97
97
  """
98
+ if settings is None:
99
+ settings = UniqueSettings.from_env_auto_with_sdk_init()
100
+ elif isinstance(settings, str):
101
+ settings = UniqueSettings.from_env_auto_with_sdk_init(filename=settings)
102
+
98
103
  return cls(
99
104
  company_id=settings.auth.company_id.get_secret_value(),
100
105
  user_id=settings.auth.user_id.get_secret_value(),
@@ -22,6 +22,8 @@ from unique_toolkit.tools.tool_progress_reporter import ToolProgressReporter
22
22
 
23
23
  ConfigType = TypeVar("ConfigType", bound=BaseToolConfig)
24
24
 
25
+ ToolBuildConfig.model_rebuild()
26
+
25
27
 
26
28
  class Tool(ABC, Generic[ConfigType]):
27
29
  name: str
@@ -152,8 +154,7 @@ class Tool(ABC, Generic[ConfigType]):
152
154
  ):
153
155
  self.settings = ToolBuildConfig(
154
156
  name=self.name,
155
- configuration=config, # type: ignore
156
- # the ToolBuildConfig has a wrong type in it to be fixed later.
157
+ configuration=config,
157
158
  )
158
159
 
159
160
  self.config = config
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 0.8.32
3
+ Version: 0.8.34
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Martin Fadler
@@ -116,7 +116,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
116
116
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
117
117
 
118
118
 
119
- ## [0.8.31] - 2025-08-30
119
+ ## [0.8.34] - 2025-09-01
120
+ - Automatic initializations of services and event generator
121
+
122
+ ## [0.8.33] - 2025-08-31
123
+
124
+ fixed tool for `web_search`
125
+
126
+ ## [0.8.32] - 2025-08-30
120
127
 
121
128
  moved over general packages for `web_search`
122
129
 
@@ -16,7 +16,7 @@ unique_toolkit/_common/utils/structured_output/schema.py,sha256=Tp7kDYcmKtnUhcuR
16
16
  unique_toolkit/_common/validate_required_values.py,sha256=Y_M1ub9gIKP9qZ45F6Zq3ZHtuIqhmOjl8Z2Vd3avg8w,588
17
17
  unique_toolkit/_common/validators.py,sha256=aZwbMho7XszN7lT5RtemaiXgC0WJ4u40oeVgsNGhF4U,2803
18
18
  unique_toolkit/app/__init__.py,sha256=ETxYDpEizg_PKmi4JPX_P76ySq-us-xypfAIdKQ1QZU,1284
19
- unique_toolkit/app/dev_util.py,sha256=rN-xSg4OGfmwjaToy8m_hQroehcLYyk9-GCmQJ-f6uY,4302
19
+ unique_toolkit/app/dev_util.py,sha256=1C5aGUQnyO8Kot9i35PPFl4B32Oj9eK22WKTP_BrfwY,5063
20
20
  unique_toolkit/app/init_logging.py,sha256=Sh26SRxOj8i8dzobKhYha2lLrkrMTHfB1V4jR3h23gQ,678
21
21
  unique_toolkit/app/init_sdk.py,sha256=5_oDoETr6akwYyBCb0ivTdMNu3SVgPSkrXcDS6ELyY8,2269
22
22
  unique_toolkit/app/performance/async_tasks.py,sha256=H0l3OAcosLwNHZ8d2pd-Di4wHIXfclEvagi5kfqLFPA,1941
@@ -35,14 +35,14 @@ unique_toolkit/content/__init__.py,sha256=EdJg_A_7loEtCQf4cah3QARQreJx6pdz89Rm96
35
35
  unique_toolkit/content/constants.py,sha256=1iy4Y67xobl5VTnJB6SxSyuoBWbdLl9244xfVMUZi5o,60
36
36
  unique_toolkit/content/functions.py,sha256=HZtDIAH3ZxWleq5Si_v30n_7vTnNRu6BCxpTHb9TxdA,18635
37
37
  unique_toolkit/content/schemas.py,sha256=KJ604BOx0vBh2AwlTCZkOo55aHsI6yj8vxDAARKKqEo,2995
38
- unique_toolkit/content/service.py,sha256=u4-9hXxali4eSpRtnjK93TunsV0YmB6EDqPY1rpnKQ4,23443
38
+ unique_toolkit/content/service.py,sha256=0g1aWbjKkHRo-ZiVlDICvCtYEO29WDs8R-rGHGg4_QE,23724
39
39
  unique_toolkit/content/utils.py,sha256=qNVmHTuETaPNGqheg7TbgPr1_1jbNHDc09N5RrmUIyo,7901
40
40
  unique_toolkit/debug_info_manager/debug_info_manager.py,sha256=7c2yb3ES0yu-SJy3o7EwpuCBGaq_8IOMEAvD-BQ-eLI,576
41
41
  unique_toolkit/embedding/__init__.py,sha256=uUyzjonPvuDCYsvXCIt7ErQXopLggpzX-MEQd3_e2kE,250
42
42
  unique_toolkit/embedding/constants.py,sha256=Lj8-Lcy1FvuC31PM9Exq7vaFuxQV4pEI1huUMFX-J2M,52
43
43
  unique_toolkit/embedding/functions.py,sha256=3qp-BfuMAbnp8YB04rh3xH8vsJuCBPizoy-JeaBFtoQ,1944
44
44
  unique_toolkit/embedding/schemas.py,sha256=1GvKCaSk4jixzVQ2PKq8yDqwGEVY_hWclYtoAr6CC2g,96
45
- unique_toolkit/embedding/service.py,sha256=2KjYlUKxeh-Je8S1mOPiQ735pqAmdbeztycVNJxcUXA,5039
45
+ unique_toolkit/embedding/service.py,sha256=XViQCbjG9yznIFhWjgBkla_4s7zM2lO12Cqob1FU63k,5283
46
46
  unique_toolkit/embedding/utils.py,sha256=v86lo__bCJbxZBQ3OcLu5SuwT6NbFfWlcq8iyk6BuzQ,279
47
47
  unique_toolkit/evals/config.py,sha256=ywHIrJs5SFdKr1WXfrofWuFfzb0iPQw8iZDpq5oEug4,953
48
48
  unique_toolkit/evals/context_relevancy/prompts.py,sha256=EdHFUOB581yVxcOL8482KUv_LzaRjuiem71EF8udYMc,1331
@@ -92,7 +92,7 @@ unique_toolkit/language_model/infos.py,sha256=fKmpTEvrHotGFo-PHkLpdlmk57UyFLCkuP
92
92
  unique_toolkit/language_model/prompt.py,sha256=JSawaLjQg3VR-E2fK8engFyJnNdk21zaO8pPIodzN4Q,3991
93
93
  unique_toolkit/language_model/reference.py,sha256=nkX2VFz-IrUz8yqyc3G5jUMNwrNpxITBrMEKkbqqYoI,8583
94
94
  unique_toolkit/language_model/schemas.py,sha256=EOgy-p1GRcS46Sq0qEsN8MfOMl-KCcvEd9aCmqm9d08,16497
95
- unique_toolkit/language_model/service.py,sha256=DYvqYlHiI7Bwq65RMGBJ995Wq_zUzRzPPnrpN2843zc,11776
95
+ unique_toolkit/language_model/service.py,sha256=JkYGtCug8POQskTv_aoYkzTMOaPCWRM94y73o3bUttQ,12019
96
96
  unique_toolkit/language_model/utils.py,sha256=bPQ4l6_YO71w-zaIPanUUmtbXC1_hCvLK0tAFc3VCRc,1902
97
97
  unique_toolkit/postprocessor/postprocessor_manager.py,sha256=yf34VMwZfwGjmDbVeMJ5JN3ET4N68V39EF9kiWVUa_Y,4213
98
98
  unique_toolkit/protocols/support.py,sha256=V15WEIFKVMyF1QCnR8vIi4GrJy4dfTCB6d6JlqPZ58o,2341
@@ -122,14 +122,14 @@ unique_toolkit/tools/mcp/tool_wrapper.py,sha256=w7Fbo4FSMYvtgSq7Sqt1dmAPvqHjoBQS
122
122
  unique_toolkit/tools/schemas.py,sha256=rArQccbfIv7CWcozClAZ-BVlOwAsjpgL8KUab_WeO3k,4817
123
123
  unique_toolkit/tools/test/test_mcp_manager.py,sha256=dySiytBUfRjTOzwY_oGKi_jT6BNVgzZuh1du-EvbcJ4,15627
124
124
  unique_toolkit/tools/test/test_tool_progress_reporter.py,sha256=GTtmBqOUo0-4fh_q0lRgxDhwKeankc3FHFD5ULZAm4Y,6299
125
- unique_toolkit/tools/tool.py,sha256=QvsNsiJ6bes4ezKin3r039oGCilvqtlthZm1nsfCjKk,6002
125
+ unique_toolkit/tools/tool.py,sha256=6kw8oadYfFlV0LEPDTHWiz0l5q_8gM-hLpLjmUn_VNs,5943
126
126
  unique_toolkit/tools/tool_manager.py,sha256=uW1uf8mYvbnBN_TVa4L79p_8Sf9HyY4V_nXZqrh3fPM,10206
127
127
  unique_toolkit/tools/tool_progress_reporter.py,sha256=ixud9VoHey1vlU1t86cW0-WTvyTwMxNSWBon8I11SUk,7955
128
128
  unique_toolkit/tools/utils/execution/execution.py,sha256=vjG2Y6awsGNtlvyQAGCTthQ5thWHYnn-vzZXaYLb3QE,7922
129
129
  unique_toolkit/tools/utils/source_handling/schema.py,sha256=vzAyf6ZWNexjMO0OrnB8y2glGkvAilmGGQXd6zcDaKw,870
130
130
  unique_toolkit/tools/utils/source_handling/source_formatting.py,sha256=C7uayNbdkNVJdEARA5CENnHtNY1SU6etlaqbgHNyxaQ,9152
131
131
  unique_toolkit/tools/utils/source_handling/tests/test_source_formatting.py,sha256=oM5ZxEgzROrnX1229KViCAFjRxl9wCTzWZoinYSHleM,6979
132
- unique_toolkit-0.8.32.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
133
- unique_toolkit-0.8.32.dist-info/METADATA,sha256=zGeIqWysPTGI5qrDXXz2JqvpgaXSXXXbz-NXS8LHWeM,29611
134
- unique_toolkit-0.8.32.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
135
- unique_toolkit-0.8.32.dist-info/RECORD,,
132
+ unique_toolkit-0.8.34.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
133
+ unique_toolkit-0.8.34.dist-info/METADATA,sha256=7QgmsTH7dImdgUvj3KVXNmSn0Nt5zyHM7gycQXERJj8,29752
134
+ unique_toolkit-0.8.34.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
135
+ unique_toolkit-0.8.34.dist-info/RECORD,,