Skip to content

Commit 4b41f0e

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Annotations endpoints (#3882)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 0352cef commit 4b41f0e

File tree

45 files changed

+4399
-30
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4399
-30
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 786 additions & 1 deletion
Large diffs are not rendered by default.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Create an LLM Observability annotation queue returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createLLMObsAnnotationQueue"] = true;
9+
const apiInstance = new v2.LLMObservabilityApi(configuration);
10+
11+
const params: v2.LLMObservabilityApiCreateLLMObsAnnotationQueueRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
description: "Queue for annotating customer support traces",
16+
name: "My annotation queue",
17+
projectId: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751",
18+
},
19+
type: "queues",
20+
},
21+
},
22+
};
23+
24+
apiInstance
25+
.createLLMObsAnnotationQueue(params)
26+
.then((data: v2.LLMObsAnnotationQueueResponse) => {
27+
console.log(
28+
"API called successfully. Returned data: " + JSON.stringify(data)
29+
);
30+
})
31+
.catch((error: any) => console.error(error));
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Add annotation queue interactions returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createLLMObsAnnotationQueueInteractions"] =
9+
true;
10+
const apiInstance = new v2.LLMObservabilityApi(configuration);
11+
12+
const params: v2.LLMObservabilityApiCreateLLMObsAnnotationQueueInteractionsRequest =
13+
{
14+
body: {
15+
data: {
16+
attributes: {
17+
interactions: [
18+
{
19+
contentId: "trace-abc-123",
20+
type: "trace",
21+
},
22+
],
23+
},
24+
type: "interactions",
25+
},
26+
},
27+
queueId: "queue_id",
28+
};
29+
30+
apiInstance
31+
.createLLMObsAnnotationQueueInteractions(params)
32+
.then((data: v2.LLMObsAnnotationQueueInteractionsResponse) => {
33+
console.log(
34+
"API called successfully. Returned data: " + JSON.stringify(data)
35+
);
36+
})
37+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Delete an LLM Observability annotation queue returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.deleteLLMObsAnnotationQueue"] = true;
9+
const apiInstance = new v2.LLMObservabilityApi(configuration);
10+
11+
const params: v2.LLMObservabilityApiDeleteLLMObsAnnotationQueueRequest = {
12+
queueId: "queue_id",
13+
};
14+
15+
apiInstance
16+
.deleteLLMObsAnnotationQueue(params)
17+
.then((data: any) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Delete annotation queue interactions returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.deleteLLMObsAnnotationQueueInteractions"] =
9+
true;
10+
const apiInstance = new v2.LLMObservabilityApi(configuration);
11+
12+
const params: v2.LLMObservabilityApiDeleteLLMObsAnnotationQueueInteractionsRequest =
13+
{
14+
body: {
15+
data: {
16+
attributes: {
17+
interactionIds: [
18+
"00000000-0000-0000-0000-000000000000",
19+
"00000000-0000-0000-0000-000000000001",
20+
],
21+
},
22+
type: "interactions",
23+
},
24+
},
25+
queueId: "queue_id",
26+
};
27+
28+
apiInstance
29+
.deleteLLMObsAnnotationQueueInteractions(params)
30+
.then((data: any) => {
31+
console.log(
32+
"API called successfully. Returned data: " + JSON.stringify(data)
33+
);
34+
})
35+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Get annotated queue interactions returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getLLMObsAnnotatedInteractions"] = true;
9+
const apiInstance = new v2.LLMObservabilityApi(configuration);
10+
11+
const params: v2.LLMObservabilityApiGetLLMObsAnnotatedInteractionsRequest = {
12+
queueId: "queue_id",
13+
};
14+
15+
apiInstance
16+
.getLLMObsAnnotatedInteractions(params)
17+
.then((data: v2.LLMObsAnnotatedInteractionsResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* List LLM Observability annotation queues returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listLLMObsAnnotationQueues"] = true;
9+
const apiInstance = new v2.LLMObservabilityApi(configuration);
10+
11+
apiInstance
12+
.listLLMObsAnnotationQueues()
13+
.then((data: v2.LLMObsAnnotationQueuesResponse) => {
14+
console.log(
15+
"API called successfully. Returned data: " + JSON.stringify(data)
16+
);
17+
})
18+
.catch((error: any) => console.error(error));
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Update an LLM Observability annotation queue returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.updateLLMObsAnnotationQueue"] = true;
9+
const apiInstance = new v2.LLMObservabilityApi(configuration);
10+
11+
const params: v2.LLMObservabilityApiUpdateLLMObsAnnotationQueueRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
description: "Updated description",
16+
name: "Updated queue name",
17+
},
18+
type: "queues",
19+
},
20+
},
21+
queueId: "queue_id",
22+
};
23+
24+
apiInstance
25+
.updateLLMObsAnnotationQueue(params)
26+
.then((data: v2.LLMObsAnnotationQueueResponse) => {
27+
console.log(
28+
"API called successfully. Returned data: " + JSON.stringify(data)
29+
);
30+
})
31+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7759,6 +7759,71 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
77597759
},
77607760
"operationResponseType": "IPAllowlistResponse",
77617761
},
7762+
"v2.ListLLMObsAnnotationQueues": {
7763+
"projectId": {
7764+
"type": "string",
7765+
"format": "",
7766+
},
7767+
"queueIds": {
7768+
"type": "Array<string>",
7769+
"format": "",
7770+
},
7771+
"operationResponseType": "LLMObsAnnotationQueuesResponse",
7772+
},
7773+
"v2.CreateLLMObsAnnotationQueue": {
7774+
"body": {
7775+
"type": "LLMObsAnnotationQueueRequest",
7776+
"format": "",
7777+
},
7778+
"operationResponseType": "LLMObsAnnotationQueueResponse",
7779+
},
7780+
"v2.DeleteLLMObsAnnotationQueue": {
7781+
"queueId": {
7782+
"type": "string",
7783+
"format": "",
7784+
},
7785+
"operationResponseType": "{}",
7786+
},
7787+
"v2.UpdateLLMObsAnnotationQueue": {
7788+
"queueId": {
7789+
"type": "string",
7790+
"format": "",
7791+
},
7792+
"body": {
7793+
"type": "LLMObsAnnotationQueueUpdateRequest",
7794+
"format": "",
7795+
},
7796+
"operationResponseType": "LLMObsAnnotationQueueResponse",
7797+
},
7798+
"v2.GetLLMObsAnnotatedInteractions": {
7799+
"queueId": {
7800+
"type": "string",
7801+
"format": "",
7802+
},
7803+
"operationResponseType": "LLMObsAnnotatedInteractionsResponse",
7804+
},
7805+
"v2.CreateLLMObsAnnotationQueueInteractions": {
7806+
"queueId": {
7807+
"type": "string",
7808+
"format": "",
7809+
},
7810+
"body": {
7811+
"type": "LLMObsAnnotationQueueInteractionsRequest",
7812+
"format": "",
7813+
},
7814+
"operationResponseType": "LLMObsAnnotationQueueInteractionsResponse",
7815+
},
7816+
"v2.DeleteLLMObsAnnotationQueueInteractions": {
7817+
"queueId": {
7818+
"type": "string",
7819+
"format": "",
7820+
},
7821+
"body": {
7822+
"type": "LLMObsDeleteAnnotationQueueInteractionsRequest",
7823+
"format": "",
7824+
},
7825+
"operationResponseType": "{}",
7826+
},
77627827
"v2.ListLLMObsExperiments": {
77637828
"filterProjectId": {
77647829
"type": "string",

0 commit comments

Comments
 (0)