openai-sdk-helpers 0.4.1__py3-none-any.whl → 0.4.3__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.
- openai_sdk_helpers/__init__.py +10 -36
- openai_sdk_helpers/agent/__init__.py +5 -6
- openai_sdk_helpers/agent/base.py +184 -39
- openai_sdk_helpers/agent/{config.py → configuration.py} +50 -75
- openai_sdk_helpers/agent/{coordination.py → coordinator.py} +12 -10
- openai_sdk_helpers/agent/search/__init__.py +4 -4
- openai_sdk_helpers/agent/search/base.py +16 -16
- openai_sdk_helpers/agent/search/vector.py +66 -42
- openai_sdk_helpers/agent/search/web.py +33 -29
- openai_sdk_helpers/agent/summarizer.py +6 -4
- openai_sdk_helpers/agent/translator.py +9 -5
- openai_sdk_helpers/agent/{validation.py → validator.py} +6 -4
- openai_sdk_helpers/cli.py +8 -22
- openai_sdk_helpers/environment.py +17 -0
- openai_sdk_helpers/prompt/vector_planner.jinja +7 -0
- openai_sdk_helpers/prompt/vector_search.jinja +6 -0
- openai_sdk_helpers/prompt/vector_writer.jinja +7 -0
- openai_sdk_helpers/response/__init__.py +1 -1
- openai_sdk_helpers/response/base.py +4 -4
- openai_sdk_helpers/response/{config.py → configuration.py} +9 -9
- openai_sdk_helpers/response/planner.py +12 -0
- openai_sdk_helpers/response/prompter.py +12 -0
- openai_sdk_helpers/streamlit_app/__init__.py +1 -1
- openai_sdk_helpers/streamlit_app/app.py +16 -17
- openai_sdk_helpers/streamlit_app/{config.py → configuration.py} +13 -13
- openai_sdk_helpers/streamlit_app/streamlit_web_search.py +3 -3
- openai_sdk_helpers/types.py +3 -3
- openai_sdk_helpers/utils/__init__.py +2 -6
- openai_sdk_helpers/utils/json/base_model.py +1 -1
- openai_sdk_helpers/utils/json/data_class.py +1 -1
- openai_sdk_helpers/utils/json/ref.py +3 -0
- openai_sdk_helpers/utils/registry.py +19 -15
- openai_sdk_helpers/vector_storage/storage.py +1 -1
- {openai_sdk_helpers-0.4.1.dist-info → openai_sdk_helpers-0.4.3.dist-info}/METADATA +8 -8
- {openai_sdk_helpers-0.4.1.dist-info → openai_sdk_helpers-0.4.3.dist-info}/RECORD +40 -40
- openai_sdk_helpers/agent/prompt_utils.py +0 -15
- openai_sdk_helpers/context_manager.py +0 -241
- openai_sdk_helpers/deprecation.py +0 -167
- openai_sdk_helpers/retry.py +0 -175
- openai_sdk_helpers/utils/deprecation.py +0 -167
- /openai_sdk_helpers/{logging_config.py → logging.py} +0 -0
- /openai_sdk_helpers/{config.py → settings.py} +0 -0
- {openai_sdk_helpers-0.4.1.dist-info → openai_sdk_helpers-0.4.3.dist-info}/WHEEL +0 -0
- {openai_sdk_helpers-0.4.1.dist-info → openai_sdk_helpers-0.4.3.dist-info}/entry_points.txt +0 -0
- {openai_sdk_helpers-0.4.1.dist-info → openai_sdk_helpers-0.4.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"""Deprecation utilities for managing deprecated features.
|
|
2
|
-
|
|
3
|
-
This module provides infrastructure for marking and managing deprecated
|
|
4
|
-
functions, classes, and features with consistent warning messages.
|
|
5
|
-
|
|
6
|
-
Functions
|
|
7
|
-
---------
|
|
8
|
-
deprecated
|
|
9
|
-
Decorator to mark functions or classes as deprecated.
|
|
10
|
-
warn_deprecated
|
|
11
|
-
Emit a deprecation warning with optional custom message.
|
|
12
|
-
|
|
13
|
-
Classes
|
|
14
|
-
-------
|
|
15
|
-
DeprecationHelper
|
|
16
|
-
Utility class for managing deprecation warnings and versions.
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
from __future__ import annotations
|
|
20
|
-
|
|
21
|
-
import functools
|
|
22
|
-
import warnings
|
|
23
|
-
from typing import Any, Callable, TypeVar
|
|
24
|
-
|
|
25
|
-
F = TypeVar("F", bound=Callable[..., Any])
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class DeprecationHelper:
|
|
29
|
-
"""Utility class for managing deprecation warnings.
|
|
30
|
-
|
|
31
|
-
Provides consistent formatting and control of deprecation warnings
|
|
32
|
-
across the package.
|
|
33
|
-
|
|
34
|
-
Methods
|
|
35
|
-
-------
|
|
36
|
-
warn
|
|
37
|
-
Emit a deprecation warning with standard formatting.
|
|
38
|
-
"""
|
|
39
|
-
|
|
40
|
-
@staticmethod
|
|
41
|
-
def warn(
|
|
42
|
-
feature_name: str,
|
|
43
|
-
removal_version: str,
|
|
44
|
-
alternative: str | None = None,
|
|
45
|
-
extra_message: str | None = None,
|
|
46
|
-
) -> None:
|
|
47
|
-
"""Emit a deprecation warning for a feature.
|
|
48
|
-
|
|
49
|
-
Parameters
|
|
50
|
-
----------
|
|
51
|
-
feature_name : str
|
|
52
|
-
Name of the deprecated feature (e.g., "MyClass.old_method").
|
|
53
|
-
removal_version : str
|
|
54
|
-
Version in which the feature will be removed.
|
|
55
|
-
alternative : str, optional
|
|
56
|
-
Recommended alternative to use instead.
|
|
57
|
-
extra_message : str, optional
|
|
58
|
-
Additional context or migration instructions.
|
|
59
|
-
|
|
60
|
-
Raises
|
|
61
|
-
------
|
|
62
|
-
DeprecationWarning
|
|
63
|
-
Always issues a DeprecationWarning to stderr.
|
|
64
|
-
"""
|
|
65
|
-
msg = f"{feature_name} is deprecated and will be removed in version {removal_version}."
|
|
66
|
-
if alternative:
|
|
67
|
-
msg += f" Use {alternative} instead."
|
|
68
|
-
if extra_message:
|
|
69
|
-
msg += f" {extra_message}"
|
|
70
|
-
|
|
71
|
-
warnings.warn(msg, DeprecationWarning, stacklevel=3)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
def deprecated(
|
|
75
|
-
removal_version: str,
|
|
76
|
-
alternative: str | None = None,
|
|
77
|
-
extra_message: str | None = None,
|
|
78
|
-
) -> Callable[[F], F]:
|
|
79
|
-
"""Mark a function or class as deprecated.
|
|
80
|
-
|
|
81
|
-
Parameters
|
|
82
|
-
----------
|
|
83
|
-
removal_version : str
|
|
84
|
-
Version in which the decorated feature will be removed.
|
|
85
|
-
alternative : str, optional
|
|
86
|
-
Recommended alternative to use instead.
|
|
87
|
-
extra_message : str, optional
|
|
88
|
-
Additional context or migration instructions.
|
|
89
|
-
|
|
90
|
-
Returns
|
|
91
|
-
-------
|
|
92
|
-
Callable
|
|
93
|
-
Decorator function that wraps the target function or class.
|
|
94
|
-
|
|
95
|
-
Examples
|
|
96
|
-
--------
|
|
97
|
-
>>> @deprecated("1.0.0", "new_function")
|
|
98
|
-
... def old_function():
|
|
99
|
-
... pass
|
|
100
|
-
|
|
101
|
-
>>> class OldClass:
|
|
102
|
-
... @deprecated("1.0.0", "NewClass")
|
|
103
|
-
... def old_method(self):
|
|
104
|
-
... pass
|
|
105
|
-
"""
|
|
106
|
-
|
|
107
|
-
def decorator(func_or_class: F) -> F:
|
|
108
|
-
feature_name = f"{func_or_class.__module__}.{func_or_class.__qualname__}"
|
|
109
|
-
|
|
110
|
-
if isinstance(func_or_class, type):
|
|
111
|
-
# Handle class deprecation
|
|
112
|
-
original_init = func_or_class.__init__
|
|
113
|
-
|
|
114
|
-
@functools.wraps(original_init)
|
|
115
|
-
def new_init(self: Any, *args: Any, **kwargs: Any) -> None:
|
|
116
|
-
DeprecationHelper.warn(
|
|
117
|
-
feature_name,
|
|
118
|
-
removal_version,
|
|
119
|
-
alternative,
|
|
120
|
-
extra_message,
|
|
121
|
-
)
|
|
122
|
-
original_init(self, *args, **kwargs)
|
|
123
|
-
|
|
124
|
-
func_or_class.__init__ = new_init
|
|
125
|
-
else:
|
|
126
|
-
# Handle function deprecation
|
|
127
|
-
@functools.wraps(func_or_class)
|
|
128
|
-
def wrapper(*args: Any, **kwargs: Any) -> Any:
|
|
129
|
-
DeprecationHelper.warn(
|
|
130
|
-
feature_name,
|
|
131
|
-
removal_version,
|
|
132
|
-
alternative,
|
|
133
|
-
extra_message,
|
|
134
|
-
)
|
|
135
|
-
return func_or_class(*args, **kwargs)
|
|
136
|
-
|
|
137
|
-
return wrapper # type: ignore
|
|
138
|
-
|
|
139
|
-
return func_or_class # type: ignore[return-value]
|
|
140
|
-
|
|
141
|
-
return decorator
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
def warn_deprecated(
|
|
145
|
-
feature_name: str,
|
|
146
|
-
removal_version: str,
|
|
147
|
-
alternative: str | None = None,
|
|
148
|
-
extra_message: str | None = None,
|
|
149
|
-
) -> None:
|
|
150
|
-
"""Issue a deprecation warning.
|
|
151
|
-
|
|
152
|
-
Parameters
|
|
153
|
-
----------
|
|
154
|
-
feature_name : str
|
|
155
|
-
Name of the deprecated feature.
|
|
156
|
-
removal_version : str
|
|
157
|
-
Version in which the feature will be removed.
|
|
158
|
-
alternative : str, optional
|
|
159
|
-
Recommended alternative to use instead.
|
|
160
|
-
extra_message : str, optional
|
|
161
|
-
Additional context or migration instructions.
|
|
162
|
-
|
|
163
|
-
Examples
|
|
164
|
-
--------
|
|
165
|
-
>>> warn_deprecated("old_config_key", "1.0.0", "new_config_key")
|
|
166
|
-
"""
|
|
167
|
-
DeprecationHelper.warn(feature_name, removal_version, alternative, extra_message)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|