Skip to content

Commit 889eabc

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Document LLM Observability LLM provider integration endpoints (#3557)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent d304035 commit 889eabc

37 files changed

Lines changed: 3357 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 870 additions & 0 deletions
Large diffs are not rendered by default.

docs/datadog_api_client.v2.model.rst

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18330,6 +18330,48 @@ datadog\_api\_client.v2.model.llm\_obs\_annotation\_schema module
1833018330
:members:
1833118331
:show-inheritance:
1833218332

18333+
datadog\_api\_client.v2.model.llm\_obs\_anthropic\_effort module
18334+
----------------------------------------------------------------
18335+
18336+
.. automodule:: datadog_api_client.v2.model.llm_obs_anthropic_effort
18337+
:members:
18338+
:show-inheritance:
18339+
18340+
datadog\_api\_client.v2.model.llm\_obs\_anthropic\_metadata module
18341+
------------------------------------------------------------------
18342+
18343+
.. automodule:: datadog_api_client.v2.model.llm_obs_anthropic_metadata
18344+
:members:
18345+
:show-inheritance:
18346+
18347+
datadog\_api\_client.v2.model.llm\_obs\_anthropic\_thinking\_config module
18348+
--------------------------------------------------------------------------
18349+
18350+
.. automodule:: datadog_api_client.v2.model.llm_obs_anthropic_thinking_config
18351+
:members:
18352+
:show-inheritance:
18353+
18354+
datadog\_api\_client.v2.model.llm\_obs\_anthropic\_thinking\_type module
18355+
------------------------------------------------------------------------
18356+
18357+
.. automodule:: datadog_api_client.v2.model.llm_obs_anthropic_thinking_type
18358+
:members:
18359+
:show-inheritance:
18360+
18361+
datadog\_api\_client.v2.model.llm\_obs\_azure\_open\_ai\_metadata module
18362+
------------------------------------------------------------------------
18363+
18364+
.. automodule:: datadog_api_client.v2.model.llm_obs_azure_open_ai_metadata
18365+
:members:
18366+
:show-inheritance:
18367+
18368+
datadog\_api\_client.v2.model.llm\_obs\_bedrock\_metadata module
18369+
----------------------------------------------------------------
18370+
18371+
.. automodule:: datadog_api_client.v2.model.llm_obs_bedrock_metadata
18372+
:members:
18373+
:show-inheritance:
18374+
1833318375
datadog\_api\_client.v2.model.llm\_obs\_content\_block module
1833418376
-------------------------------------------------------------
1833518377

@@ -19317,6 +19359,125 @@ datadog\_api\_client.v2.model.llm\_obs\_experiments\_response module
1931719359
:members:
1931819360
:show-inheritance:
1931919361

19362+
datadog\_api\_client.v2.model.llm\_obs\_inference\_code module
19363+
--------------------------------------------------------------
19364+
19365+
.. automodule:: datadog_api_client.v2.model.llm_obs_inference_code
19366+
:members:
19367+
:show-inheritance:
19368+
19369+
datadog\_api\_client.v2.model.llm\_obs\_inference\_content module
19370+
-----------------------------------------------------------------
19371+
19372+
.. automodule:: datadog_api_client.v2.model.llm_obs_inference_content
19373+
:members:
19374+
:show-inheritance:
19375+
19376+
datadog\_api\_client.v2.model.llm\_obs\_inference\_content\_value module
19377+
------------------------------------------------------------------------
19378+
19379+
.. automodule:: datadog_api_client.v2.model.llm_obs_inference_content_value
19380+
:members:
19381+
:show-inheritance:
19382+
19383+
datadog\_api\_client.v2.model.llm\_obs\_inference\_error\_response module
19384+
-------------------------------------------------------------------------
19385+
19386+
.. automodule:: datadog_api_client.v2.model.llm_obs_inference_error_response
19387+
:members:
19388+
:show-inheritance:
19389+
19390+
datadog\_api\_client.v2.model.llm\_obs\_inference\_function module
19391+
------------------------------------------------------------------
19392+
19393+
.. automodule:: datadog_api_client.v2.model.llm_obs_inference_function
19394+
:members:
19395+
:show-inheritance:
19396+
19397+
datadog\_api\_client.v2.model.llm\_obs\_inference\_message module
19398+
-----------------------------------------------------------------
19399+
19400+
.. automodule:: datadog_api_client.v2.model.llm_obs_inference_message
19401+
:members:
19402+
:show-inheritance:
19403+
19404+
datadog\_api\_client.v2.model.llm\_obs\_inference\_run\_result module
19405+
---------------------------------------------------------------------
19406+
19407+
.. automodule:: datadog_api_client.v2.model.llm_obs_inference_run_result
19408+
:members:
19409+
:show-inheritance:
19410+
19411+
datadog\_api\_client.v2.model.llm\_obs\_inference\_tool module
19412+
--------------------------------------------------------------
19413+
19414+
.. automodule:: datadog_api_client.v2.model.llm_obs_inference_tool
19415+
:members:
19416+
:show-inheritance:
19417+
19418+
datadog\_api\_client.v2.model.llm\_obs\_inference\_tool\_call module
19419+
--------------------------------------------------------------------
19420+
19421+
.. automodule:: datadog_api_client.v2.model.llm_obs_inference_tool_call
19422+
:members:
19423+
:show-inheritance:
19424+
19425+
datadog\_api\_client.v2.model.llm\_obs\_inference\_tool\_result module
19426+
----------------------------------------------------------------------
19427+
19428+
.. automodule:: datadog_api_client.v2.model.llm_obs_inference_tool_result
19429+
:members:
19430+
:show-inheritance:
19431+
19432+
datadog\_api\_client.v2.model.llm\_obs\_integration\_account module
19433+
-------------------------------------------------------------------
19434+
19435+
.. automodule:: datadog_api_client.v2.model.llm_obs_integration_account
19436+
:members:
19437+
:show-inheritance:
19438+
19439+
datadog\_api\_client.v2.model.llm\_obs\_integration\_inference\_request module
19440+
------------------------------------------------------------------------------
19441+
19442+
.. automodule:: datadog_api_client.v2.model.llm_obs_integration_inference_request
19443+
:members:
19444+
:show-inheritance:
19445+
19446+
datadog\_api\_client.v2.model.llm\_obs\_integration\_inference\_response module
19447+
-------------------------------------------------------------------------------
19448+
19449+
.. automodule:: datadog_api_client.v2.model.llm_obs_integration_inference_response
19450+
:members:
19451+
:show-inheritance:
19452+
19453+
datadog\_api\_client.v2.model.llm\_obs\_integration\_model module
19454+
-----------------------------------------------------------------
19455+
19456+
.. automodule:: datadog_api_client.v2.model.llm_obs_integration_model
19457+
:members:
19458+
:show-inheritance:
19459+
19460+
datadog\_api\_client.v2.model.llm\_obs\_integration\_model\_region\_prefix\_overrides module
19461+
--------------------------------------------------------------------------------------------
19462+
19463+
.. automodule:: datadog_api_client.v2.model.llm_obs_integration_model_region_prefix_overrides
19464+
:members:
19465+
:show-inheritance:
19466+
19467+
datadog\_api\_client.v2.model.llm\_obs\_integration\_name module
19468+
----------------------------------------------------------------
19469+
19470+
.. automodule:: datadog_api_client.v2.model.llm_obs_integration_name
19471+
:members:
19472+
:show-inheritance:
19473+
19474+
datadog\_api\_client.v2.model.llm\_obs\_internal\_reasoning module
19475+
------------------------------------------------------------------
19476+
19477+
.. automodule:: datadog_api_client.v2.model.llm_obs_internal_reasoning
19478+
:members:
19479+
:show-inheritance:
19480+
1932019481
datadog\_api\_client.v2.model.llm\_obs\_label\_schema module
1932119482
------------------------------------------------------------
1932219483

@@ -19345,6 +19506,27 @@ datadog\_api\_client.v2.model.llm\_obs\_metric\_score\_type module
1934519506
:members:
1934619507
:show-inheritance:
1934719508

19509+
datadog\_api\_client.v2.model.llm\_obs\_open\_ai\_metadata module
19510+
-----------------------------------------------------------------
19511+
19512+
.. automodule:: datadog_api_client.v2.model.llm_obs_open_ai_metadata
19513+
:members:
19514+
:show-inheritance:
19515+
19516+
datadog\_api\_client.v2.model.llm\_obs\_open\_ai\_reasoning\_effort module
19517+
--------------------------------------------------------------------------
19518+
19519+
.. automodule:: datadog_api_client.v2.model.llm_obs_open_ai_reasoning_effort
19520+
:members:
19521+
:show-inheritance:
19522+
19523+
datadog\_api\_client.v2.model.llm\_obs\_open\_ai\_reasoning\_summary module
19524+
---------------------------------------------------------------------------
19525+
19526+
.. automodule:: datadog_api_client.v2.model.llm_obs_open_ai_reasoning_summary
19527+
:members:
19528+
:show-inheritance:
19529+
1934819530
datadog\_api\_client.v2.model.llm\_obs\_project\_data\_attributes\_request module
1934919531
---------------------------------------------------------------------------------
1935019532

@@ -19597,6 +19779,13 @@ datadog\_api\_client.v2.model.llm\_obs\_trace\_interaction\_type module
1959719779
:members:
1959819780
:show-inheritance:
1959919781

19782+
datadog\_api\_client.v2.model.llm\_obs\_vertex\_ai\_metadata module
19783+
-------------------------------------------------------------------
19784+
19785+
.. automodule:: datadog_api_client.v2.model.llm_obs_vertex_ai_metadata
19786+
:members:
19787+
:show-inheritance:
19788+
1960019789
datadog\_api\_client.v2.model.log module
1960119790
----------------------------------------
1960219791

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
"""
2+
Run an LLM inference returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.llm_observability_api import LLMObservabilityApi
7+
from datadog_api_client.v2.model.llm_obs_anthropic_effort import LLMObsAnthropicEffort
8+
from datadog_api_client.v2.model.llm_obs_anthropic_metadata import LLMObsAnthropicMetadata
9+
from datadog_api_client.v2.model.llm_obs_anthropic_thinking_config import LLMObsAnthropicThinkingConfig
10+
from datadog_api_client.v2.model.llm_obs_anthropic_thinking_type import LLMObsAnthropicThinkingType
11+
from datadog_api_client.v2.model.llm_obs_azure_open_ai_metadata import LLMObsAzureOpenAIMetadata
12+
from datadog_api_client.v2.model.llm_obs_bedrock_metadata import LLMObsBedrockMetadata
13+
from datadog_api_client.v2.model.llm_obs_inference_content import LLMObsInferenceContent
14+
from datadog_api_client.v2.model.llm_obs_inference_content_value import LLMObsInferenceContentValue
15+
from datadog_api_client.v2.model.llm_obs_inference_function import LLMObsInferenceFunction
16+
from datadog_api_client.v2.model.llm_obs_inference_message import LLMObsInferenceMessage
17+
from datadog_api_client.v2.model.llm_obs_inference_tool import LLMObsInferenceTool
18+
from datadog_api_client.v2.model.llm_obs_inference_tool_call import LLMObsInferenceToolCall
19+
from datadog_api_client.v2.model.llm_obs_inference_tool_result import LLMObsInferenceToolResult
20+
from datadog_api_client.v2.model.llm_obs_integration_inference_request import LLMObsIntegrationInferenceRequest
21+
from datadog_api_client.v2.model.llm_obs_integration_name import LLMObsIntegrationName
22+
from datadog_api_client.v2.model.llm_obs_open_ai_metadata import LLMObsOpenAIMetadata
23+
from datadog_api_client.v2.model.llm_obs_open_ai_reasoning_effort import LLMObsOpenAIReasoningEffort
24+
from datadog_api_client.v2.model.llm_obs_open_ai_reasoning_summary import LLMObsOpenAIReasoningSummary
25+
from datadog_api_client.v2.model.llm_obs_vertex_ai_metadata import LLMObsVertexAIMetadata
26+
27+
body = LLMObsIntegrationInferenceRequest(
28+
anthropic_metadata=LLMObsAnthropicMetadata(
29+
effort=LLMObsAnthropicEffort.MEDIUM,
30+
thinking=LLMObsAnthropicThinkingConfig(
31+
budget_tokens=1024,
32+
type=LLMObsAnthropicThinkingType.ENABLED,
33+
),
34+
),
35+
azure_openai_metadata=LLMObsAzureOpenAIMetadata(
36+
deployment_id="my-gpt4-deployment",
37+
model_version="0613",
38+
resource_name="my-azure-resource",
39+
),
40+
bedrock_metadata=LLMObsBedrockMetadata(
41+
region="us-east-1",
42+
),
43+
frequency_penalty=0.0,
44+
json_schema='{"type":"object","properties":{"answer":{"type":"string"}}}',
45+
max_completion_tokens=1024,
46+
max_tokens=1024,
47+
messages=[
48+
LLMObsInferenceMessage(
49+
content="What is the capital of France?",
50+
contents=[
51+
LLMObsInferenceContent(
52+
type="text",
53+
value=LLMObsInferenceContentValue(
54+
text="Hello, how can I help you?",
55+
tool_call=LLMObsInferenceToolCall(
56+
arguments=dict([("location", "San Francisco")]),
57+
name="get_weather",
58+
tool_id="call_abc123",
59+
type="function",
60+
),
61+
tool_call_result=LLMObsInferenceToolResult(
62+
name="get_weather",
63+
result="The weather in San Francisco is 68°F and sunny.",
64+
tool_id="call_abc123",
65+
type="function",
66+
),
67+
),
68+
),
69+
],
70+
id="msg_001",
71+
role="user",
72+
tool_calls=[
73+
LLMObsInferenceToolCall(
74+
arguments=dict([("location", "San Francisco")]),
75+
name="get_weather",
76+
tool_id="call_abc123",
77+
type="function",
78+
),
79+
],
80+
tool_results=[
81+
LLMObsInferenceToolResult(
82+
name="get_weather",
83+
result="The weather in San Francisco is 68°F and sunny.",
84+
tool_id="call_abc123",
85+
type="function",
86+
),
87+
],
88+
),
89+
],
90+
model_id="gpt-4o",
91+
openai_metadata=LLMObsOpenAIMetadata(
92+
reasoning_effort=LLMObsOpenAIReasoningEffort.MEDIUM,
93+
reasoning_summary=LLMObsOpenAIReasoningSummary.AUTO,
94+
),
95+
presence_penalty=0.0,
96+
temperature=0.7,
97+
tools=[
98+
LLMObsInferenceTool(
99+
function=LLMObsInferenceFunction(
100+
description="Get the current weather for a location.",
101+
name="get_weather",
102+
parameters=dict([("properties", "{'location': {'type': 'string'}}"), ("type", "object")]),
103+
),
104+
type="function",
105+
),
106+
],
107+
top_k=50,
108+
top_p=1.0,
109+
vertex_ai_metadata=LLMObsVertexAIMetadata(
110+
location="us-central1",
111+
project="my-gcp-project",
112+
project_ids=[
113+
"my-gcp-project",
114+
],
115+
),
116+
)
117+
118+
configuration = Configuration()
119+
configuration.unstable_operations["create_llm_obs_integration_inference"] = True
120+
with ApiClient(configuration) as api_client:
121+
api_instance = LLMObservabilityApi(api_client)
122+
response = api_instance.create_llm_obs_integration_inference(
123+
integration=LLMObsIntegrationName.OPENAI, account_id="account_id", body=body
124+
)
125+
126+
print(response)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
List LLM integration accounts returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.llm_observability_api import LLMObservabilityApi
7+
from datadog_api_client.v2.model.llm_obs_integration_name import LLMObsIntegrationName
8+
9+
configuration = Configuration()
10+
configuration.unstable_operations["list_llm_obs_integration_accounts"] = True
11+
with ApiClient(configuration) as api_client:
12+
api_instance = LLMObservabilityApi(api_client)
13+
response = api_instance.list_llm_obs_integration_accounts(
14+
integration=LLMObsIntegrationName.OPENAI,
15+
)
16+
17+
print(response)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
List LLM integration models returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.llm_observability_api import LLMObservabilityApi
7+
from datadog_api_client.v2.model.llm_obs_integration_name import LLMObsIntegrationName
8+
9+
configuration = Configuration()
10+
configuration.unstable_operations["list_llm_obs_integration_models"] = True
11+
with ApiClient(configuration) as api_client:
12+
api_instance = LLMObservabilityApi(api_client)
13+
response = api_instance.list_llm_obs_integration_models(
14+
integration=LLMObsIntegrationName.OPENAI,
15+
account_id="account_id",
16+
)
17+
18+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ def __init__(
272272
"v2.create_llm_obs_dataset_records": False,
273273
"v2.create_llm_obs_experiment": False,
274274
"v2.create_llm_obs_experiment_events": False,
275+
"v2.create_llm_obs_integration_inference": False,
275276
"v2.create_llm_obs_project": False,
276277
"v2.delete_llm_obs_annotation_queue": False,
277278
"v2.delete_llm_obs_annotation_queue_interactions": False,
@@ -289,6 +290,8 @@ def __init__(
289290
"v2.list_llm_obs_datasets": False,
290291
"v2.list_llm_obs_experiment_events": False,
291292
"v2.list_llm_obs_experiments": False,
293+
"v2.list_llm_obs_integration_accounts": False,
294+
"v2.list_llm_obs_integration_models": False,
292295
"v2.list_llm_obs_projects": False,
293296
"v2.list_llm_obs_spans": False,
294297
"v2.search_llm_obs_experimentation": False,

0 commit comments

Comments
 (0)