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
418 changes: 350 additions & 68 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueInteractionsRequest;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueInteractionsResponse;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueInteractionsType;
import com.datadog.api.client.v2.model.LLMObsInteractionType;
import com.datadog.api.client.v2.model.LLMObsTraceInteractionItem;
import com.datadog.api.client.v2.model.LLMObsTraceInteractionType;
import java.util.Collections;

public class Example {
Expand All @@ -26,9 +27,10 @@ public static void main(String[] args) {
new LLMObsAnnotationQueueInteractionsDataAttributesRequest()
.interactions(
Collections.singletonList(
new LLMObsAnnotationQueueInteractionItem()
.contentId("trace-abc-123")
.type(LLMObsInteractionType.TRACE))))
new LLMObsAnnotationQueueInteractionItem(
new LLMObsTraceInteractionItem()
.contentId("trace-abc-123")
.type(LLMObsTraceInteractionType.TRACE)))))
.type(LLMObsAnnotationQueueInteractionsType.INTERACTIONS));

try {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Add a display_block interaction returns "Created" 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.LLMObsAnnotationQueueInteractionItem;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueInteractionsDataAttributesRequest;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueInteractionsDataRequest;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueInteractionsRequest;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueInteractionsResponse;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueInteractionsType;
import com.datadog.api.client.v2.model.LLMObsContentBlock;
import com.datadog.api.client.v2.model.LLMObsContentBlockType;
import com.datadog.api.client.v2.model.LLMObsDisplayBlockInteractionItem;
import com.datadog.api.client.v2.model.LLMObsDisplayBlockInteractionType;
import java.util.Collections;

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

LLMObsAnnotationQueueInteractionsRequest body =
new LLMObsAnnotationQueueInteractionsRequest()
.data(
new LLMObsAnnotationQueueInteractionsDataRequest()
.attributes(
new LLMObsAnnotationQueueInteractionsDataAttributesRequest()
.interactions(
Collections.singletonList(
new LLMObsAnnotationQueueInteractionItem(
new LLMObsDisplayBlockInteractionItem()
.type(LLMObsDisplayBlockInteractionType.DISPLAY_BLOCK)
.displayBlock(
Collections.singletonList(
new LLMObsContentBlock()
.type(LLMObsContentBlockType.MARKDOWN)
.content("## Triage Instructions")))))))
.type(LLMObsAnnotationQueueInteractionsType.INTERACTIONS));

try {
LLMObsAnnotationQueueInteractionsResponse result =
apiInstance.createLLMObsAnnotationQueueInteractions(
"00000000-0000-0000-0000-000000000001", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling LlmObservabilityApi#createLLMObsAnnotationQueueInteractions");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,18 @@ public LLMObsAnnotationQueueInteractionsResponse createLLMObsAnnotationQueueInte
}

/**
* Add one or more interactions (traces or sessions) to an annotation queue. At least one
* interaction must be provided.
* Add one or more interactions to an annotation queue. At least one interaction must be provided.
* Each interaction has a <code>type</code>:
*
* <ul>
* <li><code>trace</code>, <code>experiment_trace</code>, <code>session</code>: <code>content_id
* </code> references the upstream entity; the server fetches the actual content.
* <li><code>display_block</code>: omit <code>content_id</code> and provide the rendered content
* in <code>display_block</code>. The server generates <code>content_id</code> as a
* deterministic hash of the block list.
* </ul>
*
* <p>Items of different types can be mixed in a single request.
*
* @param queueId The ID of the LLM Observability annotation queue. (required)
* @param body Add interactions payload. (required)
Expand Down
Loading
Loading