Enhanced OpenAI client with Daytona sandbox execution capabilities
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file daytona_openai_demo-0.1.1.tar.gz.
File metadata
- Download URL: daytona_openai_demo-0.1.1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41af35ba19c4c71742aa6c1f18cdf6915a60b9a51932009fc20048dfe1d7dabe
|
|
| MD5 |
d2f9e916dba2eedb1375fc34edd2e3d0
|
|
| BLAKE2b-256 |
253d8b48dd7c485e2332cd3cdec2465aed5983c26ef4d21b403f2c68175e55b8
|
File details
Details for the file daytona_openai_demo-0.1.1-py3-none-any.whl.
File metadata
- Download URL: daytona_openai_demo-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f70b9998adf280f4b0963c252932a6fbb4124b238f894e6487d5d26afafd70b9
|
|
| MD5 |
a8ded4e452c73a82b2559494a352ebbe
|
|
| BLAKE2b-256 |
3136f2f84a6df9ca60ff7783a9a681b4e710a1d6ba1eb586d5faaae5f0658e37
|