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
281 changes: 232 additions & 49 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Get an annotated queue interaction returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.AgentObservabilityApi;
import com.datadog.api.client.v2.model.LLMObsAnnotatedInteractionResponse;

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

try {
LLMObsAnnotatedInteractionResponse result =
apiInstance.getLLMObsAnnotatedInteraction(
"00000000-0000-0000-0000-000000000001", "interaction-456");
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling AgentObservabilityApi#getLLMObsAnnotatedInteraction");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
1 change: 1 addition & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ public class ApiClient {
put("v2.deleteLLMObsProjects", false);
put("v2.deleteLLMObsPrompt", false);
put("v2.exportLLMObsDataset", false);
put("v2.getLLMObsAnnotatedInteraction", false);
put("v2.getLLMObsAnnotatedInteractions", false);
put("v2.getLLMObsAnnotatedInteractionsByTraceIDs", false);
put("v2.getLLMObsAnnotationQueueLabelSchema", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.datadog.api.client.ApiException;
import com.datadog.api.client.ApiResponse;
import com.datadog.api.client.Pair;
import com.datadog.api.client.v2.model.LLMObsAnnotatedInteractionResponse;
import com.datadog.api.client.v2.model.LLMObsAnnotatedInteractionsByTraceResponse;
import com.datadog.api.client.v2.model.LLMObsAnnotatedInteractionsResponse;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueInteractionsRequest;
Expand Down Expand Up @@ -894,6 +895,9 @@ public LLMObsAnnotationQueueInteractionsResponse createLLMObsAnnotationQueueInte
* <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.
* <li><code>frontend</code>: omit <code>content_id</code> and provide the web content in <code>
* frontend</code>. The server returns a deterministic <code>content_id</code> for the
* content.
* </ul>
*
* <p>Items of different types can be mixed in a single request.
Expand Down Expand Up @@ -4401,6 +4405,197 @@ public CompletableFuture<ApiResponse<String>> exportLLMObsDatasetWithHttpInfoAsy
new GenericType<String>() {});
}

/**
* Get an annotated queue interaction.
*
* <p>See {@link #getLLMObsAnnotatedInteractionWithHttpInfo}.
*
* @param queueId The ID of the Agent Observability annotation queue. (required)
* @param interactionId The ID of the interaction within the annotation queue. (required)
* @return LLMObsAnnotatedInteractionResponse
* @throws ApiException if fails to make API call
*/
public LLMObsAnnotatedInteractionResponse getLLMObsAnnotatedInteraction(
String queueId, String interactionId) throws ApiException {
return getLLMObsAnnotatedInteractionWithHttpInfo(queueId, interactionId).getData();
}

/**
* Get an annotated queue interaction.
*
* <p>See {@link #getLLMObsAnnotatedInteractionWithHttpInfoAsync}.
*
* @param queueId The ID of the Agent Observability annotation queue. (required)
* @param interactionId The ID of the interaction within the annotation queue. (required)
* @return CompletableFuture&lt;LLMObsAnnotatedInteractionResponse&gt;
*/
public CompletableFuture<LLMObsAnnotatedInteractionResponse> getLLMObsAnnotatedInteractionAsync(
String queueId, String interactionId) {
return getLLMObsAnnotatedInteractionWithHttpInfoAsync(queueId, interactionId)
.thenApply(
response -> {
return response.getData();
});
}

/**
* Retrieve a single interaction (trace, session, display block, or frontend content) and its
* annotations for a given annotation queue.
*
* @param queueId The ID of the Agent Observability annotation queue. (required)
* @param interactionId The ID of the interaction within the annotation queue. (required)
* @return ApiResponse&lt;LLMObsAnnotatedInteractionResponse&gt;
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
* <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<LLMObsAnnotatedInteractionResponse> getLLMObsAnnotatedInteractionWithHttpInfo(
String queueId, String interactionId) throws ApiException {
// Check if unstable operation is enabled
String operationId = "getLLMObsAnnotatedInteraction";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
}
Object localVarPostBody = null;

// verify the required parameter 'queueId' is set
if (queueId == null) {
throw new ApiException(
400,
"Missing the required parameter 'queueId' when calling getLLMObsAnnotatedInteraction");
}

// verify the required parameter 'interactionId' is set
if (interactionId == null) {
throw new ApiException(
400,
"Missing the required parameter 'interactionId' when calling"
+ " getLLMObsAnnotatedInteraction");
}
// create path and map variables
String localVarPath =
"/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotated-interactions/{interaction_id}"
.replaceAll("\\{" + "queue_id" + "\\}", apiClient.escapeString(queueId.toString()))
.replaceAll(
"\\{" + "interaction_id" + "\\}", apiClient.escapeString(interactionId.toString()));

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Invocation.Builder builder =
apiClient.createBuilder(
"v2.AgentObservabilityApi.getLLMObsAnnotatedInteraction",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth"});
return apiClient.invokeAPI(
"GET",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<LLMObsAnnotatedInteractionResponse>() {});
}

/**
* Get an annotated queue interaction.
*
* <p>See {@link #getLLMObsAnnotatedInteractionWithHttpInfo}.
*
* @param queueId The ID of the Agent Observability annotation queue. (required)
* @param interactionId The ID of the interaction within the annotation queue. (required)
* @return CompletableFuture&lt;ApiResponse&lt;LLMObsAnnotatedInteractionResponse&gt;&gt;
*/
public CompletableFuture<ApiResponse<LLMObsAnnotatedInteractionResponse>>
getLLMObsAnnotatedInteractionWithHttpInfoAsync(String queueId, String interactionId) {
// Check if unstable operation is enabled
String operationId = "getLLMObsAnnotatedInteraction";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
CompletableFuture<ApiResponse<LLMObsAnnotatedInteractionResponse>> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
return result;
}
Object localVarPostBody = null;

// verify the required parameter 'queueId' is set
if (queueId == null) {
CompletableFuture<ApiResponse<LLMObsAnnotatedInteractionResponse>> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400,
"Missing the required parameter 'queueId' when calling"
+ " getLLMObsAnnotatedInteraction"));
return result;
}

// verify the required parameter 'interactionId' is set
if (interactionId == null) {
CompletableFuture<ApiResponse<LLMObsAnnotatedInteractionResponse>> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400,
"Missing the required parameter 'interactionId' when calling"
+ " getLLMObsAnnotatedInteraction"));
return result;
}
// create path and map variables
String localVarPath =
"/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotated-interactions/{interaction_id}"
.replaceAll("\\{" + "queue_id" + "\\}", apiClient.escapeString(queueId.toString()))
.replaceAll(
"\\{" + "interaction_id" + "\\}", apiClient.escapeString(interactionId.toString()));

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.AgentObservabilityApi.getLLMObsAnnotatedInteraction",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<LLMObsAnnotatedInteractionResponse>> result =
new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"GET",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<LLMObsAnnotatedInteractionResponse>() {});
}

/**
* Get annotated queue interactions.
*
Expand Down
Loading
Loading