unique_toolkit 0.8.38__py3-none-any.whl → 0.8.39__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.
- unique_toolkit/framework_utilities/openai/__init__.py +2 -2
- unique_toolkit/framework_utilities/openai/client.py +27 -1
- {unique_toolkit-0.8.38.dist-info → unique_toolkit-0.8.39.dist-info}/METADATA +3 -1
- {unique_toolkit-0.8.38.dist-info → unique_toolkit-0.8.39.dist-info}/RECORD +6 -6
- {unique_toolkit-0.8.38.dist-info → unique_toolkit-0.8.39.dist-info}/LICENSE +0 -0
- {unique_toolkit-0.8.38.dist-info → unique_toolkit-0.8.39.dist-info}/WHEEL +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
"""OpenAI framework utilities."""
|
2
2
|
|
3
|
-
from .client import get_openai_client
|
3
|
+
from .client import get_async_openai_client, get_openai_client
|
4
4
|
from .message_builder import OpenAIMessageBuilder
|
5
5
|
|
6
|
-
__all__ = ["get_openai_client", "OpenAIMessageBuilder"]
|
6
|
+
__all__ = ["get_openai_client", "OpenAIMessageBuilder", "get_async_openai_client"]
|
@@ -17,7 +17,7 @@ class OpenAINotInstalledError(ImportError):
|
|
17
17
|
|
18
18
|
|
19
19
|
if importlib.util.find_spec("openai") is not None:
|
20
|
-
from openai import OpenAI
|
20
|
+
from openai import AsyncOpenAI, OpenAI
|
21
21
|
else:
|
22
22
|
raise OpenAINotInstalledError()
|
23
23
|
|
@@ -44,3 +44,29 @@ def get_openai_client(unique_settings: UniqueSettings | None = None) -> OpenAI:
|
|
44
44
|
base_url=unique_settings.api.openai_proxy_url(),
|
45
45
|
default_headers=default_headers,
|
46
46
|
)
|
47
|
+
|
48
|
+
|
49
|
+
def get_async_openai_client(
|
50
|
+
unique_settings: UniqueSettings | None = None,
|
51
|
+
) -> AsyncOpenAI:
|
52
|
+
"""Get an async OpenAI client instance.
|
53
|
+
|
54
|
+
Args:
|
55
|
+
unique_settings: Optional UniqueSettings instance
|
56
|
+
|
57
|
+
Returns:
|
58
|
+
AsyncOpenAI client instance
|
59
|
+
|
60
|
+
Raises:
|
61
|
+
OpenAINotInstalledError: If OpenAI package is not installed
|
62
|
+
"""
|
63
|
+
if unique_settings is None:
|
64
|
+
unique_settings = UniqueSettings.from_env_auto()
|
65
|
+
|
66
|
+
default_headers = get_default_headers(unique_settings.app, unique_settings.auth)
|
67
|
+
|
68
|
+
return AsyncOpenAI(
|
69
|
+
api_key="dummy_key",
|
70
|
+
base_url=unique_settings.api.openai_proxy_url(),
|
71
|
+
default_headers=default_headers,
|
72
|
+
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: unique_toolkit
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.39
|
4
4
|
Summary:
|
5
5
|
License: Proprietary
|
6
6
|
Author: Martin Fadler
|
@@ -116,6 +116,8 @@ All notable changes to this project will be documented in this file.
|
|
116
116
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
117
117
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
118
118
|
|
119
|
+
## [0.8.39] - 2025-09-02
|
120
|
+
- include `get_async_openai_client`
|
119
121
|
|
120
122
|
## [0.8.38] - 2025-09-01
|
121
123
|
- Sanitize documentation
|
@@ -77,8 +77,8 @@ unique_toolkit/evaluators/schemas.py,sha256=Jaue6Uhx75X1CyHKWj8sT3RE1JZXTqoLtfLt
|
|
77
77
|
unique_toolkit/framework_utilities/__init__.py,sha256=fvAn9y4MRL1JgoO14ufQtLVRPRHn4jP07XRqt-TItCA,68
|
78
78
|
unique_toolkit/framework_utilities/langchain/client.py,sha256=9LDRS2l9XGxL0HoFLh0ZrFUXrlt8o_J-o-1rU8j-uMQ,1432
|
79
79
|
unique_toolkit/framework_utilities/langchain/history.py,sha256=R9RuCeSFNaUO3OZ0G_LmIC4gmOCIANcl91MfyWLnZ1c,650
|
80
|
-
unique_toolkit/framework_utilities/openai/__init__.py,sha256=
|
81
|
-
unique_toolkit/framework_utilities/openai/client.py,sha256=
|
80
|
+
unique_toolkit/framework_utilities/openai/__init__.py,sha256=CrHYoC7lv2pBscitLerAFweqy5jh1R671LA_jZQ4lWo,232
|
81
|
+
unique_toolkit/framework_utilities/openai/client.py,sha256=ct1cqPcIK1wPl11G9sJV39ZnLJwKr2kDUDSra0FjvtM,2007
|
82
82
|
unique_toolkit/framework_utilities/openai/message_builder.py,sha256=VU6mJm_upLcarJQKFft_t1RlLRncWDxDuLC5LIJ5lQQ,4339
|
83
83
|
unique_toolkit/framework_utilities/utils.py,sha256=JK7g2yMfEx3eMprug26769xqNpS5WJcizf8n2zWMBng,789
|
84
84
|
unique_toolkit/history_manager/history_construction_with_contents.py,sha256=c8Zy3erSbHGT8AdICRRlSK91T_FN6tNpTznvUzpLbWk,9023
|
@@ -130,7 +130,7 @@ unique_toolkit/tools/utils/execution/execution.py,sha256=vjG2Y6awsGNtlvyQAGCTthQ
|
|
130
130
|
unique_toolkit/tools/utils/source_handling/schema.py,sha256=vzAyf6ZWNexjMO0OrnB8y2glGkvAilmGGQXd6zcDaKw,870
|
131
131
|
unique_toolkit/tools/utils/source_handling/source_formatting.py,sha256=C7uayNbdkNVJdEARA5CENnHtNY1SU6etlaqbgHNyxaQ,9152
|
132
132
|
unique_toolkit/tools/utils/source_handling/tests/test_source_formatting.py,sha256=oM5ZxEgzROrnX1229KViCAFjRxl9wCTzWZoinYSHleM,6979
|
133
|
-
unique_toolkit-0.8.
|
134
|
-
unique_toolkit-0.8.
|
135
|
-
unique_toolkit-0.8.
|
136
|
-
unique_toolkit-0.8.
|
133
|
+
unique_toolkit-0.8.39.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
|
134
|
+
unique_toolkit-0.8.39.dist-info/METADATA,sha256=cixwVRwts18sQ5D6fZIA1MjQGiP2Bmmyk_H_itigR88,30126
|
135
|
+
unique_toolkit-0.8.39.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
136
|
+
unique_toolkit-0.8.39.dist-info/RECORD,,
|
File without changes
|
File without changes
|