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
787 changes: 786 additions & 1 deletion .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

155 changes: 153 additions & 2 deletions features/v2/llm_observability.feature
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
@endpoint(llm-observability) @endpoint(llm-observability-v2)
Feature: LLM Observability
Manage LLM Observability projects, datasets, dataset records, and
experiments via the Experiments API.
Manage LLM Observability projects, datasets, dataset records, experiments,
and annotations.

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "LLMObservability" API

@generated @skip @team:DataDog/ml-observability
Scenario: Add annotation queue interactions returns "Bad Request" response
Given operation "CreateLLMObsAnnotationQueueInteractions" enabled
And new "CreateLLMObsAnnotationQueueInteractions" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"interactions": [{"content_id": "trace-abc-123", "type": "trace"}]}, "type": "interactions"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ml-observability
Scenario: Add annotation queue interactions returns "Created" response
Given operation "CreateLLMObsAnnotationQueueInteractions" enabled
And new "CreateLLMObsAnnotationQueueInteractions" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"interactions": [{"content_id": "trace-abc-123", "type": "trace"}]}, "type": "interactions"}}
When the request is sent
Then the response status is 201 Created

@generated @skip @team:DataDog/ml-observability
Scenario: Add annotation queue interactions returns "Not Found" response
Given operation "CreateLLMObsAnnotationQueueInteractions" enabled
And new "CreateLLMObsAnnotationQueueInteractions" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"interactions": [{"content_id": "trace-abc-123", "type": "trace"}]}, "type": "interactions"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/ml-observability
Scenario: Append records to an LLM Observability dataset returns "Bad Request" response
Given operation "CreateLLMObsDatasetRecords" enabled
Expand Down Expand Up @@ -48,6 +75,22 @@ Feature: LLM Observability
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/ml-observability
Scenario: Create an LLM Observability annotation queue returns "Bad Request" response
Given operation "CreateLLMObsAnnotationQueue" enabled
And new "CreateLLMObsAnnotationQueue" request
And body with value {"data": {"attributes": {"description": "Queue for annotating customer support traces", "name": "My annotation queue", "project_id": "a33671aa-24fd-4dcd-9b33-a8ec7dde7751"}, "type": "queues"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ml-observability
Scenario: Create an LLM Observability annotation queue returns "Created" response
Given operation "CreateLLMObsAnnotationQueue" enabled
And new "CreateLLMObsAnnotationQueue" request
And body with value {"data": {"attributes": {"description": "Queue for annotating customer support traces", "name": "My annotation queue", "project_id": "a33671aa-24fd-4dcd-9b33-a8ec7dde7751"}, "type": "queues"}}
When the request is sent
Then the response status is 201 Created

@generated @skip @team:DataDog/ml-observability
Scenario: Create an LLM Observability dataset returns "Bad Request" response
Given operation "CreateLLMObsDataset" enabled
Expand Down Expand Up @@ -221,6 +264,87 @@ Feature: LLM Observability
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/ml-observability
Scenario: Delete an LLM Observability annotation queue returns "No Content" response
Given operation "DeleteLLMObsAnnotationQueue" enabled
And new "DeleteLLMObsAnnotationQueue" request
And request contains "queue_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/ml-observability
Scenario: Delete an LLM Observability annotation queue returns "Not Found" response
Given operation "DeleteLLMObsAnnotationQueue" enabled
And new "DeleteLLMObsAnnotationQueue" request
And request contains "queue_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/ml-observability
Scenario: Delete annotation queue interactions returns "Bad Request" response
Given operation "DeleteLLMObsAnnotationQueueInteractions" enabled
And new "DeleteLLMObsAnnotationQueueInteractions" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"interaction_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "interactions"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ml-observability
Scenario: Delete annotation queue interactions returns "No Content" response
Given operation "DeleteLLMObsAnnotationQueueInteractions" enabled
And new "DeleteLLMObsAnnotationQueueInteractions" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"interaction_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "interactions"}}
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/ml-observability
Scenario: Delete annotation queue interactions returns "Not Found" response
Given operation "DeleteLLMObsAnnotationQueueInteractions" enabled
And new "DeleteLLMObsAnnotationQueueInteractions" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"interaction_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "interactions"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/ml-observability
Scenario: Get annotated queue interactions returns "Bad Request" response
Given operation "GetLLMObsAnnotatedInteractions" enabled
And new "GetLLMObsAnnotatedInteractions" request
And request contains "queue_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ml-observability
Scenario: Get annotated queue interactions returns "Not Found" response
Given operation "GetLLMObsAnnotatedInteractions" enabled
And new "GetLLMObsAnnotatedInteractions" request
And request contains "queue_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/ml-observability
Scenario: Get annotated queue interactions returns "OK" response
Given operation "GetLLMObsAnnotatedInteractions" enabled
And new "GetLLMObsAnnotatedInteractions" request
And request contains "queue_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/ml-observability
Scenario: List LLM Observability annotation queues returns "Bad Request" response
Given operation "ListLLMObsAnnotationQueues" enabled
And new "ListLLMObsAnnotationQueues" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ml-observability
Scenario: List LLM Observability annotation queues returns "OK" response
Given operation "ListLLMObsAnnotationQueues" enabled
And new "ListLLMObsAnnotationQueues" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/ml-observability
Scenario: List LLM Observability dataset records returns "Bad Request" response
Given operation "ListLLMObsDatasetRecords" enabled
Expand Down Expand Up @@ -357,6 +481,33 @@ Feature: LLM Observability
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/ml-observability
Scenario: Update an LLM Observability annotation queue returns "Bad Request" response
Given operation "UpdateLLMObsAnnotationQueue" enabled
And new "UpdateLLMObsAnnotationQueue" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "Updated description", "name": "Updated queue name"}, "type": "queues"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ml-observability
Scenario: Update an LLM Observability annotation queue returns "Not Found" response
Given operation "UpdateLLMObsAnnotationQueue" enabled
And new "UpdateLLMObsAnnotationQueue" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "Updated description", "name": "Updated queue name"}, "type": "queues"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/ml-observability
Scenario: Update an LLM Observability annotation queue returns "OK" response
Given operation "UpdateLLMObsAnnotationQueue" enabled
And new "UpdateLLMObsAnnotationQueue" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "Updated description", "name": "Updated queue name"}, "type": "queues"}}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/ml-observability
Scenario: Update an LLM Observability dataset returns "Bad Request" response
Given operation "UpdateLLMObsDataset" enabled
Expand Down
60 changes: 60 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3087,6 +3087,66 @@
"type": "idempotent"
}
},
"ListLLMObsAnnotationQueues": {
"tag": "LLM Observability",
"undo": {
"type": "safe"
}
},
"CreateLLMObsAnnotationQueue": {
"tag": "LLM Observability",
"undo": {
"operationId": "DeleteLLMObsAnnotationQueue",
"parameters": [
{
"name": "queue_id",
"source": "data.id"
}
],
"type": "unsafe"
}
},
"DeleteLLMObsAnnotationQueue": {
"tag": "LLM Observability",
"undo": {
"type": "idempotent"
}
},
"UpdateLLMObsAnnotationQueue": {
"tag": "LLM Observability",
"undo": {
"type": "idempotent"
}
},
"GetLLMObsAnnotatedInteractions": {
"tag": "LLM Observability",
"undo": {
"type": "safe"
}
},
"CreateLLMObsAnnotationQueueInteractions": {
"tag": "LLM Observability",
"undo": {
"operationId": "DeleteLLMObsAnnotationQueueInteractions",
"parameters": [
{
"name": "queue_id",
"source": "path.queue_id"
},
{
"name": "body",
"template": "{\"data\": {\"type\": \"interactions\", \"attributes\": {\"interaction_ids\": [\"{{ data.attributes.interactions[0].id }}\"]}}}"
}
],
"type": "unsafe"
}
},
"DeleteLLMObsAnnotationQueueInteractions": {
"tag": "LLM Observability",
"undo": {
"type": "idempotent"
}
},
"ListLLMObsExperiments": {
"tag": "LLM Observability",
"undo": {
Expand Down
65 changes: 65 additions & 0 deletions private/bdd_runner/src/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7769,6 +7769,71 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
},
operationResponseType: "IPAllowlistResponse",
},
"LLMObservabilityApi.V2.ListLLMObsAnnotationQueues": {
projectId: {
type: "string",
format: "",
},
queueIds: {
type: "Array<string>",
format: "",
},
operationResponseType: "LLMObsAnnotationQueuesResponse",
},
"LLMObservabilityApi.V2.CreateLLMObsAnnotationQueue": {
body: {
type: "LLMObsAnnotationQueueRequest",
format: "",
},
operationResponseType: "LLMObsAnnotationQueueResponse",
},
"LLMObservabilityApi.V2.DeleteLLMObsAnnotationQueue": {
queueId: {
type: "string",
format: "",
},
operationResponseType: "{}",
},
"LLMObservabilityApi.V2.UpdateLLMObsAnnotationQueue": {
queueId: {
type: "string",
format: "",
},
body: {
type: "LLMObsAnnotationQueueUpdateRequest",
format: "",
},
operationResponseType: "LLMObsAnnotationQueueResponse",
},
"LLMObservabilityApi.V2.GetLLMObsAnnotatedInteractions": {
queueId: {
type: "string",
format: "",
},
operationResponseType: "LLMObsAnnotatedInteractionsResponse",
},
"LLMObservabilityApi.V2.CreateLLMObsAnnotationQueueInteractions": {
queueId: {
type: "string",
format: "",
},
body: {
type: "LLMObsAnnotationQueueInteractionsRequest",
format: "",
},
operationResponseType: "LLMObsAnnotationQueueInteractionsResponse",
},
"LLMObservabilityApi.V2.DeleteLLMObsAnnotationQueueInteractions": {
queueId: {
type: "string",
format: "",
},
body: {
type: "LLMObsDeleteAnnotationQueueInteractionsRequest",
format: "",
},
operationResponseType: "{}",
},
"LLMObservabilityApi.V2.ListLLMObsExperiments": {
filterProjectId: {
type: "string",
Expand Down
6 changes: 3 additions & 3 deletions services/llm_observability/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Description

Manage LLM Observability projects, datasets, dataset records, and experiments via the Experiments API.
Manage LLM Observability projects, datasets, dataset records, experiments, and annotations.

## Navigation

Expand All @@ -28,15 +28,15 @@ const configuration = createConfiguration();
// Enable unstable operations
const configurationOpts = {
unstableOperations: {
"LLMObservabilityApi.v2.listLLMObsExperiments": true
"LLMObservabilityApi.v2.listLLMObsAnnotationQueues": true
}
}

const configuration = createConfiguration(configurationOpts);
const apiInstance = new LLMObservabilityApiV2(configuration);
const params = {/* parameters */};

apiInstance.listLLMObsExperiments(params).then((data) => {
apiInstance.listLLMObsAnnotationQueues(params).then((data) => {
console.log("API called successfully. Returned data: " + JSON.stringify(data));
}).catch((error) => {
console.error("Error calling API: " + error);
Expand Down
Loading
Loading