Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
381 changes: 378 additions & 3 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions examples/v2/llm-observability/CreateLLMObsAnnotationQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueRequest;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueResponse;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueType;
import com.datadog.api.client.v2.model.LLMObsAnnotationSchema;
import com.datadog.api.client.v2.model.LLMObsLabelSchema;
import com.datadog.api.client.v2.model.LLMObsLabelSchemaType;
import java.util.Arrays;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
Expand All @@ -21,6 +26,22 @@ public static void main(String[] args) {
new LLMObsAnnotationQueueDataRequest()
.attributes(
new LLMObsAnnotationQueueDataAttributesRequest()
.annotationSchema(
new LLMObsAnnotationSchema()
.labelSchemas(
Collections.singletonList(
new LLMObsLabelSchema()
.description("Rating of the response quality.")
.hasAssessment(false)
.hasReasoning(false)
.id("ab12cd34")
.isAssessment(false)
.isInteger(false)
.isRequired(true)
.max(5.0)
.name("quality")
.type(LLMObsLabelSchemaType.SCORE)
.values(Arrays.asList("good", "bad", "neutral")))))
.description("Queue for annotating customer support traces")
.name("My annotation queue")
.projectId("a33671aa-24fd-4dcd-9b33-a8ec7dde7751"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Get annotation queue label schema returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LlmObservabilityApi;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueLabelSchemaResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.getLLMObsAnnotationQueueLabelSchema", true);
LlmObservabilityApi apiInstance = new LlmObservabilityApi(defaultClient);

try {
LLMObsAnnotationQueueLabelSchemaResponse result =
apiInstance.getLLMObsAnnotationQueueLabelSchema("b5e7f3a1-9c2d-4f8b-a1e6-3d7e9f0a2b4c");
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling LlmObservabilityApi#getLLMObsAnnotationQueueLabelSchema");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
21 changes: 21 additions & 0 deletions examples/v2/llm-observability/UpdateLLMObsAnnotationQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueUpdateDataAttributesRequest;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueUpdateDataRequest;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueUpdateRequest;
import com.datadog.api.client.v2.model.LLMObsAnnotationSchema;
import com.datadog.api.client.v2.model.LLMObsLabelSchema;
import com.datadog.api.client.v2.model.LLMObsLabelSchemaType;
import java.util.Arrays;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
Expand All @@ -21,6 +26,22 @@ public static void main(String[] args) {
new LLMObsAnnotationQueueUpdateDataRequest()
.attributes(
new LLMObsAnnotationQueueUpdateDataAttributesRequest()
.annotationSchema(
new LLMObsAnnotationSchema()
.labelSchemas(
Collections.singletonList(
new LLMObsLabelSchema()
.description("Rating of the response quality.")
.hasAssessment(false)
.hasReasoning(false)
.id("ab12cd34")
.isAssessment(false)
.isInteger(false)
.isRequired(true)
.max(5.0)
.name("quality")
.type(LLMObsLabelSchemaType.SCORE)
.values(Arrays.asList("good", "bad", "neutral")))))
.description("Updated description")
.name("Updated queue name"))
.type(LLMObsAnnotationQueueType.QUEUES));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Update annotation queue label schema returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LlmObservabilityApi;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueLabelSchemaResponse;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueLabelSchemaUpdateAttributes;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueLabelSchemaUpdateData;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueLabelSchemaUpdateRequest;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueType;
import com.datadog.api.client.v2.model.LLMObsAnnotationSchema;
import com.datadog.api.client.v2.model.LLMObsLabelSchema;
import com.datadog.api.client.v2.model.LLMObsLabelSchemaType;
import java.util.Arrays;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.updateLLMObsAnnotationQueueLabelSchema", true);
LlmObservabilityApi apiInstance = new LlmObservabilityApi(defaultClient);

LLMObsAnnotationQueueLabelSchemaUpdateRequest body =
new LLMObsAnnotationQueueLabelSchemaUpdateRequest()
.data(
new LLMObsAnnotationQueueLabelSchemaUpdateData()
.attributes(
new LLMObsAnnotationQueueLabelSchemaUpdateAttributes()
.annotationSchema(
new LLMObsAnnotationSchema()
.labelSchemas(
Collections.singletonList(
new LLMObsLabelSchema()
.description("Rating of the response quality.")
.hasAssessment(false)
.hasReasoning(false)
.id("ab12cd34")
.isAssessment(false)
.isInteger(false)
.isRequired(true)
.max(5.0)
.name("quality")
.type(LLMObsLabelSchemaType.SCORE)
.values(Arrays.asList("good", "bad", "neutral"))))))
.type(LLMObsAnnotationQueueType.QUEUES));

try {
LLMObsAnnotationQueueLabelSchemaResponse result =
apiInstance.updateLLMObsAnnotationQueueLabelSchema(
"b5e7f3a1-9c2d-4f8b-a1e6-3d7e9f0a2b4c", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling LlmObservabilityApi#updateLLMObsAnnotationQueueLabelSchema");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
2 changes: 2 additions & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -788,13 +788,15 @@ public class ApiClient {
put("v2.deleteLLMObsExperiments", false);
put("v2.deleteLLMObsProjects", false);
put("v2.getLLMObsAnnotatedInteractions", false);
put("v2.getLLMObsAnnotationQueueLabelSchema", false);
put("v2.getLLMObsCustomEvalConfig", false);
put("v2.listLLMObsAnnotationQueues", false);
put("v2.listLLMObsDatasetRecords", false);
put("v2.listLLMObsDatasets", false);
put("v2.listLLMObsExperiments", false);
put("v2.listLLMObsProjects", false);
put("v2.updateLLMObsAnnotationQueue", false);
put("v2.updateLLMObsAnnotationQueueLabelSchema", false);
put("v2.updateLLMObsCustomEvalConfig", false);
put("v2.updateLLMObsDataset", false);
put("v2.updateLLMObsDatasetRecords", false);
Expand Down
Loading
Loading