Skip to content

Commit 145cfd8

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a213e9c of spec repo
1 parent bfcd807 commit 145cfd8

34 files changed

Lines changed: 7811 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 870 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
// Run an LLM inference returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.LlmObservabilityApi;
6+
import com.datadog.api.client.v2.model.LLMObsAnthropicEffort;
7+
import com.datadog.api.client.v2.model.LLMObsAnthropicMetadata;
8+
import com.datadog.api.client.v2.model.LLMObsAnthropicThinkingConfig;
9+
import com.datadog.api.client.v2.model.LLMObsAnthropicThinkingType;
10+
import com.datadog.api.client.v2.model.LLMObsAzureOpenAIMetadata;
11+
import com.datadog.api.client.v2.model.LLMObsBedrockMetadata;
12+
import com.datadog.api.client.v2.model.LLMObsInferenceContent;
13+
import com.datadog.api.client.v2.model.LLMObsInferenceContentValue;
14+
import com.datadog.api.client.v2.model.LLMObsInferenceFunction;
15+
import com.datadog.api.client.v2.model.LLMObsInferenceMessage;
16+
import com.datadog.api.client.v2.model.LLMObsInferenceTool;
17+
import com.datadog.api.client.v2.model.LLMObsInferenceToolCall;
18+
import com.datadog.api.client.v2.model.LLMObsInferenceToolResult;
19+
import com.datadog.api.client.v2.model.LLMObsIntegrationInferenceRequest;
20+
import com.datadog.api.client.v2.model.LLMObsIntegrationInferenceResponse;
21+
import com.datadog.api.client.v2.model.LLMObsIntegrationName;
22+
import com.datadog.api.client.v2.model.LLMObsOpenAIMetadata;
23+
import com.datadog.api.client.v2.model.LLMObsOpenAIReasoningEffort;
24+
import com.datadog.api.client.v2.model.LLMObsOpenAIReasoningSummary;
25+
import com.datadog.api.client.v2.model.LLMObsVertexAIMetadata;
26+
import java.util.Collections;
27+
import java.util.Map;
28+
29+
public class Example {
30+
public static void main(String[] args) {
31+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
32+
defaultClient.setUnstableOperationEnabled("v2.createLLMObsIntegrationInference", true);
33+
LlmObservabilityApi apiInstance = new LlmObservabilityApi(defaultClient);
34+
35+
LLMObsIntegrationInferenceRequest body =
36+
new LLMObsIntegrationInferenceRequest()
37+
.anthropicMetadata(
38+
new LLMObsAnthropicMetadata()
39+
.effort(LLMObsAnthropicEffort.MEDIUM)
40+
.thinking(
41+
new LLMObsAnthropicThinkingConfig()
42+
.budgetTokens(1024L)
43+
.type(LLMObsAnthropicThinkingType.ENABLED)))
44+
.azureOpenaiMetadata(
45+
new LLMObsAzureOpenAIMetadata()
46+
.deploymentId("my-gpt4-deployment")
47+
.modelVersion("0613")
48+
.resourceName("my-azure-resource"))
49+
.bedrockMetadata(new LLMObsBedrockMetadata().region("us-east-1"))
50+
.jsonSchema("""
51+
{"type":"object","properties":{"answer":{"type":"string"}}}
52+
""")
53+
.maxCompletionTokens(1024L)
54+
.maxTokens(1024L)
55+
.messages(
56+
Collections.singletonList(
57+
new LLMObsInferenceMessage()
58+
.content("What is the capital of France?")
59+
.contents(
60+
Collections.singletonList(
61+
new LLMObsInferenceContent()
62+
.type("text")
63+
.value(
64+
new LLMObsInferenceContentValue()
65+
.text("Hello, how can I help you?")
66+
.toolCall(
67+
new LLMObsInferenceToolCall()
68+
.arguments(
69+
Map.ofEntries(
70+
Map.entry("location", "San Francisco")))
71+
.name("get_weather")
72+
.toolId("call_abc123")
73+
.type("function"))
74+
.toolCallResult(
75+
new LLMObsInferenceToolResult()
76+
.name("get_weather")
77+
.result(
78+
"The weather in San Francisco is 68°F and"
79+
+ " sunny.")
80+
.toolId("call_abc123")
81+
.type("function")))))
82+
.id("msg_001")
83+
.role("user")
84+
.toolCalls(
85+
Collections.singletonList(
86+
new LLMObsInferenceToolCall()
87+
.arguments(
88+
Map.ofEntries(Map.entry("location", "San Francisco")))
89+
.name("get_weather")
90+
.toolId("call_abc123")
91+
.type("function")))
92+
.toolResults(
93+
Collections.singletonList(
94+
new LLMObsInferenceToolResult()
95+
.name("get_weather")
96+
.result("The weather in San Francisco is 68°F and sunny.")
97+
.toolId("call_abc123")
98+
.type("function")))))
99+
.modelId("gpt-4o")
100+
.openaiMetadata(
101+
new LLMObsOpenAIMetadata()
102+
.reasoningEffort(LLMObsOpenAIReasoningEffort.MEDIUM)
103+
.reasoningSummary(LLMObsOpenAIReasoningSummary.AUTO))
104+
.temperature(0.7)
105+
.tools(
106+
Collections.singletonList(
107+
new LLMObsInferenceTool()
108+
.function(
109+
new LLMObsInferenceFunction()
110+
.description("Get the current weather for a location.")
111+
.name("get_weather")
112+
.parameters(
113+
Map.ofEntries(
114+
Map.entry("properties", "{'location': {'type': 'string'}}"),
115+
Map.entry("type", "object"))))
116+
.type("function")))
117+
.topK(50L)
118+
.topP(1.0)
119+
.vertexAiMetadata(
120+
new LLMObsVertexAIMetadata()
121+
.location("us-central1")
122+
.project("my-gcp-project")
123+
.projectIds(Collections.singletonList("my-gcp-project")));
124+
125+
try {
126+
LLMObsIntegrationInferenceResponse result =
127+
apiInstance.createLLMObsIntegrationInference(
128+
LLMObsIntegrationName.OPENAI, "account-abc123", body);
129+
System.out.println(result);
130+
} catch (ApiException e) {
131+
System.err.println(
132+
"Exception when calling LlmObservabilityApi#createLLMObsIntegrationInference");
133+
System.err.println("Status code: " + e.getCode());
134+
System.err.println("Reason: " + e.getResponseBody());
135+
System.err.println("Response headers: " + e.getResponseHeaders());
136+
e.printStackTrace();
137+
}
138+
}
139+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// List LLM integration accounts returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.LlmObservabilityApi;
6+
import com.datadog.api.client.v2.model.LLMObsIntegrationAccount;
7+
import com.datadog.api.client.v2.model.LLMObsIntegrationName;
8+
import java.util.List;
9+
10+
public class Example {
11+
public static void main(String[] args) {
12+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
13+
defaultClient.setUnstableOperationEnabled("v2.listLLMObsIntegrationAccounts", true);
14+
LlmObservabilityApi apiInstance = new LlmObservabilityApi(defaultClient);
15+
16+
try {
17+
List<LLMObsIntegrationAccount> result =
18+
apiInstance.listLLMObsIntegrationAccounts(LLMObsIntegrationName.OPENAI);
19+
System.out.println(result);
20+
} catch (ApiException e) {
21+
System.err.println(
22+
"Exception when calling LlmObservabilityApi#listLLMObsIntegrationAccounts");
23+
System.err.println("Status code: " + e.getCode());
24+
System.err.println("Reason: " + e.getResponseBody());
25+
System.err.println("Response headers: " + e.getResponseHeaders());
26+
e.printStackTrace();
27+
}
28+
}
29+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// List LLM integration models returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.LlmObservabilityApi;
6+
import com.datadog.api.client.v2.model.LLMObsIntegrationModel;
7+
import com.datadog.api.client.v2.model.LLMObsIntegrationName;
8+
import java.util.List;
9+
10+
public class Example {
11+
public static void main(String[] args) {
12+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
13+
defaultClient.setUnstableOperationEnabled("v2.listLLMObsIntegrationModels", true);
14+
LlmObservabilityApi apiInstance = new LlmObservabilityApi(defaultClient);
15+
16+
try {
17+
List<LLMObsIntegrationModel> result =
18+
apiInstance.listLLMObsIntegrationModels(LLMObsIntegrationName.OPENAI, "account-abc123");
19+
System.out.println(result);
20+
} catch (ApiException e) {
21+
System.err.println("Exception when calling LlmObservabilityApi#listLLMObsIntegrationModels");
22+
System.err.println("Status code: " + e.getCode());
23+
System.err.println("Reason: " + e.getResponseBody());
24+
System.err.println("Response headers: " + e.getResponseHeaders());
25+
e.printStackTrace();
26+
}
27+
}
28+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ public class ApiClient {
780780
put("v2.createLLMObsDatasetRecords", false);
781781
put("v2.createLLMObsExperiment", false);
782782
put("v2.createLLMObsExperimentEvents", false);
783+
put("v2.createLLMObsIntegrationInference", false);
783784
put("v2.createLLMObsProject", false);
784785
put("v2.deleteLLMObsAnnotationQueue", false);
785786
put("v2.deleteLLMObsAnnotationQueueInteractions", false);
@@ -797,6 +798,8 @@ public class ApiClient {
797798
put("v2.listLLMObsDatasets", false);
798799
put("v2.listLLMObsExperimentEvents", false);
799800
put("v2.listLLMObsExperiments", false);
801+
put("v2.listLLMObsIntegrationAccounts", false);
802+
put("v2.listLLMObsIntegrationModels", false);
800803
put("v2.listLLMObsProjects", false);
801804
put("v2.listLLMObsSpans", false);
802805
put("v2.searchLLMObsExperimentation", false);

0 commit comments

Comments
 (0)