openai-sdk-helpers 0.0.2__tar.gz
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/.github/dependabot.yml +10 -0
- openai_sdk_helpers-0.0.2/.github/workflows/ci.yml +44 -0
- openai_sdk_helpers-0.0.2/.github/workflows/python-publish.yml +39 -0
- openai_sdk_helpers-0.0.2/.gitignore +207 -0
- openai_sdk_helpers-0.0.2/AGENTS.md +82 -0
- openai_sdk_helpers-0.0.2/LICENSE +21 -0
- openai_sdk_helpers-0.0.2/PKG-INFO +137 -0
- openai_sdk_helpers-0.0.2/README.md +121 -0
- openai_sdk_helpers-0.0.2/pyproject.toml +56 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/__init__.py +34 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/agent/__init__.py +23 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/agent/base.py +432 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/agent/config.py +66 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/agent/project_manager.py +416 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/agent/runner.py +117 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/agent/utils.py +47 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/agent/vector_search.py +418 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/agent/web_search.py +404 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/config.py +141 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/enums/__init__.py +7 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/enums/base.py +17 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/environment.py +27 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/prompt/__init__.py +77 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/response/__init__.py +16 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/response/base.py +477 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/response/messages.py +211 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/response/runner.py +42 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/response/tool_call.py +70 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/structure/__init__.py +57 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/structure/base.py +591 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/structure/plan/__init__.py +13 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/structure/plan/enum.py +48 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/structure/plan/plan.py +104 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/structure/plan/task.py +122 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/structure/prompt.py +24 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/structure/responses.py +148 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/structure/summary.py +65 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/structure/vector_search.py +82 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/structure/web_search.py +46 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/utils/__init__.py +13 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/utils/core.py +208 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/vector_storage/__init__.py +15 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/vector_storage/cleanup.py +91 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/vector_storage/storage.py +501 -0
- openai_sdk_helpers-0.0.2/src/openai_sdk_helpers/vector_storage/types.py +58 -0
- openai_sdk_helpers-0.0.2/tests/agent/test_agent_base.py +116 -0
- openai_sdk_helpers-0.0.2/tests/agent/test_agent_runner.py +45 -0
- openai_sdk_helpers-0.0.2/tests/agent/test_agent_utils.py +27 -0
- openai_sdk_helpers-0.0.2/tests/agent/test_project_manager.py +159 -0
- openai_sdk_helpers-0.0.2/tests/conftest.py +12 -0
- openai_sdk_helpers-0.0.2/tests/response/test_response_base.py +31 -0
- openai_sdk_helpers-0.0.2/tests/response/test_response_base_unit.py +63 -0
- openai_sdk_helpers-0.0.2/tests/structure/test_structure_base.py +148 -0
- openai_sdk_helpers-0.0.2/tests/test_config.py +58 -0
- openai_sdk_helpers-0.0.2/tests/test_imports.py +21 -0
- openai_sdk_helpers-0.0.2/tests/test_integration.py +57 -0
- openai_sdk_helpers-0.0.2/tests/test_prompt_renderer.py +26 -0
- openai_sdk_helpers-0.0.2/tests/test_utils.py +108 -0
- openai_sdk_helpers-0.0.2/tests/test_vector_types.py +35 -0
- openai_sdk_helpers-0.0.2/tests/vector_storage/test_cleanup.py +116 -0
- openai_sdk_helpers-0.0.2/tests/vector_storage/test_storage.py +163 -0
- openai_sdk_helpers-0.0.2/tests/vector_storage/test_vector_storage.py +64 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
|
3
|
+
# Please see the documentation for all configuration options:
|
|
4
|
+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
5
|
+
version: 2
|
|
6
|
+
updates:
|
|
7
|
+
- package-ecosystem: "" # See documentation for possible values
|
|
8
|
+
directory: "/" # Location of package manifests
|
|
9
|
+
schedule:
|
|
10
|
+
interval: "weekly"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Python CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v3
|
|
21
|
+
|
|
22
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
23
|
+
uses: actions/setup-python@v4
|
|
24
|
+
with:
|
|
25
|
+
python-version: ${{ matrix.python-version }}
|
|
26
|
+
cache: "pip"
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: |
|
|
30
|
+
python -m pip install --upgrade pip
|
|
31
|
+
pip install -e . --group dev
|
|
32
|
+
|
|
33
|
+
- name: Run style checks
|
|
34
|
+
run: |
|
|
35
|
+
pydocstyle .
|
|
36
|
+
black --check .
|
|
37
|
+
|
|
38
|
+
- name: Run static type analysis
|
|
39
|
+
run: |
|
|
40
|
+
pyright .
|
|
41
|
+
|
|
42
|
+
- name: Run tests with coverage
|
|
43
|
+
run: |
|
|
44
|
+
pytest -q --cov=src --cov-report=term-missing --cov-fail-under=70
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# This workflow will upload a Python Package using Twine when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
|
3
|
+
|
|
4
|
+
# This workflow uses actions that are not certified by GitHub.
|
|
5
|
+
# They are provided by a third-party and are governed by
|
|
6
|
+
# separate terms of service, privacy policy, and support
|
|
7
|
+
# documentation.
|
|
8
|
+
|
|
9
|
+
name: Upload Python Package
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
release:
|
|
13
|
+
types: [published]
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
deploy:
|
|
20
|
+
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v3
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v3
|
|
27
|
+
with:
|
|
28
|
+
python-version: '3.x'
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: |
|
|
31
|
+
python -m pip install --upgrade pip
|
|
32
|
+
pip install build
|
|
33
|
+
- name: Build package
|
|
34
|
+
run: python -m build
|
|
35
|
+
- name: Publish package
|
|
36
|
+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
|
|
37
|
+
with:
|
|
38
|
+
user: __token__
|
|
39
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.envrc
|
|
140
|
+
.venv
|
|
141
|
+
env/
|
|
142
|
+
venv/
|
|
143
|
+
ENV/
|
|
144
|
+
env.bak/
|
|
145
|
+
venv.bak/
|
|
146
|
+
|
|
147
|
+
# Spyder project settings
|
|
148
|
+
.spyderproject
|
|
149
|
+
.spyproject
|
|
150
|
+
|
|
151
|
+
# Rope project settings
|
|
152
|
+
.ropeproject
|
|
153
|
+
|
|
154
|
+
# mkdocs documentation
|
|
155
|
+
/site
|
|
156
|
+
|
|
157
|
+
# mypy
|
|
158
|
+
.mypy_cache/
|
|
159
|
+
.dmypy.json
|
|
160
|
+
dmypy.json
|
|
161
|
+
|
|
162
|
+
# Pyre type checker
|
|
163
|
+
.pyre/
|
|
164
|
+
|
|
165
|
+
# pytype static type analyzer
|
|
166
|
+
.pytype/
|
|
167
|
+
|
|
168
|
+
# Cython debug symbols
|
|
169
|
+
cython_debug/
|
|
170
|
+
|
|
171
|
+
# PyCharm
|
|
172
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
+
#.idea/
|
|
177
|
+
|
|
178
|
+
# Abstra
|
|
179
|
+
# Abstra is an AI-powered process automation framework.
|
|
180
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
+
# Learn more at https://abstra.io/docs
|
|
182
|
+
.abstra/
|
|
183
|
+
|
|
184
|
+
# Visual Studio Code
|
|
185
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
+
# .vscode/
|
|
190
|
+
|
|
191
|
+
# Ruff stuff:
|
|
192
|
+
.ruff_cache/
|
|
193
|
+
|
|
194
|
+
# PyPI configuration file
|
|
195
|
+
.pypirc
|
|
196
|
+
|
|
197
|
+
# Cursor
|
|
198
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
+
.cursorignore
|
|
202
|
+
.cursorindexingignore
|
|
203
|
+
|
|
204
|
+
# Marimo
|
|
205
|
+
marimo/_static/
|
|
206
|
+
marimo/_lsp/
|
|
207
|
+
__marimo__/
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
These instructions apply to any automated agent contributing to this repository.
|
|
4
|
+
|
|
5
|
+
## 1. Code Style
|
|
6
|
+
|
|
7
|
+
- Use standard PEP 8 formatting for all Python code.
|
|
8
|
+
- Write commit messages in the imperative mood (e.g., "Add feature" not "Added feature").
|
|
9
|
+
- Keep the implementation Pythonic and maintainable.
|
|
10
|
+
|
|
11
|
+
## 2. Docstring Style
|
|
12
|
+
|
|
13
|
+
- Use **NumPy-style** docstrings following [PEP 257](https://peps.python.org/pep-0257/) conventions.
|
|
14
|
+
- **Do not** use `:param` / `:type` syntax (reST/Sphinx style) or Google-style `Args`.
|
|
15
|
+
- Always include type hints in function signatures.
|
|
16
|
+
- Begin docstrings with a **short, one-line summary**, followed by a blank line and an optional extended description.
|
|
17
|
+
- Use the following NumPy-style sections:
|
|
18
|
+
- `Parameters`
|
|
19
|
+
- `Returns`
|
|
20
|
+
- `Raises`
|
|
21
|
+
- `Examples`
|
|
22
|
+
- Document all public classes, methods, and functions.
|
|
23
|
+
- **For classes, the main docstring should include a `Methods` section summarizing each public method and its one-line description.**
|
|
24
|
+
- For optional parameters, note the default value in the description.
|
|
25
|
+
- Use imperative present tense and active voice (“Return…”, “Fetch…”).
|
|
26
|
+
|
|
27
|
+
## 3. Code Quality and Testing
|
|
28
|
+
|
|
29
|
+
Before running tests, install the development dependencies:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Install the package with dev dependency group (PEP 735)
|
|
33
|
+
pip install -e . --group dev
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
To ensure your changes will pass the automated checks in our Continuous Integration (CI) pipeline, run the following commands locally before committing. All checks must pass.
|
|
37
|
+
|
|
38
|
+
**Style Checks:**
|
|
39
|
+
```bash
|
|
40
|
+
pydocstyle src
|
|
41
|
+
black --check .
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Static Type Analysis:**
|
|
45
|
+
```bash
|
|
46
|
+
pyright src
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Unit Tests and Coverage:**
|
|
50
|
+
```bash
|
|
51
|
+
pytest -q --cov=src --cov-report=term-missing --cov-fail-under=70
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 4. Directory Layout
|
|
55
|
+
|
|
56
|
+
- Production code lives in `src/`.
|
|
57
|
+
- Tests live in `tests/`.
|
|
58
|
+
- Keep imports relative within the package (e.g., `from rda_bundle...`).
|
|
59
|
+
|
|
60
|
+
## 5. Pull Request Messages
|
|
61
|
+
|
|
62
|
+
Each pull request should include:
|
|
63
|
+
|
|
64
|
+
1. **Summary** – brief description of the change.
|
|
65
|
+
2. **Testing** – commands run and confirmation that the tests passed.
|
|
66
|
+
|
|
67
|
+
Example PR body:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
### Summary
|
|
71
|
+
- add new helper to utils.list
|
|
72
|
+
- expand tests for list chunking
|
|
73
|
+
|
|
74
|
+
### Testing
|
|
75
|
+
- `pytest` (all tests passed)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 6. General Guidelines
|
|
79
|
+
|
|
80
|
+
- Avoid pushing large data files to the repository.
|
|
81
|
+
- Prefer small, focused commits over sweeping changes.
|
|
82
|
+
- Update or add tests whenever you modify functionality.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 fatmambo33
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: openai-sdk-helpers
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Summary: Composable helpers for OpenAI SDK agents, prompts, and storage
|
|
5
|
+
Author: openai-sdk-helpers maintainers
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Requires-Dist: jinja2
|
|
10
|
+
Requires-Dist: openai
|
|
11
|
+
Requires-Dist: openai-agents
|
|
12
|
+
Requires-Dist: pydantic<3,>=2.7
|
|
13
|
+
Requires-Dist: python-dotenv
|
|
14
|
+
Requires-Dist: typing-extensions<5,>=4.15.0
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
<div align="center">
|
|
18
|
+
|
|
19
|
+
# openai-sdk-helpers
|
|
20
|
+
|
|
21
|
+
Shared primitives for composing OpenAI agent workflows: structures, response
|
|
22
|
+
handling, prompt rendering, and reusable agent factories.
|
|
23
|
+
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
## Overview
|
|
27
|
+
|
|
28
|
+
`openai-sdk-helpers` packages the common building blocks required to assemble agent-driven
|
|
29
|
+
applications. The library intentionally focuses on reusable primitives—data
|
|
30
|
+
structures, configuration helpers, and orchestration utilities—while leaving
|
|
31
|
+
application-specific prompts and tools to the consuming project.
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
- **Agent wrappers** for OpenAI Agents SDK with synchronous and asynchronous
|
|
36
|
+
entry points.
|
|
37
|
+
- **Prompt rendering** powered by Jinja for dynamic agent instructions.
|
|
38
|
+
- **Typed structures** for prompts, responses, and search workflows to ensure
|
|
39
|
+
predictable inputs and outputs.
|
|
40
|
+
- **Vector and web search flows** that coordinate planning, execution, and
|
|
41
|
+
reporting.
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
|
|
45
|
+
Install the package directly from PyPI to reuse it across projects:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install openai-sdk-helpers
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
For local development, install with editable sources and the optional dev
|
|
52
|
+
dependencies:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install -e .
|
|
56
|
+
pip install -e . --group dev
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Quickstart
|
|
60
|
+
|
|
61
|
+
Create a basic vector search workflow by wiring your own prompt templates and
|
|
62
|
+
preferred model configuration:
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from pathlib import Path
|
|
66
|
+
|
|
67
|
+
from openai_sdk_helpers.agent.vector_search import VectorSearch
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
prompts = Path("./prompts")
|
|
71
|
+
vector_search = VectorSearch(prompt_dir=prompts, default_model="gpt-4o-mini")
|
|
72
|
+
|
|
73
|
+
report = vector_search.run_agent_sync("Explain quantum entanglement for beginners")
|
|
74
|
+
print(report.report)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
You can plug in your own prompt templates by placing matching `.jinja` files in
|
|
78
|
+
the provided `prompt_dir` and naming them after the agent (for example,
|
|
79
|
+
`vector_planner.jinja`).
|
|
80
|
+
|
|
81
|
+
### Centralized OpenAI configuration
|
|
82
|
+
|
|
83
|
+
`openai-sdk-helpers` ships with a lightweight `OpenAISettings` helper so projects can share
|
|
84
|
+
consistent authentication, routing, and model defaults when using the OpenAI
|
|
85
|
+
SDK:
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
from openai_sdk_helpers import OpenAISettings
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
# Load from environment variables or a local .env file
|
|
92
|
+
settings = OpenAISettings.from_env()
|
|
93
|
+
client = settings.create_client()
|
|
94
|
+
|
|
95
|
+
# Reuse the default model across agents
|
|
96
|
+
vector_search = VectorSearch(
|
|
97
|
+
prompt_dir=prompts, default_model=settings.default_model or "gpt-4o-mini"
|
|
98
|
+
)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The helper reads `OPENAI_API_KEY`, `OPENAI_ORG_ID`, `OPENAI_PROJECT_ID`,
|
|
102
|
+
`OPENAI_BASE_URL`, and `OPENAI_MODEL` by default but supports overrides for
|
|
103
|
+
custom deployments.
|
|
104
|
+
|
|
105
|
+
## Development
|
|
106
|
+
|
|
107
|
+
The repository is configured for a lightweight Python development workflow.
|
|
108
|
+
Before opening a pull request, format and validate your changes locally:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Style and formatting
|
|
112
|
+
pydocstyle src
|
|
113
|
+
black --check .
|
|
114
|
+
|
|
115
|
+
# Static type checking
|
|
116
|
+
pyright src
|
|
117
|
+
|
|
118
|
+
# Unit tests with coverage
|
|
119
|
+
pytest -q --cov=src --cov-report=term-missing --cov-fail-under=70
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Project Structure
|
|
123
|
+
|
|
124
|
+
- `src/openai_sdk_helpers/agent`: Agent factories, orchestration helpers, and search
|
|
125
|
+
workflows.
|
|
126
|
+
- `src/openai_sdk_helpers/prompt`: Prompt rendering utilities backed by Jinja.
|
|
127
|
+
- `src/openai_sdk_helpers/response`: Response parsing and transformation helpers.
|
|
128
|
+
- `src/openai_sdk_helpers/structure`: Typed data structures shared across workflows.
|
|
129
|
+
- `src/openai_sdk_helpers/vector_storage`: Minimal vector store abstraction.
|
|
130
|
+
- `tests/`: Unit tests covering core modules and structures.
|
|
131
|
+
|
|
132
|
+
## Contributing
|
|
133
|
+
|
|
134
|
+
Contributions are welcome! Please accompany functional changes with relevant
|
|
135
|
+
tests and ensure all quality gates pass. Follow the NumPy-style docstring
|
|
136
|
+
conventions outlined in `AGENTS.md` to keep the codebase consistent.
|
|
137
|
+
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# openai-sdk-helpers
|
|
4
|
+
|
|
5
|
+
Shared primitives for composing OpenAI agent workflows: structures, response
|
|
6
|
+
handling, prompt rendering, and reusable agent factories.
|
|
7
|
+
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
`openai-sdk-helpers` packages the common building blocks required to assemble agent-driven
|
|
13
|
+
applications. The library intentionally focuses on reusable primitives—data
|
|
14
|
+
structures, configuration helpers, and orchestration utilities—while leaving
|
|
15
|
+
application-specific prompts and tools to the consuming project.
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- **Agent wrappers** for OpenAI Agents SDK with synchronous and asynchronous
|
|
20
|
+
entry points.
|
|
21
|
+
- **Prompt rendering** powered by Jinja for dynamic agent instructions.
|
|
22
|
+
- **Typed structures** for prompts, responses, and search workflows to ensure
|
|
23
|
+
predictable inputs and outputs.
|
|
24
|
+
- **Vector and web search flows** that coordinate planning, execution, and
|
|
25
|
+
reporting.
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
Install the package directly from PyPI to reuse it across projects:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install openai-sdk-helpers
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
For local development, install with editable sources and the optional dev
|
|
36
|
+
dependencies:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install -e .
|
|
40
|
+
pip install -e . --group dev
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Quickstart
|
|
44
|
+
|
|
45
|
+
Create a basic vector search workflow by wiring your own prompt templates and
|
|
46
|
+
preferred model configuration:
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from pathlib import Path
|
|
50
|
+
|
|
51
|
+
from openai_sdk_helpers.agent.vector_search import VectorSearch
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
prompts = Path("./prompts")
|
|
55
|
+
vector_search = VectorSearch(prompt_dir=prompts, default_model="gpt-4o-mini")
|
|
56
|
+
|
|
57
|
+
report = vector_search.run_agent_sync("Explain quantum entanglement for beginners")
|
|
58
|
+
print(report.report)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
You can plug in your own prompt templates by placing matching `.jinja` files in
|
|
62
|
+
the provided `prompt_dir` and naming them after the agent (for example,
|
|
63
|
+
`vector_planner.jinja`).
|
|
64
|
+
|
|
65
|
+
### Centralized OpenAI configuration
|
|
66
|
+
|
|
67
|
+
`openai-sdk-helpers` ships with a lightweight `OpenAISettings` helper so projects can share
|
|
68
|
+
consistent authentication, routing, and model defaults when using the OpenAI
|
|
69
|
+
SDK:
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
from openai_sdk_helpers import OpenAISettings
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
# Load from environment variables or a local .env file
|
|
76
|
+
settings = OpenAISettings.from_env()
|
|
77
|
+
client = settings.create_client()
|
|
78
|
+
|
|
79
|
+
# Reuse the default model across agents
|
|
80
|
+
vector_search = VectorSearch(
|
|
81
|
+
prompt_dir=prompts, default_model=settings.default_model or "gpt-4o-mini"
|
|
82
|
+
)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The helper reads `OPENAI_API_KEY`, `OPENAI_ORG_ID`, `OPENAI_PROJECT_ID`,
|
|
86
|
+
`OPENAI_BASE_URL`, and `OPENAI_MODEL` by default but supports overrides for
|
|
87
|
+
custom deployments.
|
|
88
|
+
|
|
89
|
+
## Development
|
|
90
|
+
|
|
91
|
+
The repository is configured for a lightweight Python development workflow.
|
|
92
|
+
Before opening a pull request, format and validate your changes locally:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Style and formatting
|
|
96
|
+
pydocstyle src
|
|
97
|
+
black --check .
|
|
98
|
+
|
|
99
|
+
# Static type checking
|
|
100
|
+
pyright src
|
|
101
|
+
|
|
102
|
+
# Unit tests with coverage
|
|
103
|
+
pytest -q --cov=src --cov-report=term-missing --cov-fail-under=70
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Project Structure
|
|
107
|
+
|
|
108
|
+
- `src/openai_sdk_helpers/agent`: Agent factories, orchestration helpers, and search
|
|
109
|
+
workflows.
|
|
110
|
+
- `src/openai_sdk_helpers/prompt`: Prompt rendering utilities backed by Jinja.
|
|
111
|
+
- `src/openai_sdk_helpers/response`: Response parsing and transformation helpers.
|
|
112
|
+
- `src/openai_sdk_helpers/structure`: Typed data structures shared across workflows.
|
|
113
|
+
- `src/openai_sdk_helpers/vector_storage`: Minimal vector store abstraction.
|
|
114
|
+
- `tests/`: Unit tests covering core modules and structures.
|
|
115
|
+
|
|
116
|
+
## Contributing
|
|
117
|
+
|
|
118
|
+
Contributions are welcome! Please accompany functional changes with relevant
|
|
119
|
+
tests and ensure all quality gates pass. Follow the NumPy-style docstring
|
|
120
|
+
conventions outlined in `AGENTS.md` to keep the codebase consistent.
|
|
121
|
+
|