Daytona OpenAI
Enhanced OpenAI client with Daytona sandbox execution capabilities.
Overview
The daytona-openai-demo package extends the standard OpenAI client to add compute capabilities that execute code in a Daytona sandbox environment. This allows you to automatically generate and execute code based on natural language prompts.
Installation
pip install daytona-openai-demo
All required dependencies (openai and daytona-sdk) will be automatically installed.
Usage
from daytona_openai_demo import DaytonaOpenAI
# Initialize the client
client = DaytonaOpenAI()
# Standard OpenAI request
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "user", "content": "Explain quantum computing basics in 3 sentences"}
]
)
print(response.choices[0].message.content)
# Compute-enabled request (automatically generates and executes code)
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "user", "content": "Generate the first 10 prime numbers."}
],
compute=True
)
print(response.choices[0].message.content)
Features
- Seamless integration with the OpenAI Python client
- Automatic code generation and execution in a secure sandbox
- Support for both chat completions and legacy completions APIs
- All standard OpenAI parameters are supported
Requirements
- Python 3.10 or higher
- OpenAI API key
- Daytona API key
Metadata
Release files for daytona-openai-demo 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| daytona_openai_demo-0.1.1.tar.gz | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| daytona_openai_demo-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.3 kB
Release files / daytona_openai_demo-0.1.1.tar.gz
| Download URL | daytona_openai_demo-0.1.1.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41af35ba19c4c71742aa6c1f18cdf6915a60b9a51932009fc20048dfe1d7dabe
|
|
BLAKE2b-256 checksum How to use checksums |
253d8b48dd7c485e2332cd3cdec2465aed5983c26ef4d21b403f2c68175e55b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / daytona_openai_demo-0.1.1-py3-none-any.whl
| Download URL | daytona_openai_demo-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f70b9998adf280f4b0963c252932a6fbb4124b238f894e6487d5d26afafd70b9
|
|
BLAKE2b-256 checksum How to use checksums |
3136f2f84a6df9ca60ff7783a9a681b4e710a1d6ba1eb586d5faaae5f0658e37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|