swarmauri_llm_openai 0.1.1.dev3__tar.gz → 0.11.0.dev5__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.
- swarmauri_llm_openai-0.11.0.dev5/PKG-INFO +271 -0
- swarmauri_llm_openai-0.11.0.dev5/README.md +237 -0
- {swarmauri_llm_openai-0.1.1.dev3 → swarmauri_llm_openai-0.11.0.dev5}/pyproject.toml +29 -4
- swarmauri_llm_openai-0.11.0.dev5/swarmauri_llm_openai/OpenAIAudioTTS.py +14 -0
- swarmauri_llm_openai-0.11.0.dev5/swarmauri_llm_openai/OpenAIVLM.py +147 -0
- {swarmauri_llm_openai-0.1.1.dev3 → swarmauri_llm_openai-0.11.0.dev5}/swarmauri_llm_openai/__init__.py +2 -0
- swarmauri_llm_openai-0.1.1.dev3/PKG-INFO +0 -91
- swarmauri_llm_openai-0.1.1.dev3/README.md +0 -62
- swarmauri_llm_openai-0.1.1.dev3/swarmauri_llm_openai/OpenAIAudioTTS.py +0 -3
- {swarmauri_llm_openai-0.1.1.dev3 → swarmauri_llm_openai-0.11.0.dev5}/LICENSE +0 -0
- {swarmauri_llm_openai-0.1.1.dev3 → swarmauri_llm_openai-0.11.0.dev5}/swarmauri_llm_openai/OpenAIAudio.py +0 -0
- {swarmauri_llm_openai-0.1.1.dev3 → swarmauri_llm_openai-0.11.0.dev5}/swarmauri_llm_openai/OpenAIModel.py +0 -0
- {swarmauri_llm_openai-0.1.1.dev3 → swarmauri_llm_openai-0.11.0.dev5}/swarmauri_llm_openai/OpenAIReasonModel.py +0 -0
- {swarmauri_llm_openai-0.1.1.dev3 → swarmauri_llm_openai-0.11.0.dev5}/swarmauri_llm_openai/OpenAIToolModel.py +0 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: swarmauri_llm_openai
|
|
3
|
+
Version: 0.11.0.dev5
|
|
4
|
+
Summary: Provider-specific Swarmauri import package for OpenAI chat, reasoning, tool-calling, transcription, and text-to-speech workflows.
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: swarmauri,llm,swarmauri llm,openai,openai api,chat completions,reasoning model,tool calling,function calling,speech to text,transcription,text to speech,tts,audio generation,gpt-5,gpt-4o,large language model,generative ai,model
|
|
8
|
+
Author: Jacob Stewart
|
|
9
|
+
Author-email: jacob@swarmauri.com
|
|
10
|
+
Requires-Python: >=3.10,<3.15
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Natural Language :: English
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
21
|
+
Classifier: Programming Language :: Python
|
|
22
|
+
Classifier: Programming Language :: Python :: 3
|
|
23
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
29
|
+
Requires-Dist: swarmauri_base
|
|
30
|
+
Requires-Dist: swarmauri_core
|
|
31
|
+
Requires-Dist: swarmauri_standard (>=0.11.0.dev12,<0.12)
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
<p align="center">
|
|
37
|
+
<a href="https://pepy.tech/project/swarmauri_llm_openai/">
|
|
38
|
+
<img src="https://static.pepy.tech/badge/swarmauri_llm_openai/month" alt="PyPI - Downloads"/></a>
|
|
39
|
+
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_openai/">
|
|
40
|
+
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_openai.svg"/></a>
|
|
41
|
+
<a href="https://pypi.org/project/swarmauri_llm_openai/">
|
|
42
|
+
<img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
|
|
43
|
+
<a href="https://pypi.org/project/swarmauri_llm_openai/">
|
|
44
|
+
<img src="https://img.shields.io/pypi/l/swarmauri_llm_openai" alt="PyPI - License"/></a>
|
|
45
|
+
<a href="https://pypi.org/project/swarmauri_llm_openai/">
|
|
46
|
+
<img src="https://img.shields.io/pypi/v/swarmauri_llm_openai?label=swarmauri_llm_openai&color=green" alt="PyPI - swarmauri_llm_openai"/></a>
|
|
47
|
+
<a href="https://discord.gg/N4UpBuQv8T">
|
|
48
|
+
<img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
|
|
49
|
+
|
|
50
|
+
# Swarmauri OpenAI LLM
|
|
51
|
+
|
|
52
|
+
`swarmauri_llm_openai` provides provider-specific Swarmauri imports for OpenAI chat, reasoning, tool-calling, audio transcription, and text-to-speech workflows. The package exposes `OpenAIModel`, `OpenAIReasonModel`, `OpenAIToolModel`, `OpenAIAudio`, and `OpenAIAudioTTS` as direct provider-package imports while preserving the shared runtime implementations in `swarmauri_standard`.
|
|
53
|
+
|
|
54
|
+
The repo currently tracks OpenAI chat model families including `gpt-5.x`, `gpt-4.1`, `gpt-4o`, `gpt-4-turbo`, `gpt-oss`, reasoning families including `o1`, `o3`, and `o4-mini`, audio transcription models including `whisper-1` and `gpt-4o-*transcribe`, and text-to-speech models including `tts-1`, `tts-1-hd`, and `gpt-4o-mini-tts`.
|
|
55
|
+
|
|
56
|
+
## Why Use This Package?
|
|
57
|
+
|
|
58
|
+
- Keep OpenAI-specific imports explicit in Swarmauri applications.
|
|
59
|
+
- Use separate adapters for standard chat, reasoning, tool-calling, transcription, and TTS workflows.
|
|
60
|
+
- Reuse Swarmauri `Conversation`, toolkit, and component semantics across the OpenAI surface area.
|
|
61
|
+
- Track current OpenAI model families through one provider package boundary.
|
|
62
|
+
|
|
63
|
+
## FAQ
|
|
64
|
+
|
|
65
|
+
### What does `swarmauri_llm_openai` install?
|
|
66
|
+
|
|
67
|
+
It installs `OpenAIModel`, `OpenAIReasonModel`, `OpenAIToolModel`, `OpenAIAudio`, and `OpenAIAudioTTS`.
|
|
68
|
+
|
|
69
|
+
### Which OpenAI capabilities are wrapped today?
|
|
70
|
+
|
|
71
|
+
The package covers standard chat completions, reasoning-oriented chat models, tool-calling workflows, audio transcription, and text-to-speech generation.
|
|
72
|
+
|
|
73
|
+
### What is the difference between `OpenAIModel` and `OpenAIReasonModel`?
|
|
74
|
+
|
|
75
|
+
`OpenAIModel` targets general chat model families such as `gpt-5.x`, `gpt-4.1`, and `gpt-4o`. `OpenAIReasonModel` targets the reasoning families tracked in the repo, including `o1`, `o3`, and `o4-mini` variants.
|
|
76
|
+
|
|
77
|
+
### When should I use `OpenAIToolModel`?
|
|
78
|
+
|
|
79
|
+
Use it when the application needs OpenAI tool calling through a Swarmauri toolkit. It is the provider-specific surface for tool-backed agent workflows.
|
|
80
|
+
|
|
81
|
+
### What do `OpenAIAudio` and `OpenAIAudioTTS` do?
|
|
82
|
+
|
|
83
|
+
`OpenAIAudio` wraps audio transcription workflows. `OpenAIAudioTTS` wraps text-to-speech generation workflows.
|
|
84
|
+
|
|
85
|
+
### Where should I verify current models and pricing?
|
|
86
|
+
|
|
87
|
+
Use the OpenAI section in [docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md](../../../docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md), which points to the current OpenAI models, function-calling, audio, TTS, and pricing documentation.
|
|
88
|
+
|
|
89
|
+
## Features
|
|
90
|
+
|
|
91
|
+
- `OpenAIModel` for sync, async, streaming, and batch chat completion workflows.
|
|
92
|
+
- `OpenAIReasonModel` for reasoning-model workflows across the repo-tracked `o*` families.
|
|
93
|
+
- `OpenAIToolModel` for toolkit-backed tool-calling and agent execution flows.
|
|
94
|
+
- `OpenAIAudio` for speech-to-text workflows against the tracked OpenAI transcription models.
|
|
95
|
+
- `OpenAIAudioTTS` for text-to-speech workflows against the tracked OpenAI TTS models.
|
|
96
|
+
- Compatibility with Python 3.10, 3.11, 3.12, 3.13, and 3.14.
|
|
97
|
+
|
|
98
|
+
## Installation
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
uv add swarmauri_llm_openai
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pip install swarmauri_llm_openai
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Usage
|
|
109
|
+
|
|
110
|
+
Set `OPENAI_API_KEY` in your environment before creating any of the OpenAI adapters.
|
|
111
|
+
|
|
112
|
+
### Chat Completion
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
import os
|
|
116
|
+
|
|
117
|
+
from swarmauri_llm_openai import OpenAIModel
|
|
118
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
119
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
120
|
+
|
|
121
|
+
conversation = Conversation()
|
|
122
|
+
conversation.add_message(HumanMessage(content="Summarize Swarmauri in two sentences."))
|
|
123
|
+
|
|
124
|
+
model = OpenAIModel(
|
|
125
|
+
api_key=os.environ["OPENAI_API_KEY"],
|
|
126
|
+
name="gpt-5.5",
|
|
127
|
+
)
|
|
128
|
+
result = model.predict(conversation=conversation)
|
|
129
|
+
|
|
130
|
+
print(result.get_last().content)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Reasoning Model
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
import os
|
|
137
|
+
|
|
138
|
+
from swarmauri_llm_openai import OpenAIReasonModel
|
|
139
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
140
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
141
|
+
|
|
142
|
+
conversation = Conversation()
|
|
143
|
+
conversation.add_message(HumanMessage(content="Reason through a release rollback plan step by step."))
|
|
144
|
+
|
|
145
|
+
model = OpenAIReasonModel(
|
|
146
|
+
api_key=os.environ["OPENAI_API_KEY"],
|
|
147
|
+
name="o3",
|
|
148
|
+
)
|
|
149
|
+
result = model.predict(conversation=conversation)
|
|
150
|
+
|
|
151
|
+
print(result.get_last().content)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Tool Calling
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
import os
|
|
158
|
+
|
|
159
|
+
from swarmauri_llm_openai import OpenAIToolModel
|
|
160
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
161
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
162
|
+
from swarmauri_standard.toolkits.Toolkit import Toolkit
|
|
163
|
+
from swarmauri_standard.tools.AdditionTool import AdditionTool
|
|
164
|
+
|
|
165
|
+
conversation = Conversation()
|
|
166
|
+
conversation.add_message(HumanMessage(content="What is 19 + 23? Use the tool."))
|
|
167
|
+
|
|
168
|
+
toolkit = Toolkit(tools={"add": AdditionTool()})
|
|
169
|
+
|
|
170
|
+
model = OpenAIToolModel(
|
|
171
|
+
api_key=os.environ["OPENAI_API_KEY"],
|
|
172
|
+
name="gpt-5.5",
|
|
173
|
+
)
|
|
174
|
+
result = model.predict(
|
|
175
|
+
conversation=conversation,
|
|
176
|
+
toolkit=toolkit,
|
|
177
|
+
tool_choice="auto",
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
print(result.get_last().content)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Audio Transcription
|
|
184
|
+
|
|
185
|
+
```python
|
|
186
|
+
import os
|
|
187
|
+
|
|
188
|
+
from swarmauri_llm_openai import OpenAIAudio
|
|
189
|
+
|
|
190
|
+
audio_model = OpenAIAudio(
|
|
191
|
+
api_key=os.environ["OPENAI_API_KEY"],
|
|
192
|
+
name="whisper-1",
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
text = audio_model.predict("tests/static/test.mp3")
|
|
196
|
+
print(text)
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Text To Speech
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
import os
|
|
203
|
+
|
|
204
|
+
from swarmauri_llm_openai import OpenAIAudioTTS
|
|
205
|
+
|
|
206
|
+
tts_model = OpenAIAudioTTS(
|
|
207
|
+
api_key=os.environ["OPENAI_API_KEY"],
|
|
208
|
+
name="tts-1",
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
audio_bytes = tts_model.predict("Swarmauri turns provider APIs into composable components.")
|
|
212
|
+
print(len(audio_bytes))
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Examples
|
|
216
|
+
|
|
217
|
+
- Use `OpenAIModel` for general-purpose chat completion workflows.
|
|
218
|
+
- Use `OpenAIReasonModel` when you want the reasoning-model family explicitly.
|
|
219
|
+
- Use `OpenAIToolModel` when an agent needs toolkit-backed tool invocation.
|
|
220
|
+
- Use `OpenAIAudio` and `OpenAIAudioTTS` when the workflow crosses text, speech, and audio generation boundaries.
|
|
221
|
+
|
|
222
|
+
## Related Packages
|
|
223
|
+
|
|
224
|
+
- [swarmauri_llm_mistral](https://pypi.org/project/swarmauri_llm_mistral/)
|
|
225
|
+
- [swarmauri_llm_groq](https://pypi.org/project/swarmauri_llm_groq/)
|
|
226
|
+
- [swarmauri_llm_hyperbolic](https://pypi.org/project/swarmauri_llm_hyperbolic/)
|
|
227
|
+
- [swarmauri_llm_deepinfra](https://pypi.org/project/swarmauri_llm_deepinfra/)
|
|
228
|
+
- [swarmauri_llm_perplexity](https://pypi.org/project/swarmauri_llm_perplexity/)
|
|
229
|
+
- [OpenAI TTS (Play.ht replacement)](../../standards/swarmauri_tts_openai/README.md)
|
|
230
|
+
|
|
231
|
+
## Foundational Swarmauri Packages
|
|
232
|
+
|
|
233
|
+
- [swarmauri](https://pypi.org/project/swarmauri/)
|
|
234
|
+
- [swarmauri_core](https://pypi.org/project/swarmauri_core/)
|
|
235
|
+
- [swarmauri_base](https://pypi.org/project/swarmauri_base/)
|
|
236
|
+
- [swarmauri_standard](https://pypi.org/project/swarmauri_standard/)
|
|
237
|
+
|
|
238
|
+
## More Documentation
|
|
239
|
+
|
|
240
|
+
- [LLM provider model and pricing links](../../../docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md)
|
|
241
|
+
- [OpenAI models](https://platform.openai.com/docs/models)
|
|
242
|
+
- [OpenAI function calling](https://platform.openai.com/docs/guides/function-calling)
|
|
243
|
+
- [OpenAI text to speech](https://platform.openai.com/docs/guides/text-to-speech)
|
|
244
|
+
|
|
245
|
+
## Best Practices
|
|
246
|
+
|
|
247
|
+
- Keep `OPENAI_API_KEY` in environment variables or a secret manager.
|
|
248
|
+
- Pick the adapter that matches the workflow: chat, reasoning, tool-calling, transcription, or TTS.
|
|
249
|
+
- Validate model availability against current OpenAI docs before hard-coding a dated model variant in production.
|
|
250
|
+
- Use reasoning models deliberately, since they should be chosen for workflows that actually benefit from deeper multi-step reasoning.
|
|
251
|
+
|
|
252
|
+
## License
|
|
253
|
+
|
|
254
|
+
Apache-2.0
|
|
255
|
+
|
|
256
|
+
## Resumable tool approvals
|
|
257
|
+
|
|
258
|
+
Pass the tool model to `AgentRunner` to pause before application tools run. This requires `swarmauri_standard>=0.11.0.dev9`.
|
|
259
|
+
|
|
260
|
+
## Speech import migration
|
|
261
|
+
|
|
262
|
+
`OpenAIAudioTTS` is retained with a deprecation warning. For new speech code,
|
|
263
|
+
install `swarmauri_tts_openai` and use `from swarmauri_tts_openai import OpenaiTTS`.
|
|
264
|
+
The new provider remains alpha and live API verification is tracked in
|
|
265
|
+
[issue #6268](https://github.com/swarmauri/swarmauri-sdk/issues/6268).
|
|
266
|
+
|
|
267
|
+
OpenAIAudioTTS remains a deprecated compatibility import. The canonical
|
|
268
|
+
swarmauri_tts_openai package also warns that OpenAI's Speech models shut down
|
|
269
|
+
on 2027-01-06. The Realtime replacement uses a different API; see
|
|
270
|
+
[the migration guide](../../../docs/migrations/openai-speech.md).
|
|
271
|
+
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://pepy.tech/project/swarmauri_llm_openai/">
|
|
5
|
+
<img src="https://static.pepy.tech/badge/swarmauri_llm_openai/month" alt="PyPI - Downloads"/></a>
|
|
6
|
+
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_openai/">
|
|
7
|
+
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_openai.svg"/></a>
|
|
8
|
+
<a href="https://pypi.org/project/swarmauri_llm_openai/">
|
|
9
|
+
<img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
|
|
10
|
+
<a href="https://pypi.org/project/swarmauri_llm_openai/">
|
|
11
|
+
<img src="https://img.shields.io/pypi/l/swarmauri_llm_openai" alt="PyPI - License"/></a>
|
|
12
|
+
<a href="https://pypi.org/project/swarmauri_llm_openai/">
|
|
13
|
+
<img src="https://img.shields.io/pypi/v/swarmauri_llm_openai?label=swarmauri_llm_openai&color=green" alt="PyPI - swarmauri_llm_openai"/></a>
|
|
14
|
+
<a href="https://discord.gg/N4UpBuQv8T">
|
|
15
|
+
<img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
|
|
16
|
+
|
|
17
|
+
# Swarmauri OpenAI LLM
|
|
18
|
+
|
|
19
|
+
`swarmauri_llm_openai` provides provider-specific Swarmauri imports for OpenAI chat, reasoning, tool-calling, audio transcription, and text-to-speech workflows. The package exposes `OpenAIModel`, `OpenAIReasonModel`, `OpenAIToolModel`, `OpenAIAudio`, and `OpenAIAudioTTS` as direct provider-package imports while preserving the shared runtime implementations in `swarmauri_standard`.
|
|
20
|
+
|
|
21
|
+
The repo currently tracks OpenAI chat model families including `gpt-5.x`, `gpt-4.1`, `gpt-4o`, `gpt-4-turbo`, `gpt-oss`, reasoning families including `o1`, `o3`, and `o4-mini`, audio transcription models including `whisper-1` and `gpt-4o-*transcribe`, and text-to-speech models including `tts-1`, `tts-1-hd`, and `gpt-4o-mini-tts`.
|
|
22
|
+
|
|
23
|
+
## Why Use This Package?
|
|
24
|
+
|
|
25
|
+
- Keep OpenAI-specific imports explicit in Swarmauri applications.
|
|
26
|
+
- Use separate adapters for standard chat, reasoning, tool-calling, transcription, and TTS workflows.
|
|
27
|
+
- Reuse Swarmauri `Conversation`, toolkit, and component semantics across the OpenAI surface area.
|
|
28
|
+
- Track current OpenAI model families through one provider package boundary.
|
|
29
|
+
|
|
30
|
+
## FAQ
|
|
31
|
+
|
|
32
|
+
### What does `swarmauri_llm_openai` install?
|
|
33
|
+
|
|
34
|
+
It installs `OpenAIModel`, `OpenAIReasonModel`, `OpenAIToolModel`, `OpenAIAudio`, and `OpenAIAudioTTS`.
|
|
35
|
+
|
|
36
|
+
### Which OpenAI capabilities are wrapped today?
|
|
37
|
+
|
|
38
|
+
The package covers standard chat completions, reasoning-oriented chat models, tool-calling workflows, audio transcription, and text-to-speech generation.
|
|
39
|
+
|
|
40
|
+
### What is the difference between `OpenAIModel` and `OpenAIReasonModel`?
|
|
41
|
+
|
|
42
|
+
`OpenAIModel` targets general chat model families such as `gpt-5.x`, `gpt-4.1`, and `gpt-4o`. `OpenAIReasonModel` targets the reasoning families tracked in the repo, including `o1`, `o3`, and `o4-mini` variants.
|
|
43
|
+
|
|
44
|
+
### When should I use `OpenAIToolModel`?
|
|
45
|
+
|
|
46
|
+
Use it when the application needs OpenAI tool calling through a Swarmauri toolkit. It is the provider-specific surface for tool-backed agent workflows.
|
|
47
|
+
|
|
48
|
+
### What do `OpenAIAudio` and `OpenAIAudioTTS` do?
|
|
49
|
+
|
|
50
|
+
`OpenAIAudio` wraps audio transcription workflows. `OpenAIAudioTTS` wraps text-to-speech generation workflows.
|
|
51
|
+
|
|
52
|
+
### Where should I verify current models and pricing?
|
|
53
|
+
|
|
54
|
+
Use the OpenAI section in [docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md](../../../docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md), which points to the current OpenAI models, function-calling, audio, TTS, and pricing documentation.
|
|
55
|
+
|
|
56
|
+
## Features
|
|
57
|
+
|
|
58
|
+
- `OpenAIModel` for sync, async, streaming, and batch chat completion workflows.
|
|
59
|
+
- `OpenAIReasonModel` for reasoning-model workflows across the repo-tracked `o*` families.
|
|
60
|
+
- `OpenAIToolModel` for toolkit-backed tool-calling and agent execution flows.
|
|
61
|
+
- `OpenAIAudio` for speech-to-text workflows against the tracked OpenAI transcription models.
|
|
62
|
+
- `OpenAIAudioTTS` for text-to-speech workflows against the tracked OpenAI TTS models.
|
|
63
|
+
- Compatibility with Python 3.10, 3.11, 3.12, 3.13, and 3.14.
|
|
64
|
+
|
|
65
|
+
## Installation
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
uv add swarmauri_llm_openai
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pip install swarmauri_llm_openai
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Usage
|
|
76
|
+
|
|
77
|
+
Set `OPENAI_API_KEY` in your environment before creating any of the OpenAI adapters.
|
|
78
|
+
|
|
79
|
+
### Chat Completion
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
import os
|
|
83
|
+
|
|
84
|
+
from swarmauri_llm_openai import OpenAIModel
|
|
85
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
86
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
87
|
+
|
|
88
|
+
conversation = Conversation()
|
|
89
|
+
conversation.add_message(HumanMessage(content="Summarize Swarmauri in two sentences."))
|
|
90
|
+
|
|
91
|
+
model = OpenAIModel(
|
|
92
|
+
api_key=os.environ["OPENAI_API_KEY"],
|
|
93
|
+
name="gpt-5.5",
|
|
94
|
+
)
|
|
95
|
+
result = model.predict(conversation=conversation)
|
|
96
|
+
|
|
97
|
+
print(result.get_last().content)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Reasoning Model
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
import os
|
|
104
|
+
|
|
105
|
+
from swarmauri_llm_openai import OpenAIReasonModel
|
|
106
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
107
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
108
|
+
|
|
109
|
+
conversation = Conversation()
|
|
110
|
+
conversation.add_message(HumanMessage(content="Reason through a release rollback plan step by step."))
|
|
111
|
+
|
|
112
|
+
model = OpenAIReasonModel(
|
|
113
|
+
api_key=os.environ["OPENAI_API_KEY"],
|
|
114
|
+
name="o3",
|
|
115
|
+
)
|
|
116
|
+
result = model.predict(conversation=conversation)
|
|
117
|
+
|
|
118
|
+
print(result.get_last().content)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Tool Calling
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
import os
|
|
125
|
+
|
|
126
|
+
from swarmauri_llm_openai import OpenAIToolModel
|
|
127
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
128
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
129
|
+
from swarmauri_standard.toolkits.Toolkit import Toolkit
|
|
130
|
+
from swarmauri_standard.tools.AdditionTool import AdditionTool
|
|
131
|
+
|
|
132
|
+
conversation = Conversation()
|
|
133
|
+
conversation.add_message(HumanMessage(content="What is 19 + 23? Use the tool."))
|
|
134
|
+
|
|
135
|
+
toolkit = Toolkit(tools={"add": AdditionTool()})
|
|
136
|
+
|
|
137
|
+
model = OpenAIToolModel(
|
|
138
|
+
api_key=os.environ["OPENAI_API_KEY"],
|
|
139
|
+
name="gpt-5.5",
|
|
140
|
+
)
|
|
141
|
+
result = model.predict(
|
|
142
|
+
conversation=conversation,
|
|
143
|
+
toolkit=toolkit,
|
|
144
|
+
tool_choice="auto",
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
print(result.get_last().content)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Audio Transcription
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
import os
|
|
154
|
+
|
|
155
|
+
from swarmauri_llm_openai import OpenAIAudio
|
|
156
|
+
|
|
157
|
+
audio_model = OpenAIAudio(
|
|
158
|
+
api_key=os.environ["OPENAI_API_KEY"],
|
|
159
|
+
name="whisper-1",
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
text = audio_model.predict("tests/static/test.mp3")
|
|
163
|
+
print(text)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Text To Speech
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
import os
|
|
170
|
+
|
|
171
|
+
from swarmauri_llm_openai import OpenAIAudioTTS
|
|
172
|
+
|
|
173
|
+
tts_model = OpenAIAudioTTS(
|
|
174
|
+
api_key=os.environ["OPENAI_API_KEY"],
|
|
175
|
+
name="tts-1",
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
audio_bytes = tts_model.predict("Swarmauri turns provider APIs into composable components.")
|
|
179
|
+
print(len(audio_bytes))
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Examples
|
|
183
|
+
|
|
184
|
+
- Use `OpenAIModel` for general-purpose chat completion workflows.
|
|
185
|
+
- Use `OpenAIReasonModel` when you want the reasoning-model family explicitly.
|
|
186
|
+
- Use `OpenAIToolModel` when an agent needs toolkit-backed tool invocation.
|
|
187
|
+
- Use `OpenAIAudio` and `OpenAIAudioTTS` when the workflow crosses text, speech, and audio generation boundaries.
|
|
188
|
+
|
|
189
|
+
## Related Packages
|
|
190
|
+
|
|
191
|
+
- [swarmauri_llm_mistral](https://pypi.org/project/swarmauri_llm_mistral/)
|
|
192
|
+
- [swarmauri_llm_groq](https://pypi.org/project/swarmauri_llm_groq/)
|
|
193
|
+
- [swarmauri_llm_hyperbolic](https://pypi.org/project/swarmauri_llm_hyperbolic/)
|
|
194
|
+
- [swarmauri_llm_deepinfra](https://pypi.org/project/swarmauri_llm_deepinfra/)
|
|
195
|
+
- [swarmauri_llm_perplexity](https://pypi.org/project/swarmauri_llm_perplexity/)
|
|
196
|
+
- [OpenAI TTS (Play.ht replacement)](../../standards/swarmauri_tts_openai/README.md)
|
|
197
|
+
|
|
198
|
+
## Foundational Swarmauri Packages
|
|
199
|
+
|
|
200
|
+
- [swarmauri](https://pypi.org/project/swarmauri/)
|
|
201
|
+
- [swarmauri_core](https://pypi.org/project/swarmauri_core/)
|
|
202
|
+
- [swarmauri_base](https://pypi.org/project/swarmauri_base/)
|
|
203
|
+
- [swarmauri_standard](https://pypi.org/project/swarmauri_standard/)
|
|
204
|
+
|
|
205
|
+
## More Documentation
|
|
206
|
+
|
|
207
|
+
- [LLM provider model and pricing links](../../../docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md)
|
|
208
|
+
- [OpenAI models](https://platform.openai.com/docs/models)
|
|
209
|
+
- [OpenAI function calling](https://platform.openai.com/docs/guides/function-calling)
|
|
210
|
+
- [OpenAI text to speech](https://platform.openai.com/docs/guides/text-to-speech)
|
|
211
|
+
|
|
212
|
+
## Best Practices
|
|
213
|
+
|
|
214
|
+
- Keep `OPENAI_API_KEY` in environment variables or a secret manager.
|
|
215
|
+
- Pick the adapter that matches the workflow: chat, reasoning, tool-calling, transcription, or TTS.
|
|
216
|
+
- Validate model availability against current OpenAI docs before hard-coding a dated model variant in production.
|
|
217
|
+
- Use reasoning models deliberately, since they should be chosen for workflows that actually benefit from deeper multi-step reasoning.
|
|
218
|
+
|
|
219
|
+
## License
|
|
220
|
+
|
|
221
|
+
Apache-2.0
|
|
222
|
+
|
|
223
|
+
## Resumable tool approvals
|
|
224
|
+
|
|
225
|
+
Pass the tool model to `AgentRunner` to pause before application tools run. This requires `swarmauri_standard>=0.11.0.dev9`.
|
|
226
|
+
|
|
227
|
+
## Speech import migration
|
|
228
|
+
|
|
229
|
+
`OpenAIAudioTTS` is retained with a deprecation warning. For new speech code,
|
|
230
|
+
install `swarmauri_tts_openai` and use `from swarmauri_tts_openai import OpenaiTTS`.
|
|
231
|
+
The new provider remains alpha and live API verification is tracked in
|
|
232
|
+
[issue #6268](https://github.com/swarmauri/swarmauri-sdk/issues/6268).
|
|
233
|
+
|
|
234
|
+
OpenAIAudioTTS remains a deprecated compatibility import. The canonical
|
|
235
|
+
swarmauri_tts_openai package also warns that OpenAI's Speech models shut down
|
|
236
|
+
on 2027-01-06. The Realtime replacement uses a different API; see
|
|
237
|
+
[the migration guide](../../../docs/migrations/openai-speech.md).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "swarmauri_llm_openai"
|
|
3
|
-
version = "0.
|
|
4
|
-
description = "Swarmauri
|
|
3
|
+
version = "0.11.0.dev5"
|
|
4
|
+
description = "Provider-specific Swarmauri import package for OpenAI chat, reasoning, tool-calling, transcription, and text-to-speech workflows."
|
|
5
5
|
license = "Apache-2.0"
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
repository = "http://github.com/swarmauri/swarmauri-sdk"
|
|
@@ -11,6 +11,11 @@ classifiers = [
|
|
|
11
11
|
"Natural Language :: English",
|
|
12
12
|
"Development Status :: 3 - Alpha",
|
|
13
13
|
"Intended Audience :: Developers",
|
|
14
|
+
"Intended Audience :: Science/Research",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
"Topic :: Multimedia :: Sound/Audio :: Speech",
|
|
17
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
18
|
+
"Topic :: Software Development :: Libraries",
|
|
14
19
|
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
15
20
|
"Programming Language :: Python",
|
|
16
21
|
"Programming Language :: Python :: 3",
|
|
@@ -25,12 +30,27 @@ authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
|
|
|
25
30
|
dependencies = [
|
|
26
31
|
"swarmauri_core",
|
|
27
32
|
"swarmauri_base",
|
|
28
|
-
"swarmauri_standard",
|
|
33
|
+
"swarmauri_standard>=0.11.0.dev12,<0.12",
|
|
29
34
|
]
|
|
30
35
|
keywords = [
|
|
31
36
|
"swarmauri",
|
|
32
37
|
"llm",
|
|
38
|
+
"swarmauri llm",
|
|
33
39
|
"openai",
|
|
40
|
+
"openai api",
|
|
41
|
+
"chat completions",
|
|
42
|
+
"reasoning model",
|
|
43
|
+
"tool calling",
|
|
44
|
+
"function calling",
|
|
45
|
+
"speech to text",
|
|
46
|
+
"transcription",
|
|
47
|
+
"text to speech",
|
|
48
|
+
"tts",
|
|
49
|
+
"audio generation",
|
|
50
|
+
"gpt-5",
|
|
51
|
+
"gpt-4o",
|
|
52
|
+
"large language model",
|
|
53
|
+
"generative ai",
|
|
34
54
|
"model",
|
|
35
55
|
]
|
|
36
56
|
|
|
@@ -68,6 +88,8 @@ OpenAIReasonModel = "swarmauri_llm_openai.OpenAIReasonModel:OpenAIReasonModel"
|
|
|
68
88
|
|
|
69
89
|
[project.entry-points.'swarmauri.tool_llms']
|
|
70
90
|
OpenAIToolModel = "swarmauri_llm_openai.OpenAIToolModel:OpenAIToolModel"
|
|
91
|
+
[project.entry-points.'swarmauri.vlms']
|
|
92
|
+
OpenAIVLM = "swarmauri_llm_openai.OpenAIVLM:OpenAIVLM"
|
|
71
93
|
[build-system]
|
|
72
94
|
requires = ["poetry-core>=1.0.0"]
|
|
73
95
|
build-backend = "poetry.core.masonry.api"
|
|
@@ -79,9 +101,12 @@ dev = [
|
|
|
79
101
|
"pytest-xdist>=3.6.1",
|
|
80
102
|
"pytest-json-report>=1.5.0",
|
|
81
103
|
"python-dotenv",
|
|
82
|
-
"
|
|
104
|
+
"httpx>=0.27",
|
|
83
105
|
"flake8>=7.0",
|
|
84
106
|
"pytest-timeout>=2.3.1",
|
|
85
107
|
"ruff>=0.9.9",
|
|
86
108
|
"pytest-benchmark>=4.0.0",
|
|
87
109
|
]
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Keep the legacy community import with explicit migration guidance."""
|
|
2
|
+
|
|
3
|
+
import warnings
|
|
4
|
+
|
|
5
|
+
from swarmauri_standard.llms.OpenAIAudioTTS import OpenAIAudioTTS
|
|
6
|
+
|
|
7
|
+
warnings.warn(
|
|
8
|
+
"swarmauri_llm_openai.OpenAIAudioTTS is deprecated; "
|
|
9
|
+
"use OpenaiTTS from swarmauri_tts_openai.",
|
|
10
|
+
FutureWarning,
|
|
11
|
+
stacklevel=2,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
__all__ = ["OpenAIAudioTTS"]
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
from typing import List, Literal, Optional
|
|
2
|
+
|
|
3
|
+
from pydantic import SecretStr
|
|
4
|
+
from swarmauri_base.ComponentBase import ComponentBase
|
|
5
|
+
from swarmauri_base.vlms.VLMBase import VLMBase
|
|
6
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
7
|
+
from swarmauri_standard.llms.OpenAIModel import OpenAIModel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@ComponentBase.register_type(VLMBase, "OpenAIVLM")
|
|
11
|
+
class OpenAIVLM(VLMBase):
|
|
12
|
+
"""
|
|
13
|
+
OpenAIVLM is a compatibility VLM facade over ``OpenAIModel`` for
|
|
14
|
+
multimodal image-first workflows.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
api_key: API key for OpenAI access.
|
|
18
|
+
allowed_models: List of allowed model names.
|
|
19
|
+
name: Default model name to use.
|
|
20
|
+
timeout: Request timeout in seconds.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
api_key: SecretStr
|
|
24
|
+
allowed_models: List[str] = [
|
|
25
|
+
*OpenAIModel.model_fields["allowed_models"].default
|
|
26
|
+
]
|
|
27
|
+
name: str = OpenAIModel.model_fields["allowed_models"].default[0]
|
|
28
|
+
type: Literal["OpenAIVLM"] = "OpenAIVLM"
|
|
29
|
+
timeout: float = 600.0
|
|
30
|
+
|
|
31
|
+
def _delegate(self) -> OpenAIModel:
|
|
32
|
+
return OpenAIModel(
|
|
33
|
+
api_key=self.api_key,
|
|
34
|
+
name=self.name,
|
|
35
|
+
timeout=self.timeout,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
def predict_vision(
|
|
39
|
+
self,
|
|
40
|
+
conversation: Conversation,
|
|
41
|
+
temperature: float = 0.7,
|
|
42
|
+
max_tokens: int = 256,
|
|
43
|
+
top_p: float = 1.0,
|
|
44
|
+
enable_json: bool = False,
|
|
45
|
+
stop: Optional[List[str]] = None,
|
|
46
|
+
) -> Conversation:
|
|
47
|
+
return self._delegate().predict(
|
|
48
|
+
conversation=conversation,
|
|
49
|
+
temperature=temperature,
|
|
50
|
+
max_tokens=max_tokens,
|
|
51
|
+
top_p=top_p,
|
|
52
|
+
enable_json=enable_json,
|
|
53
|
+
stop=stop or [],
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
async def apredict_vision(
|
|
57
|
+
self,
|
|
58
|
+
conversation: Conversation,
|
|
59
|
+
temperature: float = 0.7,
|
|
60
|
+
max_tokens: int = 256,
|
|
61
|
+
top_p: float = 1.0,
|
|
62
|
+
enable_json: bool = False,
|
|
63
|
+
stop: Optional[List[str]] = None,
|
|
64
|
+
) -> Conversation:
|
|
65
|
+
return await self._delegate().apredict(
|
|
66
|
+
conversation=conversation,
|
|
67
|
+
temperature=temperature,
|
|
68
|
+
max_tokens=max_tokens,
|
|
69
|
+
top_p=top_p,
|
|
70
|
+
enable_json=enable_json,
|
|
71
|
+
stop=stop or [],
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
def batch(
|
|
75
|
+
self,
|
|
76
|
+
conversations: List[Conversation],
|
|
77
|
+
temperature: float = 0.7,
|
|
78
|
+
max_tokens: int = 256,
|
|
79
|
+
top_p: float = 1.0,
|
|
80
|
+
enable_json: bool = False,
|
|
81
|
+
stop: Optional[List[str]] = None,
|
|
82
|
+
) -> List[Conversation]:
|
|
83
|
+
return self._delegate().batch(
|
|
84
|
+
conversations=conversations,
|
|
85
|
+
temperature=temperature,
|
|
86
|
+
max_tokens=max_tokens,
|
|
87
|
+
top_p=top_p,
|
|
88
|
+
enable_json=enable_json,
|
|
89
|
+
stop=stop or [],
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
async def abatch(
|
|
93
|
+
self,
|
|
94
|
+
conversations: List[Conversation],
|
|
95
|
+
temperature: float = 0.7,
|
|
96
|
+
max_tokens: int = 256,
|
|
97
|
+
top_p: float = 1.0,
|
|
98
|
+
enable_json: bool = False,
|
|
99
|
+
stop: Optional[List[str]] = None,
|
|
100
|
+
max_concurrent: int = 5,
|
|
101
|
+
) -> List[Conversation]:
|
|
102
|
+
return await self._delegate().abatch(
|
|
103
|
+
conversations=conversations,
|
|
104
|
+
temperature=temperature,
|
|
105
|
+
max_tokens=max_tokens,
|
|
106
|
+
top_p=top_p,
|
|
107
|
+
enable_json=enable_json,
|
|
108
|
+
stop=stop or [],
|
|
109
|
+
max_concurrent=max_concurrent,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
def stream(
|
|
113
|
+
self,
|
|
114
|
+
conversation: Conversation,
|
|
115
|
+
temperature: float = 0.7,
|
|
116
|
+
max_tokens: int = 256,
|
|
117
|
+
top_p: float = 1.0,
|
|
118
|
+
enable_json: bool = False,
|
|
119
|
+
stop: Optional[List[str]] = None,
|
|
120
|
+
):
|
|
121
|
+
yield from self._delegate().stream(
|
|
122
|
+
conversation=conversation,
|
|
123
|
+
temperature=temperature,
|
|
124
|
+
max_tokens=max_tokens,
|
|
125
|
+
top_p=top_p,
|
|
126
|
+
enable_json=enable_json,
|
|
127
|
+
stop=stop or [],
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
async def astream(
|
|
131
|
+
self,
|
|
132
|
+
conversation: Conversation,
|
|
133
|
+
temperature: float = 0.7,
|
|
134
|
+
max_tokens: int = 256,
|
|
135
|
+
top_p: float = 1.0,
|
|
136
|
+
enable_json: bool = False,
|
|
137
|
+
stop: Optional[List[str]] = None,
|
|
138
|
+
):
|
|
139
|
+
async for chunk in self._delegate().astream(
|
|
140
|
+
conversation=conversation,
|
|
141
|
+
temperature=temperature,
|
|
142
|
+
max_tokens=max_tokens,
|
|
143
|
+
top_p=top_p,
|
|
144
|
+
enable_json=enable_json,
|
|
145
|
+
stop=stop or [],
|
|
146
|
+
):
|
|
147
|
+
yield chunk
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from .OpenAIAudio import OpenAIAudio
|
|
2
2
|
from .OpenAIAudioTTS import OpenAIAudioTTS
|
|
3
|
+
from .OpenAIVLM import OpenAIVLM
|
|
3
4
|
from .OpenAIModel import OpenAIModel
|
|
4
5
|
from .OpenAIReasonModel import OpenAIReasonModel
|
|
5
6
|
from .OpenAIToolModel import OpenAIToolModel
|
|
@@ -7,6 +8,7 @@ from .OpenAIToolModel import OpenAIToolModel
|
|
|
7
8
|
__all__ = [
|
|
8
9
|
"OpenAIAudio",
|
|
9
10
|
"OpenAIAudioTTS",
|
|
11
|
+
"OpenAIVLM",
|
|
10
12
|
"OpenAIModel",
|
|
11
13
|
"OpenAIReasonModel",
|
|
12
14
|
"OpenAIToolModel",
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: swarmauri_llm_openai
|
|
3
|
-
Version: 0.1.1.dev3
|
|
4
|
-
Summary: Swarmauri Openai LLM adapters from swarmauri_standard.
|
|
5
|
-
License-Expression: Apache-2.0
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Keywords: swarmauri,llm,openai,model
|
|
8
|
-
Author: Jacob Stewart
|
|
9
|
-
Author-email: jacob@swarmauri.com
|
|
10
|
-
Requires-Python: >=3.10,<3.15
|
|
11
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
-
Classifier: Natural Language :: English
|
|
13
|
-
Classifier: Development Status :: 3 - Alpha
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
16
|
-
Classifier: Programming Language :: Python
|
|
17
|
-
Classifier: Programming Language :: Python :: 3
|
|
18
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
-
Requires-Dist: swarmauri_base
|
|
25
|
-
Requires-Dist: swarmauri_core
|
|
26
|
-
Requires-Dist: swarmauri_standard
|
|
27
|
-
Description-Content-Type: text/markdown
|
|
28
|
-
|
|
29
|
-

|
|
30
|
-
|
|
31
|
-
<p align="center">
|
|
32
|
-
<a href="https://pepy.tech/project/swarmauri_llm_openai/">
|
|
33
|
-
<img src="https://static.pepy.tech/badge/swarmauri_llm_openai/month" alt="PyPI - Downloads"/></a>
|
|
34
|
-
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_openai/">
|
|
35
|
-
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_openai.svg"/></a>
|
|
36
|
-
<a href="https://pypi.org/project/swarmauri_llm_openai/">
|
|
37
|
-
<img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
|
|
38
|
-
<a href="https://pypi.org/project/swarmauri_llm_openai/">
|
|
39
|
-
<img src="https://img.shields.io/pypi/l/swarmauri_llm_openai" alt="PyPI - License"/></a>
|
|
40
|
-
<a href="https://pypi.org/project/swarmauri_llm_openai/">
|
|
41
|
-
<img src="https://img.shields.io/pypi/v/swarmauri_llm_openai?label=swarmauri_llm_openai&color=green" alt="PyPI - swarmauri_llm_openai"/></a>
|
|
42
|
-
</p>
|
|
43
|
-
|
|
44
|
-
# swarmauri_llm_openai
|
|
45
|
-
|
|
46
|
-
Provider-specific Openai LLM package for Swarmauri. This package offers direct imports for OpenAIAudio, OpenAIAudioTTS, OpenAIModel, OpenAIReasonModel, OpenAIToolModel while keeping implementation parity with `swarmauri_standard`.
|
|
47
|
-
|
|
48
|
-
## Features
|
|
49
|
-
|
|
50
|
-
- `OpenAIAudio` adapter exported from `swarmauri_standard.llms.OpenAIAudio`.
|
|
51
|
-
- `OpenAIAudioTTS` adapter exported from `swarmauri_standard.llms.OpenAIAudioTTS`.
|
|
52
|
-
- `OpenAIModel` adapter exported from `swarmauri_standard.llms.OpenAIModel`.
|
|
53
|
-
- `OpenAIReasonModel` adapter exported from `swarmauri_standard.llms.OpenAIReasonModel`.
|
|
54
|
-
- `OpenAIToolModel` adapter exported from `swarmauri_standard.llms.OpenAIToolModel`.
|
|
55
|
-
- Compatible with Python 3.10 through 3.12.
|
|
56
|
-
|
|
57
|
-
## Installation
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
# uv
|
|
61
|
-
uv add swarmauri_llm_openai
|
|
62
|
-
|
|
63
|
-
# pip
|
|
64
|
-
pip install swarmauri_llm_openai
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Usage
|
|
68
|
-
|
|
69
|
-
```python
|
|
70
|
-
from swarmauri_llm_openai import OpenAIAudio
|
|
71
|
-
from swarmauri_llm_openai import OpenAIAudioTTS
|
|
72
|
-
from swarmauri_llm_openai import OpenAIModel
|
|
73
|
-
from swarmauri_llm_openai import OpenAIReasonModel
|
|
74
|
-
from swarmauri_llm_openai import OpenAIToolModel
|
|
75
|
-
from swarmauri_standard.conversations.Conversation import Conversation
|
|
76
|
-
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
77
|
-
|
|
78
|
-
conversation = Conversation()
|
|
79
|
-
conversation.add_message(HumanMessage(content="Hello from Swarmauri"))
|
|
80
|
-
|
|
81
|
-
model = OpenAIAudio()
|
|
82
|
-
# Configure provider credentials before making requests.
|
|
83
|
-
# result = model.predict(conversation=conversation)
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## Workflow Notes
|
|
87
|
-
|
|
88
|
-
- These adapters intentionally mirror the corresponding classes in `swarmauri_standard`.
|
|
89
|
-
- Use the provider package that matches your deployment and credential setup.
|
|
90
|
-
- Install only the provider packages you need to keep dependencies minimal.
|
|
91
|
-
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-

|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<a href="https://pepy.tech/project/swarmauri_llm_openai/">
|
|
5
|
-
<img src="https://static.pepy.tech/badge/swarmauri_llm_openai/month" alt="PyPI - Downloads"/></a>
|
|
6
|
-
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_openai/">
|
|
7
|
-
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_openai.svg"/></a>
|
|
8
|
-
<a href="https://pypi.org/project/swarmauri_llm_openai/">
|
|
9
|
-
<img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
|
|
10
|
-
<a href="https://pypi.org/project/swarmauri_llm_openai/">
|
|
11
|
-
<img src="https://img.shields.io/pypi/l/swarmauri_llm_openai" alt="PyPI - License"/></a>
|
|
12
|
-
<a href="https://pypi.org/project/swarmauri_llm_openai/">
|
|
13
|
-
<img src="https://img.shields.io/pypi/v/swarmauri_llm_openai?label=swarmauri_llm_openai&color=green" alt="PyPI - swarmauri_llm_openai"/></a>
|
|
14
|
-
</p>
|
|
15
|
-
|
|
16
|
-
# swarmauri_llm_openai
|
|
17
|
-
|
|
18
|
-
Provider-specific Openai LLM package for Swarmauri. This package offers direct imports for OpenAIAudio, OpenAIAudioTTS, OpenAIModel, OpenAIReasonModel, OpenAIToolModel while keeping implementation parity with `swarmauri_standard`.
|
|
19
|
-
|
|
20
|
-
## Features
|
|
21
|
-
|
|
22
|
-
- `OpenAIAudio` adapter exported from `swarmauri_standard.llms.OpenAIAudio`.
|
|
23
|
-
- `OpenAIAudioTTS` adapter exported from `swarmauri_standard.llms.OpenAIAudioTTS`.
|
|
24
|
-
- `OpenAIModel` adapter exported from `swarmauri_standard.llms.OpenAIModel`.
|
|
25
|
-
- `OpenAIReasonModel` adapter exported from `swarmauri_standard.llms.OpenAIReasonModel`.
|
|
26
|
-
- `OpenAIToolModel` adapter exported from `swarmauri_standard.llms.OpenAIToolModel`.
|
|
27
|
-
- Compatible with Python 3.10 through 3.12.
|
|
28
|
-
|
|
29
|
-
## Installation
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
# uv
|
|
33
|
-
uv add swarmauri_llm_openai
|
|
34
|
-
|
|
35
|
-
# pip
|
|
36
|
-
pip install swarmauri_llm_openai
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Usage
|
|
40
|
-
|
|
41
|
-
```python
|
|
42
|
-
from swarmauri_llm_openai import OpenAIAudio
|
|
43
|
-
from swarmauri_llm_openai import OpenAIAudioTTS
|
|
44
|
-
from swarmauri_llm_openai import OpenAIModel
|
|
45
|
-
from swarmauri_llm_openai import OpenAIReasonModel
|
|
46
|
-
from swarmauri_llm_openai import OpenAIToolModel
|
|
47
|
-
from swarmauri_standard.conversations.Conversation import Conversation
|
|
48
|
-
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
49
|
-
|
|
50
|
-
conversation = Conversation()
|
|
51
|
-
conversation.add_message(HumanMessage(content="Hello from Swarmauri"))
|
|
52
|
-
|
|
53
|
-
model = OpenAIAudio()
|
|
54
|
-
# Configure provider credentials before making requests.
|
|
55
|
-
# result = model.predict(conversation=conversation)
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## Workflow Notes
|
|
59
|
-
|
|
60
|
-
- These adapters intentionally mirror the corresponding classes in `swarmauri_standard`.
|
|
61
|
-
- Use the provider package that matches your deployment and credential setup.
|
|
62
|
-
- Install only the provider packages you need to keep dependencies minimal.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|