Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(weave): Docs edits to /guides/integrations/openai_agents #3933

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/docs/guides/integrations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ LLM providers are the vendors that offer access to large language models for gen

Frameworks help orchestrate the actual execution pipelines in AI applications. They provide tools and abstractions for building complex workflows. Weave integrates with these frameworks to trace the entire pipeline:

- **[OpenAI Agents SDK](/guides/integrations/openai_agents)**
- **[LangChain](/guides/integrations/langchain)**
- **[LlamaIndex](/guides/integrations/llamaindex)**
- **[DSPy](/guides/integrations/dspy)**
Expand Down
13 changes: 9 additions & 4 deletions docs/docs/guides/integrations/openai_agents.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@

# OpenAI Agents SDK

The [OpenAI Agents SDK](https://github.com/openai/openai-agents-python) is a lightweight yet powerful framework for building multi-agent workflows.
The [OpenAI Agents Python SDK](https://github.com/openai/openai-agents-python) is a lightweight and powerful framework for building multi-agent workflows. You can use W&B Weave with the OpenAI Agents SDK to track and monitor your agentic applications.

## Installation

Install the required dependencies using `pip`:

```bash
pip install weave openai-agents
```

## Getting Started
## Get started

To use the OpenAI Agents SDK with Weave, you'll need to:

- Initialize Weave with your project name
- Add the Weave tracing processor to your agents
- Create and run your agents as usual

In the following codes sample, an OpenAI Agent is created and integrated with Weave for traceability. First, a Weave project is initialized and the `WeaveTracingProcessor` is set up to capture execution traces. A `Weather` data model is created to represent weather information. The `get_weather` function is decorated as a tool the agent can use and returns a sample weather report. An agent named `Hello world` is configured with basic instructions and access to the weather tool. The main function asynchronously runs the agent with a sample input (`What's the weather in Tokyo?`) and outputs the final response.

```python
from pydantic import BaseModel
from agents import Agent, Runner, function_tool, set_trace_processors
Expand Down Expand Up @@ -50,6 +55,6 @@ if __name__ == "__main__":
asyncio.run(main())
```

## View your traces
## View traces

To see what happened during your agent execution, follow the link to your Weave dashboard and see your agent traces.
When the above code sample is run, a link to the Weave dashboard is generated. To see what happened during your agent execution, follow the link to see your agent traces.
Loading