Skip to content

Commit 8d09e30

Browse files
lievanYun-Kim
andauthored
[MLOB] document oai agents integrations (#28606)
Co-authored-by: Yun-Kim <[email protected]> Co-authored-by: <[email protected]>
1 parent b021913 commit 8d09e30

File tree

1 file changed

+43
-15
lines changed

1 file changed

+43
-15
lines changed

content/en/llm_observability/setup/auto_instrumentation.md

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Datadog's [LLM Observability Python SDK][16] provides integrations that automati
3131
| [Vertex AI](#vertex-ai) | >= 1.71.1 | >= 2.18.0 |
3232
| [LangGraph](#langgraph) | >= 0.2.23 | >= 3.5.0 |
3333
| [Crew AI](#crew-ai) | >= 0.105.0 | >= 3.5.0 |
34+
| [OpenAI Agents](#openai-agents) | >= 0.0.2 | >= 3.5.0 |
35+
3436

3537
You can programmatically enable automatic tracing of LLM calls to a supported LLM model like OpenAI or a framework like LangChain by setting `integrations_enabled` to `true` in the `LLMOBs.enable()` function. In addition to capturing latency and errors, the integrations capture the input parameters, input and output messages, and token usage (when available) of each traced call.
3638

@@ -51,7 +53,7 @@ from ddtrace import patch
5153
from ddtrace.llmobs import LLMObs
5254

5355
LLMObs.enable(integrations_enabled=False, ...)
54-
patch(openai=True, langchain=True, botocore=["bedrock-runtime"], anthropic=True, gemini=True, vertexai=True, crewai=True, langgraph=True)
56+
patch(openai=True, langchain=True, botocore=["bedrock-runtime"], anthropic=True, gemini=True, vertexai=True, crewai=True, openai_agents=True, langgraph=True)
5557
```
5658

5759
## OpenAI
@@ -155,17 +157,6 @@ The Vertex AI integration instruments the following methods:
155157
- `chat.send_message()`
156158
- `chat.send_message_async()`
157159

158-
## LangGraph
159-
160-
The LangGraph integration automatically traces `Pregel/CompiledGraph` and `RunnableSeq (node)` invocations made through the [LangGraph Python SDK][33].
161-
162-
### Traced methods
163-
164-
The LangGraph integration instruments synchronous and asynchronous versions of the following methods:
165-
166-
- [CompiledGraph.invoke(), Pregel.invoke(), CompiledGraph.stream(), Pregel.stream()][34]
167-
- [RunnableSeq.invoke()][35]
168-
169160
## Crew AI
170161

171162
The Crew AI integration automatically traces execution of Crew kickoffs, including task/agent/tool invocations, made through [CrewAI's Python SDK][26].
@@ -190,6 +181,33 @@ The Crew AI integration instruments the following methods:
190181
- [Tool Invocation][30]:
191182
- `tool.invoke()`
192183

184+
## OpenAI Agents
185+
186+
The OpenAI Agents integration converts the [built-in tracing][33] from the [OpenAI Agents SDK][34] into
187+
LLM Observability format and sends it to Datadog's LLM Observability product by adding a Datadog trace processor.
188+
189+
The following operations are supported:
190+
- [`traces`][35]
191+
- [`agent`][36]
192+
- [`generation`][37] using Datadog's [OpenAI](#openai) integration
193+
- [`response`][38]
194+
- [`guardrail`][39]
195+
- [`handoff`][40]
196+
- [`function`][41]
197+
- [`custom`][42]
198+
199+
## LangGraph
200+
201+
The LangGraph integration automatically traces `Pregel/CompiledGraph` and `RunnableSeq (node)` invocations made through the [LangGraph Python SDK][33].
202+
203+
### Traced methods
204+
205+
The LangGraph integration instruments synchronous and asynchronous versions of the following methods:
206+
207+
- [CompiledGraph.invoke(), Pregel.invoke(), CompiledGraph.stream(), Pregel.stream()][34]
208+
- [RunnableSeq.invoke()][35]
209+
210+
193211
[1]: https://platform.openai.com/docs/api-reference/introduction
194212
[2]: https://platform.openai.com/docs/api-reference/completions
195213
[3]: https://platform.openai.com/docs/api-reference/chat
@@ -222,9 +240,19 @@ The Crew AI integration instruments the following methods:
222240
[30]: https://docs.crewai.com/concepts/tools
223241
[31]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html
224242
[32]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html
225-
[33]: https://langchain-ai.github.io/langgraph/concepts/sdk/
226-
[34]: https://blog.langchain.dev/langgraph/#compile
227-
[35]: https://blog.langchain.dev/langgraph/#nodes
243+
[33]: https://openai.github.io/openai-agents-python/tracing/
244+
[34]: https://openai.github.io/openai-agents-python/
245+
[35]: https://openai.github.io/openai-agents-python/ref/tracing/traces/
246+
[36]: https://openai.github.io/openai-agents-python/ref/tracing/#agents.tracing.agent_span
247+
[37]: https://openai.github.io/openai-agents-python/ref/tracing/#agents.tracing.generation_span
248+
[38]: https://openai.github.io/openai-agents-python/ref/tracing/#agents.tracing.response_span
249+
[39]: https://openai.github.io/openai-agents-python/ref/tracing/#agents.tracing.guardrail_span
250+
[40]: https://openai.github.io/openai-agents-python/ref/tracing/#agents.tracing.handoff_span
251+
[41]: https://openai.github.io/openai-agents-python/ref/tracing/#agents.tracing.function_span
252+
[42]: https://openai.github.io/openai-agents-python/ref/tracing/#agents.tracing.custom_span
253+
[43]: https://langchain-ai.github.io/langgraph/concepts/sdk/
254+
[44]: https://blog.langchain.dev/langgraph/#compile
255+
[45]: https://blog.langchain.dev/langgraph/#nodes
228256

229257
{{% /tab %}}
230258
{{% tab "Node.js" %}}

0 commit comments

Comments
 (0)