openai-sdk-helpers 0.4.3__py3-none-any.whl → 0.5.1__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.
Files changed (52) hide show
  1. openai_sdk_helpers/__init__.py +41 -7
  2. openai_sdk_helpers/agent/__init__.py +1 -2
  3. openai_sdk_helpers/agent/base.py +169 -190
  4. openai_sdk_helpers/agent/configuration.py +12 -20
  5. openai_sdk_helpers/agent/coordinator.py +14 -17
  6. openai_sdk_helpers/agent/runner.py +3 -45
  7. openai_sdk_helpers/agent/search/base.py +49 -71
  8. openai_sdk_helpers/agent/search/vector.py +82 -110
  9. openai_sdk_helpers/agent/search/web.py +103 -81
  10. openai_sdk_helpers/agent/summarizer.py +20 -28
  11. openai_sdk_helpers/agent/translator.py +17 -23
  12. openai_sdk_helpers/agent/validator.py +17 -23
  13. openai_sdk_helpers/errors.py +9 -0
  14. openai_sdk_helpers/extract/__init__.py +23 -0
  15. openai_sdk_helpers/extract/extractor.py +157 -0
  16. openai_sdk_helpers/extract/generator.py +476 -0
  17. openai_sdk_helpers/files_api.py +1 -0
  18. openai_sdk_helpers/logging.py +12 -1
  19. openai_sdk_helpers/prompt/extractor_config_agent_instructions.jinja +6 -0
  20. openai_sdk_helpers/prompt/extractor_config_generator.jinja +37 -0
  21. openai_sdk_helpers/prompt/extractor_config_generator_instructions.jinja +9 -0
  22. openai_sdk_helpers/prompt/extractor_prompt_optimizer_agent_instructions.jinja +4 -0
  23. openai_sdk_helpers/prompt/extractor_prompt_optimizer_request.jinja +11 -0
  24. openai_sdk_helpers/response/__init__.py +2 -6
  25. openai_sdk_helpers/response/base.py +233 -164
  26. openai_sdk_helpers/response/configuration.py +39 -14
  27. openai_sdk_helpers/response/files.py +41 -2
  28. openai_sdk_helpers/response/runner.py +1 -48
  29. openai_sdk_helpers/response/tool_call.py +0 -141
  30. openai_sdk_helpers/response/vector_store.py +8 -5
  31. openai_sdk_helpers/streamlit_app/app.py +1 -9
  32. openai_sdk_helpers/structure/__init__.py +16 -0
  33. openai_sdk_helpers/structure/base.py +239 -278
  34. openai_sdk_helpers/structure/extraction.py +1228 -0
  35. openai_sdk_helpers/structure/plan/plan.py +0 -20
  36. openai_sdk_helpers/structure/plan/task.py +0 -33
  37. openai_sdk_helpers/structure/prompt.py +16 -0
  38. openai_sdk_helpers/structure/responses.py +2 -2
  39. openai_sdk_helpers/structure/web_search.py +0 -10
  40. openai_sdk_helpers/tools.py +346 -99
  41. openai_sdk_helpers/utils/__init__.py +7 -0
  42. openai_sdk_helpers/utils/json/base_model.py +315 -32
  43. openai_sdk_helpers/utils/langextract.py +194 -0
  44. openai_sdk_helpers/vector_storage/cleanup.py +7 -2
  45. openai_sdk_helpers/vector_storage/storage.py +37 -7
  46. {openai_sdk_helpers-0.4.3.dist-info → openai_sdk_helpers-0.5.1.dist-info}/METADATA +21 -6
  47. openai_sdk_helpers-0.5.1.dist-info/RECORD +95 -0
  48. openai_sdk_helpers/streamlit_app/streamlit_web_search.py +0 -75
  49. openai_sdk_helpers-0.4.3.dist-info/RECORD +0 -86
  50. {openai_sdk_helpers-0.4.3.dist-info → openai_sdk_helpers-0.5.1.dist-info}/WHEEL +0 -0
  51. {openai_sdk_helpers-0.4.3.dist-info → openai_sdk_helpers-0.5.1.dist-info}/entry_points.txt +0 -0
  52. {openai_sdk_helpers-0.4.3.dist-info → openai_sdk_helpers-0.5.1.dist-info}/licenses/LICENSE +0 -0
@@ -16,6 +16,7 @@ from .errors import (
16
16
  InputValidationError,
17
17
  AsyncExecutionError,
18
18
  ResourceCleanupError,
19
+ ExtractionError,
19
20
  )
20
21
 
21
22
  from .utils.validation import (
@@ -40,6 +41,11 @@ from .structure import (
40
41
  ExtendedSummaryStructure,
41
42
  ValidationResultStructure,
42
43
  AgentBlueprint,
44
+ AnnotatedDocumentStructure,
45
+ AttributeStructure,
46
+ DocumentStructure,
47
+ ExampleDataStructure,
48
+ ExtractionStructure,
43
49
  create_plan,
44
50
  execute_task,
45
51
  execute_plan,
@@ -67,15 +73,15 @@ from .response import (
67
73
  ResponseConfiguration,
68
74
  ResponseRegistry,
69
75
  get_default_registry,
70
- parse_tool_arguments,
71
76
  attach_vector_store,
72
77
  )
73
78
  from .tools import (
74
- serialize_tool_result,
75
79
  tool_handler_factory,
76
80
  StructureType,
81
+ ToolHandler,
82
+ ToolHandlerRegistration,
77
83
  ToolSpec,
78
- build_tool_definitions,
84
+ build_tool_definition_list,
79
85
  )
80
86
  from .settings import build_openai_settings
81
87
  from .utils.output_validation import (
@@ -87,7 +93,17 @@ from .utils.output_validation import (
87
93
  OutputValidator,
88
94
  validate_output,
89
95
  )
90
-
96
+ from .utils.langextract import LangExtractAdapter, build_langextract_adapter
97
+ from .extract import (
98
+ DocumentExtractor,
99
+ EXTRACTOR_CONFIG_AGENT_INSTRUCTIONS,
100
+ EXTRACTOR_CONFIG_GENERATOR,
101
+ PROMPT_OPTIMIZER_AGENT_INSTRUCTIONS,
102
+ generate_document_extractor_config,
103
+ generate_document_extractor_config_with_agent,
104
+ optimize_extractor_prompt,
105
+ optimize_extractor_prompt_with_agent,
106
+ )
91
107
 
92
108
  __all__ = [
93
109
  # Environment utilities
@@ -106,6 +122,7 @@ __all__ = [
106
122
  "InputValidationError",
107
123
  "AsyncExecutionError",
108
124
  "ResourceCleanupError",
125
+ "ExtractionError",
109
126
  # Validation
110
127
  "validate_non_empty_string",
111
128
  "validate_max_length",
@@ -143,6 +160,11 @@ __all__ = [
143
160
  "WebSearchStructure",
144
161
  "VectorSearchStructure",
145
162
  "ValidationResultStructure",
163
+ "AnnotatedDocumentStructure",
164
+ "AttributeStructure",
165
+ "DocumentStructure",
166
+ "ExampleDataStructure",
167
+ "ExtractionStructure",
146
168
  "ResponseBase",
147
169
  "ResponseMessage",
148
170
  "ResponseMessages",
@@ -150,13 +172,13 @@ __all__ = [
150
172
  "ResponseConfiguration",
151
173
  "ResponseRegistry",
152
174
  "get_default_registry",
153
- "parse_tool_arguments",
154
175
  "attach_vector_store",
155
- "serialize_tool_result",
156
176
  "tool_handler_factory",
157
177
  "StructureType",
178
+ "ToolHandler",
179
+ "ToolHandlerRegistration",
158
180
  "ToolSpec",
159
- "build_tool_definitions",
181
+ "build_tool_definition_list",
160
182
  "build_openai_settings",
161
183
  "create_plan",
162
184
  "execute_task",
@@ -169,4 +191,16 @@ __all__ = [
169
191
  "LengthValidator",
170
192
  "OutputValidator",
171
193
  "validate_output",
194
+ # LangExtract
195
+ "LangExtractAdapter",
196
+ "build_langextract_adapter",
197
+ # Extraction helpers
198
+ "DocumentExtractor",
199
+ "EXTRACTOR_CONFIG_AGENT_INSTRUCTIONS",
200
+ "EXTRACTOR_CONFIG_GENERATOR",
201
+ "PROMPT_OPTIMIZER_AGENT_INSTRUCTIONS",
202
+ "generate_document_extractor_config",
203
+ "generate_document_extractor_config_with_agent",
204
+ "optimize_extractor_prompt",
205
+ "optimize_extractor_prompt_with_agent",
172
206
  ]
@@ -5,7 +5,7 @@ from .base import AgentBase
5
5
  from .configuration import AgentConfiguration, AgentRegistry, get_default_registry
6
6
  from ..structure.plan.enum import AgentEnum
7
7
  from .coordinator import CoordinatorAgent
8
- from .runner import run_sync, run_async, run_streamed
8
+ from .runner import run_sync, run_async
9
9
  from .search.base import SearchPlanner, SearchToolAgent, SearchWriter
10
10
  from .summarizer import SummarizerAgent
11
11
  from .translator import TranslatorAgent
@@ -23,7 +23,6 @@ __all__ = [
23
23
  "CoordinatorAgent",
24
24
  "run_sync",
25
25
  "run_async",
26
- "run_streamed",
27
26
  "run_coroutine_agent_sync",
28
27
  "SearchPlanner",
29
28
  "SearchToolAgent",