openai-sdk-helpers 0.0.8__py3-none-any.whl → 0.0.9__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 (64) hide show
  1. openai_sdk_helpers/__init__.py +66 -2
  2. openai_sdk_helpers/agent/__init__.py +8 -4
  3. openai_sdk_helpers/agent/base.py +80 -45
  4. openai_sdk_helpers/agent/config.py +6 -4
  5. openai_sdk_helpers/agent/{project_manager.py → coordination.py} +29 -45
  6. openai_sdk_helpers/agent/prompt_utils.py +7 -1
  7. openai_sdk_helpers/agent/runner.py +67 -141
  8. openai_sdk_helpers/agent/search/__init__.py +33 -0
  9. openai_sdk_helpers/agent/search/base.py +297 -0
  10. openai_sdk_helpers/agent/{vector_search.py → search/vector.py} +89 -157
  11. openai_sdk_helpers/agent/{web_search.py → search/web.py} +77 -156
  12. openai_sdk_helpers/agent/summarizer.py +29 -8
  13. openai_sdk_helpers/agent/translator.py +40 -13
  14. openai_sdk_helpers/agent/validation.py +32 -8
  15. openai_sdk_helpers/async_utils.py +132 -0
  16. openai_sdk_helpers/config.py +74 -36
  17. openai_sdk_helpers/context_manager.py +241 -0
  18. openai_sdk_helpers/enums/__init__.py +9 -1
  19. openai_sdk_helpers/enums/base.py +67 -8
  20. openai_sdk_helpers/environment.py +33 -6
  21. openai_sdk_helpers/errors.py +133 -0
  22. openai_sdk_helpers/logging_config.py +105 -0
  23. openai_sdk_helpers/prompt/__init__.py +10 -71
  24. openai_sdk_helpers/prompt/base.py +172 -0
  25. openai_sdk_helpers/response/__init__.py +35 -3
  26. openai_sdk_helpers/response/base.py +363 -210
  27. openai_sdk_helpers/response/config.py +176 -0
  28. openai_sdk_helpers/response/messages.py +56 -40
  29. openai_sdk_helpers/response/runner.py +77 -33
  30. openai_sdk_helpers/response/tool_call.py +49 -25
  31. openai_sdk_helpers/response/vector_store.py +27 -14
  32. openai_sdk_helpers/retry.py +175 -0
  33. openai_sdk_helpers/streamlit_app/__init__.py +19 -2
  34. openai_sdk_helpers/streamlit_app/app.py +114 -39
  35. openai_sdk_helpers/streamlit_app/config.py +502 -0
  36. openai_sdk_helpers/streamlit_app/streamlit_web_search.py +5 -6
  37. openai_sdk_helpers/structure/__init__.py +69 -3
  38. openai_sdk_helpers/structure/agent_blueprint.py +82 -19
  39. openai_sdk_helpers/structure/base.py +208 -93
  40. openai_sdk_helpers/structure/plan/__init__.py +15 -1
  41. openai_sdk_helpers/structure/plan/enum.py +41 -5
  42. openai_sdk_helpers/structure/plan/plan.py +101 -45
  43. openai_sdk_helpers/structure/plan/task.py +38 -6
  44. openai_sdk_helpers/structure/prompt.py +21 -2
  45. openai_sdk_helpers/structure/responses.py +52 -11
  46. openai_sdk_helpers/structure/summary.py +55 -7
  47. openai_sdk_helpers/structure/validation.py +34 -6
  48. openai_sdk_helpers/structure/vector_search.py +132 -18
  49. openai_sdk_helpers/structure/web_search.py +125 -13
  50. openai_sdk_helpers/types.py +57 -0
  51. openai_sdk_helpers/utils/__init__.py +30 -1
  52. openai_sdk_helpers/utils/core.py +168 -34
  53. openai_sdk_helpers/validation.py +302 -0
  54. openai_sdk_helpers/vector_storage/__init__.py +21 -1
  55. openai_sdk_helpers/vector_storage/cleanup.py +25 -13
  56. openai_sdk_helpers/vector_storage/storage.py +123 -64
  57. openai_sdk_helpers/vector_storage/types.py +20 -19
  58. openai_sdk_helpers-0.0.9.dist-info/METADATA +550 -0
  59. openai_sdk_helpers-0.0.9.dist-info/RECORD +66 -0
  60. openai_sdk_helpers/streamlit_app/configuration.py +0 -324
  61. openai_sdk_helpers-0.0.8.dist-info/METADATA +0 -194
  62. openai_sdk_helpers-0.0.8.dist-info/RECORD +0 -55
  63. {openai_sdk_helpers-0.0.8.dist-info → openai_sdk_helpers-0.0.9.dist-info}/WHEEL +0 -0
  64. {openai_sdk_helpers-0.0.8.dist-info → openai_sdk_helpers-0.0.9.dist-info}/licenses/LICENSE +0 -0
@@ -1,23 +1,63 @@
1
- """Structures for designing and planning new agents."""
1
+ """Agent design and planning structures.
2
2
 
3
- from __future__ import annotations
3
+ This module provides structures for capturing agent requirements and
4
+ converting them into executable plans with validation and deployment steps.
5
+ """
4
6
 
5
- from typing import List, Optional
7
+ from __future__ import annotations
6
8
 
7
- from .plan.enum import AgentEnum
8
9
  from .base import BaseStructure, spec_field
9
- from .plan import TaskStructure, PlanStructure
10
+ from .plan import PlanStructure, TaskStructure
11
+ from .plan.enum import AgentEnum
10
12
 
11
13
 
12
14
  class AgentBlueprint(BaseStructure):
13
- """Capture the core requirements for creating a new agent.
15
+ """Capture requirements for creating a new agent.
16
+
17
+ Defines the complete specification for an agent including mission,
18
+ capabilities, constraints, tools, data sources, and deployment plans.
19
+ Can be converted into an executable plan structure.
20
+
21
+ Attributes
22
+ ----------
23
+ name : str
24
+ Name of the agent to build.
25
+ mission : str
26
+ Primary goal or charter for the agent.
27
+ capabilities : list[str]
28
+ Core skills the agent must perform.
29
+ constraints : list[str]
30
+ Boundaries, policies, or limits the agent must honor.
31
+ required_tools : list[str]
32
+ External tools the agent must integrate.
33
+ data_sources : list[str]
34
+ Data inputs that inform the agent's work.
35
+ evaluation_plan : list[str]
36
+ Checks, tests, or metrics that validate the agent.
37
+ rollout_plan : list[str]
38
+ Deployment or launch steps for the agent.
39
+ guardrails : list[str]
40
+ Safety rules and governance requirements.
41
+ notes : str or None
42
+ Additional context that informs the build.
14
43
 
15
44
  Methods
16
45
  -------
17
46
  summary()
18
47
  Return a human-readable overview of the blueprint.
19
48
  build_plan()
20
- Convert the blueprint into an ordered ``PlanStructure``.
49
+ Convert the blueprint into an ordered PlanStructure.
50
+
51
+ Examples
52
+ --------
53
+ >>> blueprint = AgentBlueprint(
54
+ ... name="ResearchCoordinator",
55
+ ... mission="Coordinate research sprint",
56
+ ... capabilities=["search", "summarize"],
57
+ ... constraints=["max 10 queries per run"]
58
+ ... )
59
+ >>> print(blueprint.summary())
60
+ >>> plan = blueprint.build_plan()
21
61
  """
22
62
 
23
63
  name: str = spec_field(
@@ -32,53 +72,64 @@ class AgentBlueprint(BaseStructure):
32
72
  description="Primary goal or charter for the agent.",
33
73
  examples=["Coordinate a research sprint", "Score model outputs"],
34
74
  )
35
- capabilities: List[str] = spec_field(
75
+ capabilities: list[str] = spec_field(
36
76
  "capabilities",
37
77
  default_factory=list,
38
78
  description="Core skills the agent must perform.",
39
79
  )
40
- constraints: List[str] = spec_field(
80
+ constraints: list[str] = spec_field(
41
81
  "constraints",
42
82
  default_factory=list,
43
83
  description="Boundaries, policies, or limits the agent must honor.",
44
84
  )
45
- required_tools: List[str] = spec_field(
85
+ required_tools: list[str] = spec_field(
46
86
  "required_tools",
47
87
  default_factory=list,
48
88
  description="External tools the agent must integrate.",
49
89
  )
50
- data_sources: List[str] = spec_field(
90
+ data_sources: list[str] = spec_field(
51
91
  "data_sources",
52
92
  default_factory=list,
53
93
  description="Data inputs that inform the agent's work.",
54
94
  )
55
- evaluation_plan: List[str] = spec_field(
95
+ evaluation_plan: list[str] = spec_field(
56
96
  "evaluation_plan",
57
97
  default_factory=list,
58
98
  description="Checks, tests, or metrics that validate the agent.",
59
99
  )
60
- rollout_plan: List[str] = spec_field(
100
+ rollout_plan: list[str] = spec_field(
61
101
  "rollout_plan",
62
102
  default_factory=list,
63
103
  description="Deployment or launch steps for the agent.",
64
104
  )
65
- guardrails: List[str] = spec_field(
105
+ guardrails: list[str] = spec_field(
66
106
  "guardrails",
67
107
  default_factory=list,
68
108
  description="Safety rules and governance requirements.",
69
109
  )
70
- notes: Optional[str] = spec_field(
110
+ notes: str | None = spec_field(
71
111
  "notes",
72
112
  description="Additional context that informs the build.",
73
113
  )
74
114
 
75
115
  def summary(self) -> str:
76
- """Return a multi-line summary highlighting key requirements.
116
+ """Return a human-readable overview of the blueprint.
117
+
118
+ Formats all blueprint fields into a multi-line summary highlighting
119
+ key requirements and specifications.
77
120
 
78
121
  Returns
79
122
  -------
80
123
  str
81
- Human-readable description of the blueprint fields.
124
+ Multi-line formatted description of blueprint fields.
125
+
126
+ Examples
127
+ --------
128
+ >>> print(blueprint.summary())
129
+ Agent name: ResearchCoordinator
130
+ Mission: Coordinate research sprint
131
+ Capabilities: search, summarize
132
+ ...
82
133
  """
83
134
 
84
135
  def _format(label: str, values: list[str]) -> str:
@@ -101,12 +152,24 @@ class AgentBlueprint(BaseStructure):
101
152
  return "\n".join(lines)
102
153
 
103
154
  def build_plan(self) -> PlanStructure:
104
- """Translate the blueprint into a structured plan of execution steps.
155
+ """Translate the blueprint into a structured execution plan.
156
+
157
+ Converts the agent requirements into an ordered sequence of tasks
158
+ representing the complete build lifecycle: planning, design,
159
+ implementation, validation, evaluation, and deployment.
105
160
 
106
161
  Returns
107
162
  -------
108
163
  PlanStructure
109
- Ordered list of tasks representing the build lifecycle.
164
+ Ordered list of tasks with agent types and prompts.
165
+
166
+ Examples
167
+ --------
168
+ >>> plan = blueprint.build_plan()
169
+ >>> len(plan.tasks)
170
+ 6
171
+ >>> plan.tasks[0].task_type
172
+ <AgentEnum.PLANNER: 'MetaPlanner'>
110
173
  """
111
174
  tasks = [
112
175
  TaskStructure(