Skip to content
Open
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
446 changes: 438 additions & 8 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions examples/v2/llm-observability/DeleteLLMObsAnnotations.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Delete annotations returns "OK — annotations deleted. Errors for annotations that could not be
// deleted are listed in
// `errors`." 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.LLMObsAnnotationsType;
import com.datadog.api.client.v2.model.LLMObsDeleteAnnotationsDataAttributesRequest;
import com.datadog.api.client.v2.model.LLMObsDeleteAnnotationsDataRequest;
import com.datadog.api.client.v2.model.LLMObsDeleteAnnotationsRequest;
import com.datadog.api.client.v2.model.LLMObsDeleteAnnotationsResponse;
import java.util.Arrays;

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

LLMObsDeleteAnnotationsRequest body =
new LLMObsDeleteAnnotationsRequest()
.data(
new LLMObsDeleteAnnotationsDataRequest()
.attributes(
new LLMObsDeleteAnnotationsDataAttributesRequest()
.annotationIds(
Arrays.asList(
"00000000-0000-0000-0000-000000000000",
"00000000-0000-0000-0000-000000000001")))
.type(LLMObsAnnotationsType.ANNOTATIONS));

try {
LLMObsDeleteAnnotationsResponse result =
apiInstance.deleteLLMObsAnnotations("00000000-0000-0000-0000-000000000001", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LlmObservabilityApi#deleteLLMObsAnnotations");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
61 changes: 61 additions & 0 deletions examples/v2/llm-observability/UpsertLLMObsAnnotations.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Create or update annotations returns "OK — annotations created or updated. Per-item errors are
// listed in `errors`."
// 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.LLMObsAnnotationLabelValue;
import com.datadog.api.client.v2.model.LLMObsAnnotationLabelValueValue;
import com.datadog.api.client.v2.model.LLMObsAnnotationsDataAttributesRequest;
import com.datadog.api.client.v2.model.LLMObsAnnotationsDataRequest;
import com.datadog.api.client.v2.model.LLMObsAnnotationsRequest;
import com.datadog.api.client.v2.model.LLMObsAnnotationsResponse;
import com.datadog.api.client.v2.model.LLMObsAnnotationsType;
import com.datadog.api.client.v2.model.LLMObsUpsertAnnotationItem;
import java.util.Arrays;
import java.util.Collections;

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

LLMObsAnnotationsRequest body =
new LLMObsAnnotationsRequest()
.data(
new LLMObsAnnotationsDataRequest()
.attributes(
new LLMObsAnnotationsDataAttributesRequest()
.annotations(
Collections.singletonList(
new LLMObsUpsertAnnotationItem()
.interactionId("00000000-0000-0000-0000-000000000001")
.labelValues(
Arrays.asList(
new LLMObsAnnotationLabelValue()
.labelSchemaId("abc-123")
.value(
new LLMObsAnnotationLabelValueValue(
"good")),
new LLMObsAnnotationLabelValue()
.labelSchemaId("ef56gh78")
.value(
new LLMObsAnnotationLabelValueValue(
"positive")))))))
.type(LLMObsAnnotationsType.ANNOTATIONS));

try {
LLMObsAnnotationsResponse result =
apiInstance.upsertLLMObsAnnotations("00000000-0000-0000-0000-000000000001", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LlmObservabilityApi#upsertLLMObsAnnotations");
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 @@ -786,6 +786,7 @@ public class ApiClient {
put("v2.createLLMObsProject", false);
put("v2.deleteLLMObsAnnotationQueue", false);
put("v2.deleteLLMObsAnnotationQueueInteractions", false);
put("v2.deleteLLMObsAnnotations", false);
put("v2.deleteLLMObsCustomEvalConfig", false);
put("v2.deleteLLMObsData", false);
put("v2.deleteLLMObsDatasetRecords", false);
Expand Down Expand Up @@ -822,6 +823,7 @@ public class ApiClient {
put("v2.updateLLMObsExperiment", false);
put("v2.updateLLMObsProject", false);
put("v2.uploadLLMObsDatasetRecordsFile", false);
put("v2.upsertLLMObsAnnotations", false);
put("v2.createAnnotation", false);
put("v2.deleteAnnotation", false);
put("v2.getPageAnnotations", false);
Expand Down
Loading
Loading