openai-sdk-helpers 0.0.2__py3-none-any.whl → 0.0.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.
- {openai_sdk_helpers-0.0.2.dist-info → openai_sdk_helpers-0.0.4.dist-info}/METADATA +57 -4
- openai_sdk_helpers-0.0.4.dist-info/RECORD +4 -0
- openai_sdk_helpers/__init__.py +0 -34
- openai_sdk_helpers/agent/__init__.py +0 -23
- openai_sdk_helpers/agent/base.py +0 -432
- openai_sdk_helpers/agent/config.py +0 -66
- openai_sdk_helpers/agent/project_manager.py +0 -416
- openai_sdk_helpers/agent/runner.py +0 -117
- openai_sdk_helpers/agent/utils.py +0 -47
- openai_sdk_helpers/agent/vector_search.py +0 -418
- openai_sdk_helpers/agent/web_search.py +0 -404
- openai_sdk_helpers/config.py +0 -141
- openai_sdk_helpers/enums/__init__.py +0 -7
- openai_sdk_helpers/enums/base.py +0 -17
- openai_sdk_helpers/environment.py +0 -27
- openai_sdk_helpers/prompt/__init__.py +0 -77
- openai_sdk_helpers/response/__init__.py +0 -16
- openai_sdk_helpers/response/base.py +0 -477
- openai_sdk_helpers/response/messages.py +0 -211
- openai_sdk_helpers/response/runner.py +0 -42
- openai_sdk_helpers/response/tool_call.py +0 -70
- openai_sdk_helpers/structure/__init__.py +0 -57
- openai_sdk_helpers/structure/base.py +0 -591
- openai_sdk_helpers/structure/plan/__init__.py +0 -13
- openai_sdk_helpers/structure/plan/enum.py +0 -48
- openai_sdk_helpers/structure/plan/plan.py +0 -104
- openai_sdk_helpers/structure/plan/task.py +0 -122
- openai_sdk_helpers/structure/prompt.py +0 -24
- openai_sdk_helpers/structure/responses.py +0 -148
- openai_sdk_helpers/structure/summary.py +0 -65
- openai_sdk_helpers/structure/vector_search.py +0 -82
- openai_sdk_helpers/structure/web_search.py +0 -46
- openai_sdk_helpers/utils/__init__.py +0 -13
- openai_sdk_helpers/utils/core.py +0 -208
- openai_sdk_helpers/vector_storage/__init__.py +0 -15
- openai_sdk_helpers/vector_storage/cleanup.py +0 -91
- openai_sdk_helpers/vector_storage/storage.py +0 -501
- openai_sdk_helpers/vector_storage/types.py +0 -58
- openai_sdk_helpers-0.0.2.dist-info/RECORD +0 -40
- {openai_sdk_helpers-0.0.2.dist-info → openai_sdk_helpers-0.0.4.dist-info}/WHEEL +0 -0
- {openai_sdk_helpers-0.0.2.dist-info → openai_sdk_helpers-0.0.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"""Convenience runners for response workflows."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from typing import Any, Optional, Type, TypeVar
|
|
6
|
-
|
|
7
|
-
from .base import ResponseBase
|
|
8
|
-
|
|
9
|
-
T = TypeVar("T")
|
|
10
|
-
R = TypeVar("R", bound=ResponseBase[Any])
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def run(
|
|
14
|
-
response_cls: Type[R],
|
|
15
|
-
*,
|
|
16
|
-
content: str,
|
|
17
|
-
response_kwargs: Optional[dict[str, Any]] = None,
|
|
18
|
-
) -> Any:
|
|
19
|
-
"""Run a response workflow synchronously and close resources.
|
|
20
|
-
|
|
21
|
-
Parameters
|
|
22
|
-
----------
|
|
23
|
-
response_cls : type[ResponseBase]
|
|
24
|
-
Response class to instantiate.
|
|
25
|
-
content : str
|
|
26
|
-
Prompt text to send to the OpenAI API.
|
|
27
|
-
response_kwargs : dict[str, Any], optional
|
|
28
|
-
Keyword arguments forwarded to ``response_cls``.
|
|
29
|
-
|
|
30
|
-
Returns
|
|
31
|
-
-------
|
|
32
|
-
Any
|
|
33
|
-
Parsed response from :meth:`ResponseBase.generate_response`.
|
|
34
|
-
"""
|
|
35
|
-
response = response_cls(**(response_kwargs or {}))
|
|
36
|
-
try:
|
|
37
|
-
return response.generate_response(content=content)
|
|
38
|
-
finally:
|
|
39
|
-
response.close()
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
__all__ = ["run"]
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"""Tool call representation for shared responses."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from dataclasses import dataclass
|
|
6
|
-
from typing import Tuple
|
|
7
|
-
|
|
8
|
-
from openai.types.responses.response_function_tool_call_param import (
|
|
9
|
-
ResponseFunctionToolCallParam,
|
|
10
|
-
)
|
|
11
|
-
from openai.types.responses.response_input_param import FunctionCallOutput
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@dataclass
|
|
15
|
-
class ResponseToolCall:
|
|
16
|
-
"""Container for tool call data used in a conversation.
|
|
17
|
-
|
|
18
|
-
Attributes
|
|
19
|
-
----------
|
|
20
|
-
call_id : str
|
|
21
|
-
Identifier of the tool call.
|
|
22
|
-
name : str
|
|
23
|
-
Name of the tool invoked.
|
|
24
|
-
arguments : str
|
|
25
|
-
JSON string with the arguments passed to the tool.
|
|
26
|
-
output : str
|
|
27
|
-
JSON string representing the result produced by the tool.
|
|
28
|
-
|
|
29
|
-
Methods
|
|
30
|
-
-------
|
|
31
|
-
to_response_input_item_param()
|
|
32
|
-
Convert stored data into OpenAI tool call objects.
|
|
33
|
-
"""
|
|
34
|
-
|
|
35
|
-
call_id: str
|
|
36
|
-
name: str
|
|
37
|
-
arguments: str
|
|
38
|
-
output: str
|
|
39
|
-
|
|
40
|
-
def to_response_input_item_param(
|
|
41
|
-
self,
|
|
42
|
-
) -> Tuple[ResponseFunctionToolCallParam, FunctionCallOutput]:
|
|
43
|
-
"""Convert stored data into OpenAI tool call objects.
|
|
44
|
-
|
|
45
|
-
Returns
|
|
46
|
-
-------
|
|
47
|
-
tuple[ResponseFunctionToolCallParam, FunctionCallOutput]
|
|
48
|
-
The function call object and the corresponding output object
|
|
49
|
-
suitable for inclusion in an OpenAI request.
|
|
50
|
-
"""
|
|
51
|
-
from typing import cast
|
|
52
|
-
|
|
53
|
-
function_call = cast(
|
|
54
|
-
ResponseFunctionToolCallParam,
|
|
55
|
-
{
|
|
56
|
-
"arguments": self.arguments,
|
|
57
|
-
"call_id": self.call_id,
|
|
58
|
-
"name": self.name,
|
|
59
|
-
"type": "function_call",
|
|
60
|
-
},
|
|
61
|
-
)
|
|
62
|
-
function_call_output = cast(
|
|
63
|
-
FunctionCallOutput,
|
|
64
|
-
{
|
|
65
|
-
"call_id": self.call_id,
|
|
66
|
-
"output": self.output,
|
|
67
|
-
"type": "function_call_output",
|
|
68
|
-
},
|
|
69
|
-
)
|
|
70
|
-
return function_call, function_call_output
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"""Shared structured output models and base helpers."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from .plan import AgentEnum, AgentTaskStructure, PlanStructure
|
|
6
|
-
from .base import BaseStructure, SchemaOptions, spec_field
|
|
7
|
-
from .prompt import PromptStructure
|
|
8
|
-
from .responses import (
|
|
9
|
-
assistant_format,
|
|
10
|
-
assistant_tool_definition,
|
|
11
|
-
response_format,
|
|
12
|
-
response_tool_definition,
|
|
13
|
-
)
|
|
14
|
-
from .summary import ExtendedSummaryStructure, SummaryStructure, SummaryTopic
|
|
15
|
-
from .vector_search import (
|
|
16
|
-
VectorSearchItemResultStructure,
|
|
17
|
-
VectorSearchItemResultsStructure,
|
|
18
|
-
VectorSearchItemStructure,
|
|
19
|
-
VectorSearchPlanStructure,
|
|
20
|
-
VectorSearchReportStructure,
|
|
21
|
-
VectorSearchStructure,
|
|
22
|
-
)
|
|
23
|
-
from .web_search import (
|
|
24
|
-
WebSearchItemResultStructure,
|
|
25
|
-
WebSearchItemStructure,
|
|
26
|
-
WebSearchPlanStructure,
|
|
27
|
-
WebSearchReportStructure,
|
|
28
|
-
WebSearchStructure,
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
__all__ = [
|
|
32
|
-
"BaseStructure",
|
|
33
|
-
"SchemaOptions",
|
|
34
|
-
"spec_field",
|
|
35
|
-
"AgentEnum",
|
|
36
|
-
"AgentTaskStructure",
|
|
37
|
-
"PlanStructure",
|
|
38
|
-
"PromptStructure",
|
|
39
|
-
"SummaryTopic",
|
|
40
|
-
"SummaryStructure",
|
|
41
|
-
"ExtendedSummaryStructure",
|
|
42
|
-
"WebSearchStructure",
|
|
43
|
-
"WebSearchPlanStructure",
|
|
44
|
-
"WebSearchItemStructure",
|
|
45
|
-
"WebSearchItemResultStructure",
|
|
46
|
-
"WebSearchReportStructure",
|
|
47
|
-
"VectorSearchReportStructure",
|
|
48
|
-
"VectorSearchItemStructure",
|
|
49
|
-
"VectorSearchItemResultStructure",
|
|
50
|
-
"VectorSearchItemResultsStructure",
|
|
51
|
-
"VectorSearchPlanStructure",
|
|
52
|
-
"VectorSearchStructure",
|
|
53
|
-
"assistant_tool_definition",
|
|
54
|
-
"assistant_format",
|
|
55
|
-
"response_tool_definition",
|
|
56
|
-
"response_format",
|
|
57
|
-
]
|