DBOS integration for the OpenAI Agents SDK
Project description
Durable OpenAI Agents
Durable execution for the OpenAI Agents SDK using DBOS.
Installation
pip install dbos-openai-agents
Usage
Call your agent using DBOSRunner.run() from a @DBOS.workflow().
Annotate tool calls and guardrails with @DBOS.step().
import asyncio
from agents import Agent, function_tool
from dbos import DBOS, DBOSConfig
from dbos_openai_agents import DBOSRunner
# Decorate tool calls and guardrails with @DBOS.step() for durable execution
@function_tool
@DBOS.step()
async def get_weather(city: str) -> str:
"""Get the weather for a city."""
return f"Sunny in {city}"
agent = Agent(name="weather", tools=[get_weather])
# Use DBOSRunner to call your agent from a workflow
@DBOS.workflow()
async def run_agent(user_input: str) -> str:
result = await DBOSRunner.run(agent, user_input)
return str(result.final_output)
async def main():
output = await run_agent("How is the weather in San Francisco")
print(output)
if __name__ == "__main__":
config: DBOSConfig = {
"name": "my-agent",
}
DBOS(config=config)
DBOS.launch()
asyncio.run(main())
DBOSRunner.run() is a drop-in replacement for Runner.run() with the same arguments.
It must be called from within a @DBOS.workflow().
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 dbos_openai_agents-0.3.0.tar.gz.
File metadata
- Download URL: dbos_openai_agents-0.3.0.tar.gz
- Upload date:
- Size: 148.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc8da5cb9b652ccc4b7f3da419d655d793e4a3f9ff1ca6b576a40a210448ee48
|
|
| MD5 |
b9e1fe67d790a5c76e6feb38139bcbe7
|
|
| BLAKE2b-256 |
70383fe529a9539e5a48eb7caa8558e6ec2c745050ac33f8d4c4c0bea4ca7d13
|
Provenance
The following attestation bundles were made for dbos_openai_agents-0.3.0.tar.gz:
Publisher:
publish.yml on dbos-inc/dbos-openai-agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbos_openai_agents-0.3.0.tar.gz -
Subject digest:
bc8da5cb9b652ccc4b7f3da419d655d793e4a3f9ff1ca6b576a40a210448ee48 - Sigstore transparency entry: 906534504
- Sigstore integration time:
-
Permalink:
dbos-inc/dbos-openai-agents@37a329a16703c21376aeb410469aee214899ef36 -
Branch / Tag:
refs/heads/release/v0.3.0 - Owner: https://github.com/dbos-inc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@37a329a16703c21376aeb410469aee214899ef36 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file dbos_openai_agents-0.3.0-py3-none-any.whl.
File metadata
- Download URL: dbos_openai_agents-0.3.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13609dab5c868e03d25096282adbb58e7abbc33a204eadb9fb01c0f452b5f156
|
|
| MD5 |
ddcd09506d8d339bac8675e0aa0846e4
|
|
| BLAKE2b-256 |
bcf968b5f8a25efd03f33234ae29b872117a0cfd4465827f3f18c7d9d7b947bf
|
Provenance
The following attestation bundles were made for dbos_openai_agents-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on dbos-inc/dbos-openai-agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbos_openai_agents-0.3.0-py3-none-any.whl -
Subject digest:
13609dab5c868e03d25096282adbb58e7abbc33a204eadb9fb01c0f452b5f156 - Sigstore transparency entry: 906534506
- Sigstore integration time:
-
Permalink:
dbos-inc/dbos-openai-agents@37a329a16703c21376aeb410469aee214899ef36 -
Branch / Tag:
refs/heads/release/v0.3.0 - Owner: https://github.com/dbos-inc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@37a329a16703c21376aeb410469aee214899ef36 -
Trigger Event:
workflow_dispatch
-
Statement type: