-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathCreateLLMObsAnnotationQueueInteractions.java
More file actions
48 lines (44 loc) · 2.38 KB
/
CreateLLMObsAnnotationQueueInteractions.java
File metadata and controls
48 lines (44 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Add annotation queue interactions 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.LLMObsInteractionType;
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()
.contentId("trace-abc-123")
.type(LLMObsInteractionType.TRACE))))
.type(LLMObsAnnotationQueueInteractionsType.INTERACTIONS));
try {
LLMObsAnnotationQueueInteractionsResponse result =
apiInstance.createLLMObsAnnotationQueueInteractions(
"b5e7f3a1-9c2d-4f8b-a1e6-3d7e9f0a2b4c", 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();
}
}
}