-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathUpdateLLMObsAnnotationQueue.java
More file actions
65 lines (61 loc) · 3.39 KB
/
Copy pathUpdateLLMObsAnnotationQueue.java
File metadata and controls
65 lines (61 loc) · 3.39 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Update an Agent Observability annotation queue 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.LLMObsAnnotationQueueResponse;
import com.datadog.api.client.v2.model.LLMObsAnnotationQueueType;
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) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.updateLLMObsAnnotationQueue", true);
AgentObservabilityApi apiInstance = new AgentObservabilityApi(defaultClient);
LLMObsAnnotationQueueUpdateRequest body =
new LLMObsAnnotationQueueUpdateRequest()
.data(
new LLMObsAnnotationQueueUpdateDataRequest()
.attributes(
new LLMObsAnnotationQueueUpdateDataAttributesRequest()
.annotationSchema(
new LLMObsAnnotationSchema()
.labelSchemas(
Collections.singletonList(
new LLMObsLabelSchema()
.description("Rating of the response quality.")
.hasAssessment(false)
.hasReasoning(false)
.id("abc-123")
.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")
.restrictToAssignees(false)
.restrictToReviewers(true)
.reviewerEmails(Collections.singletonList("reviewer@example.com")))
.type(LLMObsAnnotationQueueType.QUEUES));
try {
LLMObsAnnotationQueueResponse result =
apiInstance.updateLLMObsAnnotationQueue("00000000-0000-0000-0000-000000000001", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling AgentObservabilityApi#updateLLMObsAnnotationQueue");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}