From 5ad5c56e2446b5458ef42627504936e34ee3332d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 20 May 2026 15:31:08 +0000 Subject: [PATCH] Regenerate client from commit 1bf3191 of spec repo --- .generator/schemas/v2/openapi.yaml | 845 +++++++++++++++++- features/v2/llm_observability.feature | 50 +- features/v2/undo.json | 20 + .../src/support/scenarios_model_mapping.ts | 65 ++ services/llm_observability/README.md | 2 +- .../src/v2/LLMObservabilityApi.ts | 655 ++++++++++++++ services/llm_observability/src/v2/index.ts | 31 + .../v2/models/LLMObsDataDeletionRequest.ts | 47 + .../LLMObsDataDeletionRequestAttributes.ts | 74 ++ .../models/LLMObsDataDeletionRequestData.ts | 57 ++ .../models/LLMObsDataDeletionRequestType.ts | 9 + .../v2/models/LLMObsDataDeletionResponse.ts | 47 + .../LLMObsDataDeletionResponseAttributes.ts | 103 +++ .../models/LLMObsDataDeletionResponseData.ts | 66 ++ .../models/LLMObsDataDeletionResponseType.ts | 9 + .../src/v2/models/LLMObsSearchSpansRequest.ts | 47 + .../LLMObsSearchSpansRequestAttributes.ts | 72 ++ .../v2/models/LLMObsSearchSpansRequestData.ts | 57 ++ .../v2/models/LLMObsSearchSpansRequestType.ts | 7 + .../src/v2/models/LLMObsSpanAttributes.ts | 202 +++++ .../src/v2/models/LLMObsSpanData.ts | 66 ++ .../v2/models/LLMObsSpanEvaluationMetric.ts | 84 ++ .../src/v2/models/LLMObsSpanFilter.ts | 108 +++ .../src/v2/models/LLMObsSpanIO.ts | 54 ++ .../src/v2/models/LLMObsSpanMessage.ts | 79 ++ .../src/v2/models/LLMObsSpanPageQuery.ts | 53 ++ .../src/v2/models/LLMObsSpanSearchOptions.ts | 53 ++ .../src/v2/models/LLMObsSpanToolCall.ts | 68 ++ .../src/v2/models/LLMObsSpanToolDefinition.ts | 68 ++ .../src/v2/models/LLMObsSpanToolResult.ts | 68 ++ .../src/v2/models/LLMObsSpanType.ts | 7 + .../src/v2/models/LLMObsSpansResponse.ts | 66 ++ .../src/v2/models/LLMObsSpansResponseLinks.ts | 44 + .../src/v2/models/LLMObsSpansResponseMeta.ts | 75 ++ .../src/v2/models/LLMObsSpansResponsePage.ts | 44 + .../src/v2/models/TypingInfo.ts | 52 ++ 36 files changed, 3450 insertions(+), 4 deletions(-) create mode 100644 services/llm_observability/src/v2/models/LLMObsDataDeletionRequest.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsDataDeletionRequestAttributes.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsDataDeletionRequestData.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsDataDeletionRequestType.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsDataDeletionResponse.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsDataDeletionResponseAttributes.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsDataDeletionResponseData.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsDataDeletionResponseType.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSearchSpansRequest.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSearchSpansRequestAttributes.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSearchSpansRequestData.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSearchSpansRequestType.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpanAttributes.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpanData.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpanEvaluationMetric.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpanFilter.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpanIO.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpanMessage.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpanPageQuery.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpanSearchOptions.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpanToolCall.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpanToolDefinition.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpanToolResult.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpanType.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpansResponse.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpansResponseLinks.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpansResponseMeta.ts create mode 100644 services/llm_observability/src/v2/models/LLMObsSpansResponsePage.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 901b7a232478..ac098a3c305d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -42437,6 +42437,139 @@ components: example: "my-gcp-project" type: string type: object + LLMObsDataDeletionRequest: + description: Request to delete LLM Observability data. + properties: + data: + $ref: "#/components/schemas/LLMObsDataDeletionRequestData" + required: + - data + type: object + LLMObsDataDeletionRequestAttributes: + description: Attributes for an LLM Observability data deletion request. + properties: + delay: + description: Optional delay in seconds before the deletion is executed. + example: 0 + format: int64 + type: integer + from: + description: Start of the deletion time range in milliseconds since Unix epoch. + example: 1705314600000 + format: int64 + type: integer + query: + additionalProperties: + type: string + description: Query filters selecting the data to delete. Must include a `query` key with an `@trace_id` filter. + example: + query: "@trace_id:abc123def456" + type: object + to: + description: End of the deletion time range in milliseconds since Unix epoch. + example: 1705315200000 + format: int64 + type: integer + required: + - query + - from + - to + type: object + LLMObsDataDeletionRequestData: + description: Data object for an LLM Observability data deletion request. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDataDeletionRequestAttributes" + type: + $ref: "#/components/schemas/LLMObsDataDeletionRequestType" + required: + - type + - attributes + type: object + LLMObsDataDeletionRequestType: + description: Resource type for an LLM Observability data deletion request. + enum: + - create_deletion_req + example: create_deletion_req + type: string + x-enum-varnames: + - CREATE_DELETION_REQ + LLMObsDataDeletionResponse: + description: Response containing details of a submitted LLM Observability data deletion request. + properties: + data: + $ref: "#/components/schemas/LLMObsDataDeletionResponseData" + required: + - data + type: object + LLMObsDataDeletionResponseAttributes: + description: Attributes of a submitted LLM Observability data deletion request. + properties: + created_at: + description: Timestamp when the deletion request was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + created_by: + description: UUID of the user who created the deletion request. + example: "user-uuid-1234" + type: string + from_time: + description: Start of the deletion time range in milliseconds since Unix epoch. + example: 1705314600000 + format: int64 + type: integer + org_id: + description: ID of the organization that submitted the deletion request. + example: 12345 + format: int64 + type: integer + product: + description: Product name for the deletion request. + example: "llmobs" + type: string + query: + description: The query string used to select data for deletion. + example: "@trace_id:abc123def456" + type: string + to_time: + description: End of the deletion time range in milliseconds since Unix epoch. + example: 1705315200000 + format: int64 + type: integer + required: + - org_id + - product + - created_at + - created_by + - from_time + - to_time + - query + type: object + LLMObsDataDeletionResponseData: + description: Data object for an LLM Observability data deletion response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDataDeletionResponseAttributes" + id: + description: Unique identifier of the deletion request. + example: "msg-abc123" + type: string + type: + $ref: "#/components/schemas/LLMObsDataDeletionResponseType" + required: + - id + - type + - attributes + type: object + LLMObsDataDeletionResponseType: + description: Resource type for an LLM Observability data deletion response. + enum: + - deletion_request + example: deletion_request + type: string + x-enum-varnames: + - DELETION_REQUEST LLMObsDatasetDataAttributesRequest: description: Attributes for creating an LLM Observability dataset. properties: @@ -44312,6 +44445,395 @@ components: type: string x-enum-varnames: - RECORDS + LLMObsSearchSpansRequest: + description: Request body for searching LLM Observability spans. + properties: + data: + $ref: "#/components/schemas/LLMObsSearchSpansRequestData" + required: + - data + type: object + LLMObsSearchSpansRequestAttributes: + description: Attributes of an LLM Observability spans search request. + properties: + filter: + $ref: "#/components/schemas/LLMObsSpanFilter" + options: + $ref: "#/components/schemas/LLMObsSpanSearchOptions" + page: + $ref: "#/components/schemas/LLMObsSpanPageQuery" + sort: + description: Sort order for the results. Use `-` prefix for descending order. + example: "-start_ns" + type: string + type: object + LLMObsSearchSpansRequestData: + description: Data object for an LLM Observability spans search request. + properties: + attributes: + $ref: "#/components/schemas/LLMObsSearchSpansRequestAttributes" + type: + $ref: "#/components/schemas/LLMObsSearchSpansRequestType" + required: + - type + - attributes + type: object + LLMObsSearchSpansRequestType: + description: Resource type for an LLM Observability spans search request. + enum: + - spans + example: spans + type: string + x-enum-varnames: + - SPANS + LLMObsSpanAttributes: + description: Attributes of an LLM Observability span. + properties: + duration: + description: Duration of the span in nanoseconds. + example: 1500000000.0 + format: double + type: number + evaluation: + additionalProperties: + $ref: "#/components/schemas/LLMObsSpanEvaluationMetric" + description: Evaluation metrics keyed by evaluator name. + type: object + input: + $ref: "#/components/schemas/LLMObsSpanIO" + intent: + description: Detected intent of the span. + type: string + metadata: + additionalProperties: {} + description: Arbitrary metadata associated with the span. + type: object + metrics: + additionalProperties: + format: double + type: number + description: Numeric metrics associated with the span (e.g., token counts). + type: object + ml_app: + description: Name of the ML application this span belongs to. + example: "my-llm-app" + type: string + model_name: + description: Name of the model used in this span. + example: "gpt-4o" + type: string + model_provider: + description: Provider of the model used in this span. + example: "openai" + type: string + name: + description: Name of the span. + example: "llm_call" + type: string + output: + $ref: "#/components/schemas/LLMObsSpanIO" + parent_id: + description: Identifier of the parent span, if any. + type: string + span_id: + description: Unique identifier of the span. + example: "abc123def456" + type: string + span_kind: + description: Kind of span (e.g., llm, agent, tool, task, workflow). + example: "llm" + type: string + start_ns: + description: Start time of the span in nanoseconds since Unix epoch. + example: 1705314600000000000 + format: int64 + type: integer + status: + description: Status of the span (e.g., ok, error). + example: "ok" + type: string + tags: + description: Tags associated with the span. + items: + type: string + type: array + tool_definitions: + description: Tool definitions available to the span. + items: + $ref: "#/components/schemas/LLMObsSpanToolDefinition" + type: array + trace_id: + description: Trace identifier this span belongs to. + example: "trace-9a8b7c6d5e4f" + type: string + required: + - span_id + - trace_id + - name + - status + - start_ns + - duration + - ml_app + - span_kind + type: object + LLMObsSpanData: + description: A single LLM Observability span. + properties: + attributes: + $ref: "#/components/schemas/LLMObsSpanAttributes" + id: + description: Unique identifier of the span. + example: "abc123def456" + type: string + type: + $ref: "#/components/schemas/LLMObsSpanType" + required: + - id + - type + - attributes + type: object + LLMObsSpanEvaluationMetric: + description: An evaluation metric associated with an LLM Observability span. + properties: + assessment: + description: Assessment result (e.g., pass or fail). + example: pass + type: string + eval_metric_type: + description: Type of the evaluation metric (e.g., score, categorical, boolean). + example: score + type: string + reasoning: + description: Human-readable reasoning for the evaluation result. + type: string + status: + description: Status of the evaluation execution. + type: string + tags: + description: Tags associated with the evaluation metric. + items: + type: string + type: array + value: + description: Value of the evaluation result. + type: object + LLMObsSpanFilter: + description: Filter criteria for an LLM Observability span search. + properties: + from: + description: Start of the time range. Accepts ISO 8601 or relative format (e.g., `now-15m`). Defaults to `now-15m`. + example: "now-900s" + type: string + ml_app: + description: Filter by ML application name. + example: "my-llm-app" + type: string + query: + description: >- + Search query using LLM Observability query syntax. Supports attribute filters using the field:value syntax (e.g. session_id, trace_id, ml_app, meta.span.kind). When provided, structured field filters (`span_id`, `trace_id`, etc.) are ignored. + example: "@session_id:abc123def456" + type: string + span_id: + description: Filter by exact span ID. + example: "abc123def456" + type: string + span_kind: + description: Filter by span kind (e.g., llm, agent, tool, task, workflow). + example: "llm" + type: string + span_name: + description: Filter by span name. + example: "llm_call" + type: string + tags: + additionalProperties: + type: string + description: Filter by tag key-value pairs. + type: object + to: + description: End of the time range. Accepts ISO 8601 or relative format (e.g., `now`). Defaults to `now`. + example: "now" + type: string + trace_id: + description: Filter by exact trace ID. + example: "trace-9a8b7c6d5e4f" + type: string + type: object + LLMObsSpanIO: + description: Input or output content of an LLM Observability span. + properties: + messages: + description: List of messages in the input or output. + items: + $ref: "#/components/schemas/LLMObsSpanMessage" + type: array + value: + description: Plain-text value of the input or output. + type: string + type: object + LLMObsSpanMessage: + description: A single message in a span input or output. + properties: + content: + description: Text content of the message. + type: string + id: + description: Unique identifier of the message. + type: string + role: + description: Role of the message sender (e.g., user, assistant, system). + type: string + tool_calls: + description: Tool calls made in this message. + items: + $ref: "#/components/schemas/LLMObsSpanToolCall" + type: array + tool_results: + description: Tool results returned in this message. + items: + $ref: "#/components/schemas/LLMObsSpanToolResult" + type: array + type: object + LLMObsSpanPageQuery: + description: Pagination settings for a span search request. + properties: + cursor: + description: Cursor from the previous response to retrieve the next page. + example: "eyJzdGFydCI6MTAwfQ==" + type: string + limit: + description: Maximum number of spans to return. Defaults to `10`. + example: 10 + format: int64 + type: integer + type: object + LLMObsSpanSearchOptions: + description: Additional options for a span search request. + properties: + include_attachments: + description: Whether to include attachment data in the response. Defaults to `true`. + example: true + type: boolean + time_offset: + description: Offset in seconds applied to both `from` and `to` timestamps. + example: 0 + format: int64 + type: integer + type: object + LLMObsSpanToolCall: + description: A tool call made during a span. + properties: + arguments: + additionalProperties: {} + description: Arguments passed to the tool. + type: object + name: + description: Name of the tool called. + type: string + tool_id: + description: Identifier of the tool call. + type: string + type: + description: Type of the tool call. + type: string + type: object + LLMObsSpanToolDefinition: + description: A tool definition available to an LLM span. + properties: + description: + description: Description of what the tool does. + type: string + name: + description: Name of the tool. + type: string + schema: + additionalProperties: {} + description: JSON schema describing the tool's input parameters. + type: object + version: + description: Version of the tool definition. + type: string + type: object + LLMObsSpanToolResult: + description: A result returned from a tool call during a span. + properties: + name: + description: Name of the tool that produced this result. + type: string + result: + description: Result value returned by the tool. + type: string + tool_id: + description: Identifier of the corresponding tool call. + type: string + type: + description: Type of the tool result. + type: string + type: object + LLMObsSpanType: + description: Resource type for an LLM Observability span. + enum: + - span + example: span + type: string + x-enum-varnames: + - SPAN + LLMObsSpansResponse: + description: Response containing a list of LLM Observability spans. + properties: + data: + description: List of spans matching the query. + items: + $ref: "#/components/schemas/LLMObsSpanData" + type: array + links: + $ref: "#/components/schemas/LLMObsSpansResponseLinks" + meta: + $ref: "#/components/schemas/LLMObsSpansResponseMeta" + required: + - data + - meta + type: object + LLMObsSpansResponseLinks: + description: Pagination links accompanying the spans response. + properties: + next: + description: URL to retrieve the next page of results. + example: "https://api.datadoghq.com/api/v2/llm-obs/v1/spans/events?page[cursor]=eyJzdGFydCI6MTAwfQ==" + type: string + type: object + LLMObsSpansResponseMeta: + description: Metadata accompanying the spans response. + properties: + elapsed: + description: Time elapsed for the query in milliseconds. + example: 132 + format: int64 + type: integer + page: + $ref: "#/components/schemas/LLMObsSpansResponsePage" + request_id: + description: Unique identifier for the request. + example: "req-abc123" + type: string + status: + description: Status of the query execution. + example: "done" + type: string + required: + - elapsed + - request_id + - status + - page + type: object + LLMObsSpansResponsePage: + description: Pagination cursor for the spans response. + properties: + after: + description: Cursor to retrieve the next page of results. Absent when there are no more results. + example: "eyJzdGFydCI6MTAwfQ==" + type: string + type: object LLMObsTraceAnnotatedInteractionItem: description: A trace, experiment trace, or session interaction with its associated annotations. properties: @@ -119398,6 +119920,77 @@ paths: operator: OR permissions: - org_management + /api/v2/llm-obs/deletion/data/llmobs: + post: + description: Submit a request to delete LLM Observability span data matching a trace ID filter within a specified time range. + operationId: DeleteLLMObsData + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + from: 1705314600000 + query: + query: "@trace_id:abc123def456" + to: 1705315200000 + type: create_deletion_req + schema: + $ref: "#/components/schemas/LLMObsDataDeletionRequest" + description: Data deletion request payload. + required: true + responses: + "202": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-15T10:30:00Z" + created_by: "user-uuid-1234" + from_time: 1705314600000 + org_id: 12345 + product: llmobs + query: "@trace_id:abc123def456" + to_time: 1705315200000 + id: msg-abc123 + type: deletion_request + schema: + $ref: "#/components/schemas/LLMObsDataDeletionResponse" + description: Accepted + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete LLM Observability data + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/llm-obs/v1/annotation-queues: get: description: |- @@ -121071,6 +121664,256 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/spans/events: + get: + description: List LLM Observability spans matching the specified filters. + operationId: ListLLMObsSpans + parameters: + - description: Start of the time range. Accepts ISO 8601 or relative format (e.g., `now-15m`). Defaults to `now-15m`. + in: query + name: filter[from] + schema: + example: "now-900s" + type: string + - description: End of the time range. Accepts ISO 8601 or relative format. Defaults to `now`. + in: query + name: filter[to] + schema: + example: "now" + type: string + - description: >- + Search query using LLM Observability query syntax. Supports attribute filters using the field:value syntax (e.g. session_id, trace_id, ml_app, meta.span.kind). When provided, structured field filters (`filter[span_id]`, `filter[trace_id]`, etc.) are ignored. + in: query + name: filter[query] + schema: + example: "@session_id:abc123def456" + type: string + - description: Filter by exact span ID. + in: query + name: filter[span_id] + schema: + type: string + - description: Filter by exact trace ID. + in: query + name: filter[trace_id] + schema: + type: string + - description: Filter by span kind (e.g., llm, agent, tool, task, workflow). + in: query + name: filter[span_kind] + schema: + type: string + - description: Filter by span name. + in: query + name: filter[span_name] + schema: + type: string + - description: Filter by ML application name. + in: query + name: filter[ml_app] + schema: + type: string + - description: Maximum number of spans to return. Defaults to `10`. + in: query + name: page[limit] + schema: + format: int64 + type: integer + - description: Cursor from the previous response to retrieve the next page. + in: query + name: page[cursor] + schema: + type: string + - description: Sort order for the results. + in: query + name: sort + schema: + type: string + - description: Whether to include attachment data in the response. Defaults to `true`. + in: query + name: include_attachments + schema: + type: boolean + responses: + "200": + content: + application/json: + examples: + default: + summary: List spans for an ML app + value: + data: + - attributes: + duration: 1500000000.0 + ml_app: my-llm-app + model_name: gpt-4o + model_provider: openai + name: llm_call + span_id: "abc123def456" + span_kind: llm + start_ns: 1705314600000000000 + status: ok + trace_id: "trace-9a8b7c6d5e4f" + id: "abc123def456" + type: span + meta: + elapsed: 132 + page: {} + request_id: req-abc123 + status: done + session_id: + summary: List spans filtered by session ID + value: + data: + - attributes: + duration: 1500000000.0 + ml_app: my-llm-app + name: llm_call + span_id: "abc123def456" + span_kind: llm + start_ns: 1705314600000000000 + status: ok + tags: + - "session_id:abc123def456" + trace_id: "trace-9a8b7c6d5e4f" + id: "abc123def456" + type: span + meta: + elapsed: 87 + page: {} + request_id: req-def456 + status: done + schema: + $ref: "#/components/schemas/LLMObsSpansResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List LLM Observability spans + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/spans/events/search: + post: + description: Search LLM Observability spans using structured filters in the request body. + operationId: SearchLLMObsSpans + requestBody: + content: + application/json: + examples: + default: + summary: Search spans for an ML app + value: + data: + attributes: + filter: + from: "now-900s" + ml_app: "my-llm-app" + span_kind: "llm" + to: "now" + options: + include_attachments: true + page: + limit: 10 + type: spans + session_id: + summary: Search all spans in a session + value: + data: + attributes: + filter: + from: "now-900s" + query: "@session_id:abc123def456" + to: "now" + options: + include_attachments: true + page: + limit: 50 + type: spans + schema: + $ref: "#/components/schemas/LLMObsSearchSpansRequest" + description: Search spans payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + duration: 1500000000.0 + ml_app: my-llm-app + model_name: gpt-4o + model_provider: openai + name: llm_call + span_id: "abc123def456" + span_kind: llm + start_ns: 1705314600000000000 + status: ok + trace_id: "trace-9a8b7c6d5e4f" + id: "abc123def456" + type: span + meta: + elapsed: 132 + page: {} + request_id: req-abc123 + status: done + schema: + $ref: "#/components/schemas/LLMObsSpansResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Search LLM Observability spans + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/llm-obs/v1/{project_id}/datasets: get: description: List all LLM Observability datasets for a project, sorted by creation date, newest first. @@ -157735,7 +158578,7 @@ tags: description: Find out more at url: "https://docs.datadoghq.com/account_management/api-app-keys/" name: Key Management - - description: Manage LLM Observability projects, datasets, dataset records, experiments, and annotations. + - description: Manage LLM Observability spans, data, projects, datasets, dataset records, experiments, and annotations. name: LLM Observability - description: |- Search your logs and send them to your Datadog platform over HTTP. See the [Log Management page](https://docs.datadoghq.com/logs/) for more information. diff --git a/features/v2/llm_observability.feature b/features/v2/llm_observability.feature index e8661824fd46..ec671390145d 100644 --- a/features/v2/llm_observability.feature +++ b/features/v2/llm_observability.feature @@ -1,7 +1,7 @@ @endpoint(llm-observability) @endpoint(llm-observability-v2) Feature: LLM Observability - Manage LLM Observability projects, datasets, dataset records, experiments, - and annotations. + Manage LLM Observability spans, data, projects, datasets, dataset records, + experiments, and annotations. Background: Given a valid "apiKeyAuth" key in the system @@ -245,6 +245,22 @@ Feature: LLM Observability When the request is sent Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/ml-observability + Scenario: Delete LLM Observability data returns "Accepted" response + Given operation "DeleteLLMObsData" enabled + And new "DeleteLLMObsData" request + And body with value {"data": {"attributes": {"delay": 0, "from": 1705314600000, "query": {"query": "@trace_id:abc123def456"}, "to": 1705315200000}, "type": "create_deletion_req"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/ml-observability + Scenario: Delete LLM Observability data returns "Bad Request" response + Given operation "DeleteLLMObsData" enabled + And new "DeleteLLMObsData" request + And body with value {"data": {"attributes": {"delay": 0, "from": 1705314600000, "query": {"query": "@trace_id:abc123def456"}, "to": 1705315200000}, "type": "create_deletion_req"}} + When the request is sent + Then the response status is 400 Bad Request + @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability dataset records returns "Bad Request" response Given operation "DeleteLLMObsDatasetRecords" enabled @@ -558,6 +574,20 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM Observability spans returns "Bad Request" response + Given operation "ListLLMObsSpans" enabled + And new "ListLLMObsSpans" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM Observability spans returns "OK" response + Given operation "ListLLMObsSpans" enabled + And new "ListLLMObsSpans" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: List events for an LLM Observability experiment returns "Bad Request" response Given operation "ListLLMObsExperimentEvents" enabled @@ -633,6 +663,22 @@ Feature: LLM Observability When the request is sent Then the response status is 206 Partial Content — more results are available. Use `meta.after` as the next `page.cursor`. + @generated @skip @team:DataDog/ml-observability + Scenario: Search LLM Observability spans returns "Bad Request" response + Given operation "SearchLLMObsSpans" enabled + And new "SearchLLMObsSpans" request + And body with value {"data": {"attributes": {"filter": {"from": "now-900s", "ml_app": "my-llm-app", "query": "@session_id:abc123def456", "span_id": "abc123def456", "span_kind": "llm", "span_name": "llm_call", "to": "now", "trace_id": "trace-9a8b7c6d5e4f"}, "options": {"include_attachments": true, "time_offset": 0}, "page": {"cursor": "eyJzdGFydCI6MTAwfQ==", "limit": 10}, "sort": "-start_ns"}, "type": "spans"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Search LLM Observability spans returns "OK" response + Given operation "SearchLLMObsSpans" enabled + And new "SearchLLMObsSpans" request + And body with value {"data": {"attributes": {"filter": {"from": "now-900s", "ml_app": "my-llm-app", "query": "@session_id:abc123def456", "span_id": "abc123def456", "span_kind": "llm", "span_name": "llm_call", "to": "now", "trace_id": "trace-9a8b7c6d5e4f"}, "options": {"include_attachments": true, "time_offset": 0}, "page": {"cursor": "eyJzdGFydCI6MTAwfQ==", "limit": 10}, "sort": "-start_ns"}, "type": "spans"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Simple search experimentation entities returns "Bad Request" response Given operation "SimpleSearchLLMObsExperimentation" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 1b8f5ec0b974..02753f1a80a7 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3660,6 +3660,14 @@ "type": "idempotent" } }, + "DeleteLLMObsData": { + "tag": "LLM Observability", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, "ListLLMObsAnnotationQueues": { "tag": "LLM Observability", "undo": { @@ -3817,6 +3825,18 @@ "type": "idempotent" } }, + "ListLLMObsSpans": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "SearchLLMObsSpans": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, "ListLLMObsDatasets": { "tag": "LLM Observability", "undo": { diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index 5ff8ede92da3..e5be093fdc5a 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -2585,6 +2585,13 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "{}", }, + "LLMObservabilityApi.V2.DeleteLLMObsData": { + body: { + type: "LLMObsDataDeletionRequest", + format: "", + }, + operationResponseType: "LLMObsDataDeletionResponse", + }, "LLMObservabilityApi.V2.ListLLMObsAnnotationQueues": { projectId: { type: "string", @@ -2792,6 +2799,64 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "LLMObsProjectResponse", }, + "LLMObservabilityApi.V2.ListLLMObsSpans": { + filterFrom: { + type: "string", + format: "", + }, + filterTo: { + type: "string", + format: "", + }, + filterQuery: { + type: "string", + format: "", + }, + filterSpanId: { + type: "string", + format: "", + }, + filterTraceId: { + type: "string", + format: "", + }, + filterSpanKind: { + type: "string", + format: "", + }, + filterSpanName: { + type: "string", + format: "", + }, + filterMlApp: { + type: "string", + format: "", + }, + pageLimit: { + type: "number", + format: "int64", + }, + pageCursor: { + type: "string", + format: "", + }, + sort: { + type: "string", + format: "", + }, + includeAttachments: { + type: "boolean", + format: "", + }, + operationResponseType: "LLMObsSpansResponse", + }, + "LLMObservabilityApi.V2.SearchLLMObsSpans": { + body: { + type: "LLMObsSearchSpansRequest", + format: "", + }, + operationResponseType: "LLMObsSpansResponse", + }, "LLMObservabilityApi.V2.ListLLMObsDatasets": { projectId: { type: "string", diff --git a/services/llm_observability/README.md b/services/llm_observability/README.md index d15fdd20c3f1..def2a10af800 100644 --- a/services/llm_observability/README.md +++ b/services/llm_observability/README.md @@ -2,7 +2,7 @@ ## Description -Manage LLM Observability projects, datasets, dataset records, experiments, and annotations. +Manage LLM Observability spans, data, projects, datasets, dataset records, experiments, and annotations. ## Navigation diff --git a/services/llm_observability/src/v2/LLMObservabilityApi.ts b/services/llm_observability/src/v2/LLMObservabilityApi.ts index 66947ce37735..3a972f7ef96e 100644 --- a/services/llm_observability/src/v2/LLMObservabilityApi.ts +++ b/services/llm_observability/src/v2/LLMObservabilityApi.ts @@ -35,6 +35,8 @@ import { LLMObsAnnotationQueuesResponse } from "./models/LLMObsAnnotationQueuesR import { LLMObsAnnotationQueueUpdateRequest } from "./models/LLMObsAnnotationQueueUpdateRequest"; import { LLMObsCustomEvalConfigResponse } from "./models/LLMObsCustomEvalConfigResponse"; import { LLMObsCustomEvalConfigUpdateRequest } from "./models/LLMObsCustomEvalConfigUpdateRequest"; +import { LLMObsDataDeletionRequest } from "./models/LLMObsDataDeletionRequest"; +import { LLMObsDataDeletionResponse } from "./models/LLMObsDataDeletionResponse"; import { LLMObsDatasetRecordsListResponse } from "./models/LLMObsDatasetRecordsListResponse"; import { LLMObsDatasetRecordsMutationResponse } from "./models/LLMObsDatasetRecordsMutationResponse"; import { LLMObsDatasetRecordsRequest } from "./models/LLMObsDatasetRecordsRequest"; @@ -64,6 +66,8 @@ import { LLMObsProjectRequest } from "./models/LLMObsProjectRequest"; import { LLMObsProjectResponse } from "./models/LLMObsProjectResponse"; import { LLMObsProjectsResponse } from "./models/LLMObsProjectsResponse"; import { LLMObsProjectUpdateRequest } from "./models/LLMObsProjectUpdateRequest"; +import { LLMObsSearchSpansRequest } from "./models/LLMObsSearchSpansRequest"; +import { LLMObsSpansResponse } from "./models/LLMObsSpansResponse"; import { version } from "../version"; export class LLMObservabilityApiRequestFactory extends BaseAPIRequestFactory { @@ -797,6 +801,64 @@ export class LLMObservabilityApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async deleteLLMObsData( + body: LLMObsDataDeletionRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations["LLMObservabilityApi.v2.deleteLLMObsData"] + ) { + throw new Error( + "Unstable operation 'deleteLLMObsData' is disabled. Enable it by setting `configuration.unstableOperations['LLMObservabilityApi.v2.deleteLLMObsData'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "deleteLLMObsData"); + } + + // Path Params + const localVarPath = "/api/v2/llm-obs/deletion/data/llmobs"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "LLMObservabilityApi.v2.deleteLLMObsData", + LLMObservabilityApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "LLMObsDataDeletionRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async deleteLLMObsDatasetRecords( projectId: string, datasetId: string, @@ -1695,6 +1757,145 @@ export class LLMObservabilityApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async listLLMObsSpans( + filterFrom?: string, + filterTo?: string, + filterQuery?: string, + filterSpanId?: string, + filterTraceId?: string, + filterSpanKind?: string, + filterSpanName?: string, + filterMlApp?: string, + pageLimit?: number, + pageCursor?: string, + sort?: string, + includeAttachments?: boolean, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if (!_config.unstableOperations["LLMObservabilityApi.v2.listLLMObsSpans"]) { + throw new Error( + "Unstable operation 'listLLMObsSpans' is disabled. Enable it by setting `configuration.unstableOperations['LLMObservabilityApi.v2.listLLMObsSpans'] = true`", + ); + } + + // Path Params + const localVarPath = "/api/v2/llm-obs/v1/spans/events"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "LLMObservabilityApi.v2.listLLMObsSpans", + LLMObservabilityApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Query Params + if (filterFrom !== undefined) { + requestContext.setQueryParam( + "filter[from]", + serialize(filterFrom, TypingInfo, "string", ""), + "", + ); + } + if (filterTo !== undefined) { + requestContext.setQueryParam( + "filter[to]", + serialize(filterTo, TypingInfo, "string", ""), + "", + ); + } + if (filterQuery !== undefined) { + requestContext.setQueryParam( + "filter[query]", + serialize(filterQuery, TypingInfo, "string", ""), + "", + ); + } + if (filterSpanId !== undefined) { + requestContext.setQueryParam( + "filter[span_id]", + serialize(filterSpanId, TypingInfo, "string", ""), + "", + ); + } + if (filterTraceId !== undefined) { + requestContext.setQueryParam( + "filter[trace_id]", + serialize(filterTraceId, TypingInfo, "string", ""), + "", + ); + } + if (filterSpanKind !== undefined) { + requestContext.setQueryParam( + "filter[span_kind]", + serialize(filterSpanKind, TypingInfo, "string", ""), + "", + ); + } + if (filterSpanName !== undefined) { + requestContext.setQueryParam( + "filter[span_name]", + serialize(filterSpanName, TypingInfo, "string", ""), + "", + ); + } + if (filterMlApp !== undefined) { + requestContext.setQueryParam( + "filter[ml_app]", + serialize(filterMlApp, TypingInfo, "string", ""), + "", + ); + } + if (pageLimit !== undefined) { + requestContext.setQueryParam( + "page[limit]", + serialize(pageLimit, TypingInfo, "number", "int64"), + "", + ); + } + if (pageCursor !== undefined) { + requestContext.setQueryParam( + "page[cursor]", + serialize(pageCursor, TypingInfo, "string", ""), + "", + ); + } + if (sort !== undefined) { + requestContext.setQueryParam( + "sort", + serialize(sort, TypingInfo, "string", ""), + "", + ); + } + if (includeAttachments !== undefined) { + requestContext.setQueryParam( + "include_attachments", + serialize(includeAttachments, TypingInfo, "boolean", ""), + "", + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async searchLLMObsExperimentation( body: LLMObsExperimentationSearchRequest, _options?: Configuration, @@ -1755,6 +1956,64 @@ export class LLMObservabilityApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async searchLLMObsSpans( + body: LLMObsSearchSpansRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations["LLMObservabilityApi.v2.searchLLMObsSpans"] + ) { + throw new Error( + "Unstable operation 'searchLLMObsSpans' is disabled. Enable it by setting `configuration.unstableOperations['LLMObservabilityApi.v2.searchLLMObsSpans'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "searchLLMObsSpans"); + } + + // Path Params + const localVarPath = "/api/v2/llm-obs/v1/spans/events/search"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "LLMObservabilityApi.v2.searchLLMObsSpans", + LLMObservabilityApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "LLMObsSearchSpansRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async simpleSearchLLMObsExperimentation( body: LLMObsExperimentationSimpleSearchRequest, _options?: Configuration, @@ -3178,6 +3437,87 @@ export class LLMObservabilityApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteLLMObsData + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteLLMObsData( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 202) { + const body: LLMObsDataDeletionResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "LLMObsDataDeletionResponse", + ) as LLMObsDataDeletionResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: JSONAPIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "JSONAPIErrorResponse", + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: LLMObsDataDeletionResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "LLMObsDataDeletionResponse", + "", + ) as LLMObsDataDeletionResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -4192,6 +4532,87 @@ export class LLMObservabilityApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listLLMObsSpans + * @throws ApiException if the response code was not in [200, 299] + */ + public async listLLMObsSpans( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: LLMObsSpansResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "LLMObsSpansResponse", + ) as LLMObsSpansResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: JSONAPIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "JSONAPIErrorResponse", + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: LLMObsSpansResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "LLMObsSpansResponse", + "", + ) as LLMObsSpansResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -4274,6 +4695,87 @@ export class LLMObservabilityApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to searchLLMObsSpans + * @throws ApiException if the response code was not in [200, 299] + */ + public async searchLLMObsSpans( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: LLMObsSpansResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "LLMObsSpansResponse", + ) as LLMObsSpansResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: JSONAPIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "JSONAPIErrorResponse", + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: LLMObsSpansResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "LLMObsSpansResponse", + "", + ) as LLMObsSpansResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -5040,6 +5542,14 @@ export interface LLMObservabilityApiDeleteLLMObsCustomEvalConfigRequest { evalName: string; } +export interface LLMObservabilityApiDeleteLLMObsDataRequest { + /** + * Data deletion request payload. + * @type LLMObsDataDeletionRequest + */ + body: LLMObsDataDeletionRequest; +} + export interface LLMObservabilityApiDeleteLLMObsDatasetRecordsRequest { /** * The ID of the LLM Observability project. @@ -5249,6 +5759,69 @@ export interface LLMObservabilityApiListLLMObsProjectsRequest { pageLimit?: number; } +export interface LLMObservabilityApiListLLMObsSpansRequest { + /** + * Start of the time range. Accepts ISO 8601 or relative format (e.g., `now-15m`). Defaults to `now-15m`. + * @type string + */ + filterFrom?: string; + /** + * End of the time range. Accepts ISO 8601 or relative format. Defaults to `now`. + * @type string + */ + filterTo?: string; + /** + * Search query using LLM Observability query syntax. Supports attribute filters using the field:value syntax (e.g. session_id, trace_id, ml_app, meta.span.kind). When provided, structured field filters (`filter[span_id]`, `filter[trace_id]`, etc.) are ignored. + * @type string + */ + filterQuery?: string; + /** + * Filter by exact span ID. + * @type string + */ + filterSpanId?: string; + /** + * Filter by exact trace ID. + * @type string + */ + filterTraceId?: string; + /** + * Filter by span kind (e.g., llm, agent, tool, task, workflow). + * @type string + */ + filterSpanKind?: string; + /** + * Filter by span name. + * @type string + */ + filterSpanName?: string; + /** + * Filter by ML application name. + * @type string + */ + filterMlApp?: string; + /** + * Maximum number of spans to return. Defaults to `10`. + * @type number + */ + pageLimit?: number; + /** + * Cursor from the previous response to retrieve the next page. + * @type string + */ + pageCursor?: string; + /** + * Sort order for the results. + * @type string + */ + sort?: string; + /** + * Whether to include attachment data in the response. Defaults to `true`. + * @type boolean + */ + includeAttachments?: boolean; +} + export interface LLMObservabilityApiSearchLLMObsExperimentationRequest { /** * Experimentation search payload. @@ -5257,6 +5830,14 @@ export interface LLMObservabilityApiSearchLLMObsExperimentationRequest { body: LLMObsExperimentationSearchRequest; } +export interface LLMObservabilityApiSearchLLMObsSpansRequest { + /** + * Search spans payload. + * @type LLMObsSearchSpansRequest + */ + body: LLMObsSearchSpansRequest; +} + export interface LLMObservabilityApiSimpleSearchLLMObsExperimentationRequest { /** * Simple search payload. @@ -5650,6 +6231,27 @@ export class LLMObservabilityApi { }); } + /** + * Submit a request to delete LLM Observability span data matching a trace ID filter within a specified time range. + * @param param The request object + */ + public deleteLLMObsData( + param: LLMObservabilityApiDeleteLLMObsDataRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.deleteLLMObsData( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteLLMObsData(responseContext); + }); + }); + } + /** * Delete one or more records from an LLM Observability dataset. * @param param The request object @@ -5966,6 +6568,38 @@ export class LLMObservabilityApi { }); } + /** + * List LLM Observability spans matching the specified filters. + * @param param The request object + */ + public listLLMObsSpans( + param: LLMObservabilityApiListLLMObsSpansRequest = {}, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.listLLMObsSpans( + param.filterFrom, + param.filterTo, + param.filterQuery, + param.filterSpanId, + param.filterTraceId, + param.filterSpanKind, + param.filterSpanName, + param.filterMlApp, + param.pageLimit, + param.pageCursor, + param.sort, + param.includeAttachments, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listLLMObsSpans(responseContext); + }); + }); + } + /** * Search across LLM Observability experimentation entities — projects, datasets, dataset records, experiments, and experiment runs — using cursor-based pagination. * @@ -5991,6 +6625,27 @@ export class LLMObservabilityApi { }); } + /** + * Search LLM Observability spans using structured filters in the request body. + * @param param The request object + */ + public searchLLMObsSpans( + param: LLMObservabilityApiSearchLLMObsSpansRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.searchLLMObsSpans( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.searchLLMObsSpans(responseContext); + }); + }); + } + /** * Search across LLM Observability experimentation entities using offset-based (page-number) pagination. * Use this endpoint when you need total page count or want to navigate to a specific page number. diff --git a/services/llm_observability/src/v2/index.ts b/services/llm_observability/src/v2/index.ts index 0dbfed1bba59..7c44ed647d16 100644 --- a/services/llm_observability/src/v2/index.ts +++ b/services/llm_observability/src/v2/index.ts @@ -10,6 +10,7 @@ export { LLMObservabilityApiDeleteLLMObsAnnotationQueueRequest, LLMObservabilityApiDeleteLLMObsAnnotationQueueInteractionsRequest, LLMObservabilityApiDeleteLLMObsCustomEvalConfigRequest, + LLMObservabilityApiDeleteLLMObsDataRequest, LLMObservabilityApiDeleteLLMObsDatasetRecordsRequest, LLMObservabilityApiDeleteLLMObsDatasetsRequest, LLMObservabilityApiDeleteLLMObsExperimentsRequest, @@ -23,7 +24,9 @@ export { LLMObservabilityApiListLLMObsExperimentEventsRequest, LLMObservabilityApiListLLMObsExperimentsRequest, LLMObservabilityApiListLLMObsProjectsRequest, + LLMObservabilityApiListLLMObsSpansRequest, LLMObservabilityApiSearchLLMObsExperimentationRequest, + LLMObservabilityApiSearchLLMObsSpansRequest, LLMObservabilityApiSimpleSearchLLMObsExperimentationRequest, LLMObservabilityApiUpdateLLMObsAnnotationQueueRequest, LLMObservabilityApiUpdateLLMObsAnnotationQueueLabelSchemaRequest, @@ -103,6 +106,14 @@ export { LLMObsCustomEvalConfigUpdateData } from "./models/LLMObsCustomEvalConfi export { LLMObsCustomEvalConfigUpdateRequest } from "./models/LLMObsCustomEvalConfigUpdateRequest"; export { LLMObsCustomEvalConfigUser } from "./models/LLMObsCustomEvalConfigUser"; export { LLMObsCustomEvalConfigVertexAIOptions } from "./models/LLMObsCustomEvalConfigVertexAIOptions"; +export { LLMObsDataDeletionRequest } from "./models/LLMObsDataDeletionRequest"; +export { LLMObsDataDeletionRequestAttributes } from "./models/LLMObsDataDeletionRequestAttributes"; +export { LLMObsDataDeletionRequestData } from "./models/LLMObsDataDeletionRequestData"; +export { LLMObsDataDeletionRequestType } from "./models/LLMObsDataDeletionRequestType"; +export { LLMObsDataDeletionResponse } from "./models/LLMObsDataDeletionResponse"; +export { LLMObsDataDeletionResponseAttributes } from "./models/LLMObsDataDeletionResponseAttributes"; +export { LLMObsDataDeletionResponseData } from "./models/LLMObsDataDeletionResponseData"; +export { LLMObsDataDeletionResponseType } from "./models/LLMObsDataDeletionResponseType"; export { LLMObsDatasetDataAttributesRequest } from "./models/LLMObsDatasetDataAttributesRequest"; export { LLMObsDatasetDataAttributesResponse } from "./models/LLMObsDatasetDataAttributesResponse"; export { LLMObsDatasetDataRequest } from "./models/LLMObsDatasetDataRequest"; @@ -223,6 +234,26 @@ export { LLMObsProjectUpdateDataAttributesRequest } from "./models/LLMObsProject export { LLMObsProjectUpdateDataRequest } from "./models/LLMObsProjectUpdateDataRequest"; export { LLMObsProjectUpdateRequest } from "./models/LLMObsProjectUpdateRequest"; export { LLMObsRecordType } from "./models/LLMObsRecordType"; +export { LLMObsSearchSpansRequest } from "./models/LLMObsSearchSpansRequest"; +export { LLMObsSearchSpansRequestAttributes } from "./models/LLMObsSearchSpansRequestAttributes"; +export { LLMObsSearchSpansRequestData } from "./models/LLMObsSearchSpansRequestData"; +export { LLMObsSearchSpansRequestType } from "./models/LLMObsSearchSpansRequestType"; +export { LLMObsSpanAttributes } from "./models/LLMObsSpanAttributes"; +export { LLMObsSpanData } from "./models/LLMObsSpanData"; +export { LLMObsSpanEvaluationMetric } from "./models/LLMObsSpanEvaluationMetric"; +export { LLMObsSpanFilter } from "./models/LLMObsSpanFilter"; +export { LLMObsSpanIO } from "./models/LLMObsSpanIO"; +export { LLMObsSpanMessage } from "./models/LLMObsSpanMessage"; +export { LLMObsSpanPageQuery } from "./models/LLMObsSpanPageQuery"; +export { LLMObsSpanSearchOptions } from "./models/LLMObsSpanSearchOptions"; +export { LLMObsSpansResponse } from "./models/LLMObsSpansResponse"; +export { LLMObsSpansResponseLinks } from "./models/LLMObsSpansResponseLinks"; +export { LLMObsSpansResponseMeta } from "./models/LLMObsSpansResponseMeta"; +export { LLMObsSpansResponsePage } from "./models/LLMObsSpansResponsePage"; +export { LLMObsSpanToolCall } from "./models/LLMObsSpanToolCall"; +export { LLMObsSpanToolDefinition } from "./models/LLMObsSpanToolDefinition"; +export { LLMObsSpanToolResult } from "./models/LLMObsSpanToolResult"; +export { LLMObsSpanType } from "./models/LLMObsSpanType"; export { LLMObsTraceAnnotatedInteractionItem } from "./models/LLMObsTraceAnnotatedInteractionItem"; export { LLMObsTraceInteractionItem } from "./models/LLMObsTraceInteractionItem"; export { LLMObsTraceInteractionResponseItem } from "./models/LLMObsTraceInteractionResponseItem"; diff --git a/services/llm_observability/src/v2/models/LLMObsDataDeletionRequest.ts b/services/llm_observability/src/v2/models/LLMObsDataDeletionRequest.ts new file mode 100644 index 000000000000..92c04094c0b3 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsDataDeletionRequest.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LLMObsDataDeletionRequestData } from "./LLMObsDataDeletionRequestData"; + +/** + * Request to delete LLM Observability data. + */ +export class LLMObsDataDeletionRequest { + /** + * Data object for an LLM Observability data deletion request. + */ + "data": LLMObsDataDeletionRequestData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "LLMObsDataDeletionRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsDataDeletionRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsDataDeletionRequestAttributes.ts b/services/llm_observability/src/v2/models/LLMObsDataDeletionRequestAttributes.ts new file mode 100644 index 000000000000..cf31a32a966c --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsDataDeletionRequestAttributes.ts @@ -0,0 +1,74 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Attributes for an LLM Observability data deletion request. + */ +export class LLMObsDataDeletionRequestAttributes { + /** + * Optional delay in seconds before the deletion is executed. + */ + "delay"?: number; + /** + * Start of the deletion time range in milliseconds since Unix epoch. + */ + "from": number; + /** + * Query filters selecting the data to delete. Must include a `query` key with an `@trace_id` filter. + */ + "query": { [key: string]: string }; + /** + * End of the deletion time range in milliseconds since Unix epoch. + */ + "to": number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + delay: { + baseName: "delay", + type: "number", + format: "int64", + }, + from: { + baseName: "from", + type: "number", + required: true, + format: "int64", + }, + query: { + baseName: "query", + type: "{ [key: string]: string; }", + required: true, + }, + to: { + baseName: "to", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsDataDeletionRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsDataDeletionRequestData.ts b/services/llm_observability/src/v2/models/LLMObsDataDeletionRequestData.ts new file mode 100644 index 000000000000..f5050276cc50 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsDataDeletionRequestData.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LLMObsDataDeletionRequestAttributes } from "./LLMObsDataDeletionRequestAttributes"; +import { LLMObsDataDeletionRequestType } from "./LLMObsDataDeletionRequestType"; + +/** + * Data object for an LLM Observability data deletion request. + */ +export class LLMObsDataDeletionRequestData { + /** + * Attributes for an LLM Observability data deletion request. + */ + "attributes": LLMObsDataDeletionRequestAttributes; + /** + * Resource type for an LLM Observability data deletion request. + */ + "type": LLMObsDataDeletionRequestType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "LLMObsDataDeletionRequestAttributes", + required: true, + }, + type: { + baseName: "type", + type: "LLMObsDataDeletionRequestType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsDataDeletionRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsDataDeletionRequestType.ts b/services/llm_observability/src/v2/models/LLMObsDataDeletionRequestType.ts new file mode 100644 index 000000000000..b3d02c57d862 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsDataDeletionRequestType.ts @@ -0,0 +1,9 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Resource type for an LLM Observability data deletion request. + */ +export type LLMObsDataDeletionRequestType = + | typeof CREATE_DELETION_REQ + | UnparsedObject; +export const CREATE_DELETION_REQ = "create_deletion_req"; diff --git a/services/llm_observability/src/v2/models/LLMObsDataDeletionResponse.ts b/services/llm_observability/src/v2/models/LLMObsDataDeletionResponse.ts new file mode 100644 index 000000000000..914c3c680250 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsDataDeletionResponse.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LLMObsDataDeletionResponseData } from "./LLMObsDataDeletionResponseData"; + +/** + * Response containing details of a submitted LLM Observability data deletion request. + */ +export class LLMObsDataDeletionResponse { + /** + * Data object for an LLM Observability data deletion response. + */ + "data": LLMObsDataDeletionResponseData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "LLMObsDataDeletionResponseData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsDataDeletionResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsDataDeletionResponseAttributes.ts b/services/llm_observability/src/v2/models/LLMObsDataDeletionResponseAttributes.ts new file mode 100644 index 000000000000..7eec9150448c --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsDataDeletionResponseAttributes.ts @@ -0,0 +1,103 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Attributes of a submitted LLM Observability data deletion request. + */ +export class LLMObsDataDeletionResponseAttributes { + /** + * Timestamp when the deletion request was created. + */ + "createdAt": Date; + /** + * UUID of the user who created the deletion request. + */ + "createdBy": string; + /** + * Start of the deletion time range in milliseconds since Unix epoch. + */ + "fromTime": number; + /** + * ID of the organization that submitted the deletion request. + */ + "orgId": number; + /** + * Product name for the deletion request. + */ + "product": string; + /** + * The query string used to select data for deletion. + */ + "query": string; + /** + * End of the deletion time range in milliseconds since Unix epoch. + */ + "toTime": number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + createdAt: { + baseName: "created_at", + type: "Date", + required: true, + format: "date-time", + }, + createdBy: { + baseName: "created_by", + type: "string", + required: true, + }, + fromTime: { + baseName: "from_time", + type: "number", + required: true, + format: "int64", + }, + orgId: { + baseName: "org_id", + type: "number", + required: true, + format: "int64", + }, + product: { + baseName: "product", + type: "string", + required: true, + }, + query: { + baseName: "query", + type: "string", + required: true, + }, + toTime: { + baseName: "to_time", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsDataDeletionResponseAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsDataDeletionResponseData.ts b/services/llm_observability/src/v2/models/LLMObsDataDeletionResponseData.ts new file mode 100644 index 000000000000..5e275665e0fd --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsDataDeletionResponseData.ts @@ -0,0 +1,66 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LLMObsDataDeletionResponseAttributes } from "./LLMObsDataDeletionResponseAttributes"; +import { LLMObsDataDeletionResponseType } from "./LLMObsDataDeletionResponseType"; + +/** + * Data object for an LLM Observability data deletion response. + */ +export class LLMObsDataDeletionResponseData { + /** + * Attributes of a submitted LLM Observability data deletion request. + */ + "attributes": LLMObsDataDeletionResponseAttributes; + /** + * Unique identifier of the deletion request. + */ + "id": string; + /** + * Resource type for an LLM Observability data deletion response. + */ + "type": LLMObsDataDeletionResponseType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "LLMObsDataDeletionResponseAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "LLMObsDataDeletionResponseType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsDataDeletionResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsDataDeletionResponseType.ts b/services/llm_observability/src/v2/models/LLMObsDataDeletionResponseType.ts new file mode 100644 index 000000000000..e8c185f3f8a1 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsDataDeletionResponseType.ts @@ -0,0 +1,9 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Resource type for an LLM Observability data deletion response. + */ +export type LLMObsDataDeletionResponseType = + | typeof DELETION_REQUEST + | UnparsedObject; +export const DELETION_REQUEST = "deletion_request"; diff --git a/services/llm_observability/src/v2/models/LLMObsSearchSpansRequest.ts b/services/llm_observability/src/v2/models/LLMObsSearchSpansRequest.ts new file mode 100644 index 000000000000..430c6f24e437 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSearchSpansRequest.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LLMObsSearchSpansRequestData } from "./LLMObsSearchSpansRequestData"; + +/** + * Request body for searching LLM Observability spans. + */ +export class LLMObsSearchSpansRequest { + /** + * Data object for an LLM Observability spans search request. + */ + "data": LLMObsSearchSpansRequestData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "LLMObsSearchSpansRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSearchSpansRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSearchSpansRequestAttributes.ts b/services/llm_observability/src/v2/models/LLMObsSearchSpansRequestAttributes.ts new file mode 100644 index 000000000000..a588447064fe --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSearchSpansRequestAttributes.ts @@ -0,0 +1,72 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LLMObsSpanFilter } from "./LLMObsSpanFilter"; +import { LLMObsSpanPageQuery } from "./LLMObsSpanPageQuery"; +import { LLMObsSpanSearchOptions } from "./LLMObsSpanSearchOptions"; + +/** + * Attributes of an LLM Observability spans search request. + */ +export class LLMObsSearchSpansRequestAttributes { + /** + * Filter criteria for an LLM Observability span search. + */ + "filter"?: LLMObsSpanFilter; + /** + * Additional options for a span search request. + */ + "options"?: LLMObsSpanSearchOptions; + /** + * Pagination settings for a span search request. + */ + "page"?: LLMObsSpanPageQuery; + /** + * Sort order for the results. Use `-` prefix for descending order. + */ + "sort"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + filter: { + baseName: "filter", + type: "LLMObsSpanFilter", + }, + options: { + baseName: "options", + type: "LLMObsSpanSearchOptions", + }, + page: { + baseName: "page", + type: "LLMObsSpanPageQuery", + }, + sort: { + baseName: "sort", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSearchSpansRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSearchSpansRequestData.ts b/services/llm_observability/src/v2/models/LLMObsSearchSpansRequestData.ts new file mode 100644 index 000000000000..89628a9dae16 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSearchSpansRequestData.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LLMObsSearchSpansRequestAttributes } from "./LLMObsSearchSpansRequestAttributes"; +import { LLMObsSearchSpansRequestType } from "./LLMObsSearchSpansRequestType"; + +/** + * Data object for an LLM Observability spans search request. + */ +export class LLMObsSearchSpansRequestData { + /** + * Attributes of an LLM Observability spans search request. + */ + "attributes": LLMObsSearchSpansRequestAttributes; + /** + * Resource type for an LLM Observability spans search request. + */ + "type": LLMObsSearchSpansRequestType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "LLMObsSearchSpansRequestAttributes", + required: true, + }, + type: { + baseName: "type", + type: "LLMObsSearchSpansRequestType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSearchSpansRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSearchSpansRequestType.ts b/services/llm_observability/src/v2/models/LLMObsSearchSpansRequestType.ts new file mode 100644 index 000000000000..88c0ea454349 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSearchSpansRequestType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Resource type for an LLM Observability spans search request. + */ +export type LLMObsSearchSpansRequestType = typeof SPANS | UnparsedObject; +export const SPANS = "spans"; diff --git a/services/llm_observability/src/v2/models/LLMObsSpanAttributes.ts b/services/llm_observability/src/v2/models/LLMObsSpanAttributes.ts new file mode 100644 index 000000000000..5fa1b4925072 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpanAttributes.ts @@ -0,0 +1,202 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LLMObsSpanEvaluationMetric } from "./LLMObsSpanEvaluationMetric"; +import { LLMObsSpanIO } from "./LLMObsSpanIO"; +import { LLMObsSpanToolDefinition } from "./LLMObsSpanToolDefinition"; + +/** + * Attributes of an LLM Observability span. + */ +export class LLMObsSpanAttributes { + /** + * Duration of the span in nanoseconds. + */ + "duration": number; + /** + * Evaluation metrics keyed by evaluator name. + */ + "evaluation"?: { [key: string]: LLMObsSpanEvaluationMetric }; + /** + * Input or output content of an LLM Observability span. + */ + "input"?: LLMObsSpanIO; + /** + * Detected intent of the span. + */ + "intent"?: string; + /** + * Arbitrary metadata associated with the span. + */ + "metadata"?: { [key: string]: any }; + /** + * Numeric metrics associated with the span (e.g., token counts). + */ + "metrics"?: { [key: string]: number }; + /** + * Name of the ML application this span belongs to. + */ + "mlApp": string; + /** + * Name of the model used in this span. + */ + "modelName"?: string; + /** + * Provider of the model used in this span. + */ + "modelProvider"?: string; + /** + * Name of the span. + */ + "name": string; + /** + * Input or output content of an LLM Observability span. + */ + "output"?: LLMObsSpanIO; + /** + * Identifier of the parent span, if any. + */ + "parentId"?: string; + /** + * Unique identifier of the span. + */ + "spanId": string; + /** + * Kind of span (e.g., llm, agent, tool, task, workflow). + */ + "spanKind": string; + /** + * Start time of the span in nanoseconds since Unix epoch. + */ + "startNs": number; + /** + * Status of the span (e.g., ok, error). + */ + "status": string; + /** + * Tags associated with the span. + */ + "tags"?: Array; + /** + * Tool definitions available to the span. + */ + "toolDefinitions"?: Array; + /** + * Trace identifier this span belongs to. + */ + "traceId": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + duration: { + baseName: "duration", + type: "number", + required: true, + format: "double", + }, + evaluation: { + baseName: "evaluation", + type: "{ [key: string]: LLMObsSpanEvaluationMetric; }", + }, + input: { + baseName: "input", + type: "LLMObsSpanIO", + }, + intent: { + baseName: "intent", + type: "string", + }, + metadata: { + baseName: "metadata", + type: "{ [key: string]: any; }", + }, + metrics: { + baseName: "metrics", + type: "{ [key: string]: number; }", + }, + mlApp: { + baseName: "ml_app", + type: "string", + required: true, + }, + modelName: { + baseName: "model_name", + type: "string", + }, + modelProvider: { + baseName: "model_provider", + type: "string", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + output: { + baseName: "output", + type: "LLMObsSpanIO", + }, + parentId: { + baseName: "parent_id", + type: "string", + }, + spanId: { + baseName: "span_id", + type: "string", + required: true, + }, + spanKind: { + baseName: "span_kind", + type: "string", + required: true, + }, + startNs: { + baseName: "start_ns", + type: "number", + required: true, + format: "int64", + }, + status: { + baseName: "status", + type: "string", + required: true, + }, + tags: { + baseName: "tags", + type: "Array", + }, + toolDefinitions: { + baseName: "tool_definitions", + type: "Array", + }, + traceId: { + baseName: "trace_id", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpanAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSpanData.ts b/services/llm_observability/src/v2/models/LLMObsSpanData.ts new file mode 100644 index 000000000000..7010cd9272d3 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpanData.ts @@ -0,0 +1,66 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LLMObsSpanAttributes } from "./LLMObsSpanAttributes"; +import { LLMObsSpanType } from "./LLMObsSpanType"; + +/** + * A single LLM Observability span. + */ +export class LLMObsSpanData { + /** + * Attributes of an LLM Observability span. + */ + "attributes": LLMObsSpanAttributes; + /** + * Unique identifier of the span. + */ + "id": string; + /** + * Resource type for an LLM Observability span. + */ + "type": LLMObsSpanType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "LLMObsSpanAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "LLMObsSpanType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpanData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSpanEvaluationMetric.ts b/services/llm_observability/src/v2/models/LLMObsSpanEvaluationMetric.ts new file mode 100644 index 000000000000..1a08a9c5114d --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpanEvaluationMetric.ts @@ -0,0 +1,84 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * An evaluation metric associated with an LLM Observability span. + */ +export class LLMObsSpanEvaluationMetric { + /** + * Assessment result (e.g., pass or fail). + */ + "assessment"?: string; + /** + * Type of the evaluation metric (e.g., score, categorical, boolean). + */ + "evalMetricType"?: string; + /** + * Human-readable reasoning for the evaluation result. + */ + "reasoning"?: string; + /** + * Status of the evaluation execution. + */ + "status"?: string; + /** + * Tags associated with the evaluation metric. + */ + "tags"?: Array; + /** + * Value of the evaluation result. + */ + "value"?: any; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + assessment: { + baseName: "assessment", + type: "string", + }, + evalMetricType: { + baseName: "eval_metric_type", + type: "string", + }, + reasoning: { + baseName: "reasoning", + type: "string", + }, + status: { + baseName: "status", + type: "string", + }, + tags: { + baseName: "tags", + type: "Array", + }, + value: { + baseName: "value", + type: "any", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpanEvaluationMetric.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSpanFilter.ts b/services/llm_observability/src/v2/models/LLMObsSpanFilter.ts new file mode 100644 index 000000000000..7028c9bd2f31 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpanFilter.ts @@ -0,0 +1,108 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Filter criteria for an LLM Observability span search. + */ +export class LLMObsSpanFilter { + /** + * Start of the time range. Accepts ISO 8601 or relative format (e.g., `now-15m`). Defaults to `now-15m`. + */ + "from"?: string; + /** + * Filter by ML application name. + */ + "mlApp"?: string; + /** + * Search query using LLM Observability query syntax. Supports attribute filters using the field:value syntax (e.g. session_id, trace_id, ml_app, meta.span.kind). When provided, structured field filters (`span_id`, `trace_id`, etc.) are ignored. + */ + "query"?: string; + /** + * Filter by exact span ID. + */ + "spanId"?: string; + /** + * Filter by span kind (e.g., llm, agent, tool, task, workflow). + */ + "spanKind"?: string; + /** + * Filter by span name. + */ + "spanName"?: string; + /** + * Filter by tag key-value pairs. + */ + "tags"?: { [key: string]: string }; + /** + * End of the time range. Accepts ISO 8601 or relative format (e.g., `now`). Defaults to `now`. + */ + "to"?: string; + /** + * Filter by exact trace ID. + */ + "traceId"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + from: { + baseName: "from", + type: "string", + }, + mlApp: { + baseName: "ml_app", + type: "string", + }, + query: { + baseName: "query", + type: "string", + }, + spanId: { + baseName: "span_id", + type: "string", + }, + spanKind: { + baseName: "span_kind", + type: "string", + }, + spanName: { + baseName: "span_name", + type: "string", + }, + tags: { + baseName: "tags", + type: "{ [key: string]: string; }", + }, + to: { + baseName: "to", + type: "string", + }, + traceId: { + baseName: "trace_id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpanFilter.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSpanIO.ts b/services/llm_observability/src/v2/models/LLMObsSpanIO.ts new file mode 100644 index 000000000000..886bb01cd591 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpanIO.ts @@ -0,0 +1,54 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LLMObsSpanMessage } from "./LLMObsSpanMessage"; + +/** + * Input or output content of an LLM Observability span. + */ +export class LLMObsSpanIO { + /** + * List of messages in the input or output. + */ + "messages"?: Array; + /** + * Plain-text value of the input or output. + */ + "value"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + messages: { + baseName: "messages", + type: "Array", + }, + value: { + baseName: "value", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpanIO.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSpanMessage.ts b/services/llm_observability/src/v2/models/LLMObsSpanMessage.ts new file mode 100644 index 000000000000..617fe45b0bc1 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpanMessage.ts @@ -0,0 +1,79 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LLMObsSpanToolCall } from "./LLMObsSpanToolCall"; +import { LLMObsSpanToolResult } from "./LLMObsSpanToolResult"; + +/** + * A single message in a span input or output. + */ +export class LLMObsSpanMessage { + /** + * Text content of the message. + */ + "content"?: string; + /** + * Unique identifier of the message. + */ + "id"?: string; + /** + * Role of the message sender (e.g., user, assistant, system). + */ + "role"?: string; + /** + * Tool calls made in this message. + */ + "toolCalls"?: Array; + /** + * Tool results returned in this message. + */ + "toolResults"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + content: { + baseName: "content", + type: "string", + }, + id: { + baseName: "id", + type: "string", + }, + role: { + baseName: "role", + type: "string", + }, + toolCalls: { + baseName: "tool_calls", + type: "Array", + }, + toolResults: { + baseName: "tool_results", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpanMessage.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSpanPageQuery.ts b/services/llm_observability/src/v2/models/LLMObsSpanPageQuery.ts new file mode 100644 index 000000000000..81c57d2d9e43 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpanPageQuery.ts @@ -0,0 +1,53 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Pagination settings for a span search request. + */ +export class LLMObsSpanPageQuery { + /** + * Cursor from the previous response to retrieve the next page. + */ + "cursor"?: string; + /** + * Maximum number of spans to return. Defaults to `10`. + */ + "limit"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + cursor: { + baseName: "cursor", + type: "string", + }, + limit: { + baseName: "limit", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpanPageQuery.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSpanSearchOptions.ts b/services/llm_observability/src/v2/models/LLMObsSpanSearchOptions.ts new file mode 100644 index 000000000000..25075a4be5e6 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpanSearchOptions.ts @@ -0,0 +1,53 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Additional options for a span search request. + */ +export class LLMObsSpanSearchOptions { + /** + * Whether to include attachment data in the response. Defaults to `true`. + */ + "includeAttachments"?: boolean; + /** + * Offset in seconds applied to both `from` and `to` timestamps. + */ + "timeOffset"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + includeAttachments: { + baseName: "include_attachments", + type: "boolean", + }, + timeOffset: { + baseName: "time_offset", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpanSearchOptions.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSpanToolCall.ts b/services/llm_observability/src/v2/models/LLMObsSpanToolCall.ts new file mode 100644 index 000000000000..62c2491c856a --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpanToolCall.ts @@ -0,0 +1,68 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * A tool call made during a span. + */ +export class LLMObsSpanToolCall { + /** + * Arguments passed to the tool. + */ + "arguments"?: { [key: string]: any }; + /** + * Name of the tool called. + */ + "name"?: string; + /** + * Identifier of the tool call. + */ + "toolId"?: string; + /** + * Type of the tool call. + */ + "type"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + arguments: { + baseName: "arguments", + type: "{ [key: string]: any; }", + }, + name: { + baseName: "name", + type: "string", + }, + toolId: { + baseName: "tool_id", + type: "string", + }, + type: { + baseName: "type", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpanToolCall.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSpanToolDefinition.ts b/services/llm_observability/src/v2/models/LLMObsSpanToolDefinition.ts new file mode 100644 index 000000000000..ce0f2a56b6bd --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpanToolDefinition.ts @@ -0,0 +1,68 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * A tool definition available to an LLM span. + */ +export class LLMObsSpanToolDefinition { + /** + * Description of what the tool does. + */ + "description"?: string; + /** + * Name of the tool. + */ + "name"?: string; + /** + * JSON schema describing the tool's input parameters. + */ + "schema"?: { [key: string]: any }; + /** + * Version of the tool definition. + */ + "version"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + description: { + baseName: "description", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + schema: { + baseName: "schema", + type: "{ [key: string]: any; }", + }, + version: { + baseName: "version", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpanToolDefinition.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSpanToolResult.ts b/services/llm_observability/src/v2/models/LLMObsSpanToolResult.ts new file mode 100644 index 000000000000..5e2a7e4c9e5d --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpanToolResult.ts @@ -0,0 +1,68 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * A result returned from a tool call during a span. + */ +export class LLMObsSpanToolResult { + /** + * Name of the tool that produced this result. + */ + "name"?: string; + /** + * Result value returned by the tool. + */ + "result"?: string; + /** + * Identifier of the corresponding tool call. + */ + "toolId"?: string; + /** + * Type of the tool result. + */ + "type"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + }, + result: { + baseName: "result", + type: "string", + }, + toolId: { + baseName: "tool_id", + type: "string", + }, + type: { + baseName: "type", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpanToolResult.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSpanType.ts b/services/llm_observability/src/v2/models/LLMObsSpanType.ts new file mode 100644 index 000000000000..4dca56e9b01b --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpanType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Resource type for an LLM Observability span. + */ +export type LLMObsSpanType = typeof SPAN | UnparsedObject; +export const SPAN = "span"; diff --git a/services/llm_observability/src/v2/models/LLMObsSpansResponse.ts b/services/llm_observability/src/v2/models/LLMObsSpansResponse.ts new file mode 100644 index 000000000000..2840645d53c1 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpansResponse.ts @@ -0,0 +1,66 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LLMObsSpanData } from "./LLMObsSpanData"; +import { LLMObsSpansResponseLinks } from "./LLMObsSpansResponseLinks"; +import { LLMObsSpansResponseMeta } from "./LLMObsSpansResponseMeta"; + +/** + * Response containing a list of LLM Observability spans. + */ +export class LLMObsSpansResponse { + /** + * List of spans matching the query. + */ + "data": Array; + /** + * Pagination links accompanying the spans response. + */ + "links"?: LLMObsSpansResponseLinks; + /** + * Metadata accompanying the spans response. + */ + "meta": LLMObsSpansResponseMeta; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + links: { + baseName: "links", + type: "LLMObsSpansResponseLinks", + }, + meta: { + baseName: "meta", + type: "LLMObsSpansResponseMeta", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpansResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSpansResponseLinks.ts b/services/llm_observability/src/v2/models/LLMObsSpansResponseLinks.ts new file mode 100644 index 000000000000..12b5b91bb041 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpansResponseLinks.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Pagination links accompanying the spans response. + */ +export class LLMObsSpansResponseLinks { + /** + * URL to retrieve the next page of results. + */ + "next"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + next: { + baseName: "next", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpansResponseLinks.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSpansResponseMeta.ts b/services/llm_observability/src/v2/models/LLMObsSpansResponseMeta.ts new file mode 100644 index 000000000000..d6ed4e49ce17 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpansResponseMeta.ts @@ -0,0 +1,75 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LLMObsSpansResponsePage } from "./LLMObsSpansResponsePage"; + +/** + * Metadata accompanying the spans response. + */ +export class LLMObsSpansResponseMeta { + /** + * Time elapsed for the query in milliseconds. + */ + "elapsed": number; + /** + * Pagination cursor for the spans response. + */ + "page": LLMObsSpansResponsePage; + /** + * Unique identifier for the request. + */ + "requestId": string; + /** + * Status of the query execution. + */ + "status": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + elapsed: { + baseName: "elapsed", + type: "number", + required: true, + format: "int64", + }, + page: { + baseName: "page", + type: "LLMObsSpansResponsePage", + required: true, + }, + requestId: { + baseName: "request_id", + type: "string", + required: true, + }, + status: { + baseName: "status", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpansResponseMeta.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/LLMObsSpansResponsePage.ts b/services/llm_observability/src/v2/models/LLMObsSpansResponsePage.ts new file mode 100644 index 000000000000..151173d78467 --- /dev/null +++ b/services/llm_observability/src/v2/models/LLMObsSpansResponsePage.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Pagination cursor for the spans response. + */ +export class LLMObsSpansResponsePage { + /** + * Cursor to retrieve the next page of results. Absent when there are no more results. + */ + "after"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + after: { + baseName: "after", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsSpansResponsePage.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/llm_observability/src/v2/models/TypingInfo.ts b/services/llm_observability/src/v2/models/TypingInfo.ts index 4e33de06e12b..27f7d6e0051c 100644 --- a/services/llm_observability/src/v2/models/TypingInfo.ts +++ b/services/llm_observability/src/v2/models/TypingInfo.ts @@ -53,6 +53,12 @@ import { LLMObsCustomEvalConfigUpdateData } from "./LLMObsCustomEvalConfigUpdate import { LLMObsCustomEvalConfigUpdateRequest } from "./LLMObsCustomEvalConfigUpdateRequest"; import { LLMObsCustomEvalConfigUser } from "./LLMObsCustomEvalConfigUser"; import { LLMObsCustomEvalConfigVertexAIOptions } from "./LLMObsCustomEvalConfigVertexAIOptions"; +import { LLMObsDataDeletionRequest } from "./LLMObsDataDeletionRequest"; +import { LLMObsDataDeletionRequestAttributes } from "./LLMObsDataDeletionRequestAttributes"; +import { LLMObsDataDeletionRequestData } from "./LLMObsDataDeletionRequestData"; +import { LLMObsDataDeletionResponse } from "./LLMObsDataDeletionResponse"; +import { LLMObsDataDeletionResponseAttributes } from "./LLMObsDataDeletionResponseAttributes"; +import { LLMObsDataDeletionResponseData } from "./LLMObsDataDeletionResponseData"; import { LLMObsDatasetDataAttributesRequest } from "./LLMObsDatasetDataAttributesRequest"; import { LLMObsDatasetDataAttributesResponse } from "./LLMObsDatasetDataAttributesResponse"; import { LLMObsDatasetDataRequest } from "./LLMObsDatasetDataRequest"; @@ -160,6 +166,24 @@ import { LLMObsProjectUpdateDataAttributesRequest } from "./LLMObsProjectUpdateD import { LLMObsProjectUpdateDataRequest } from "./LLMObsProjectUpdateDataRequest"; import { LLMObsProjectUpdateRequest } from "./LLMObsProjectUpdateRequest"; import { LLMObsProjectsResponse } from "./LLMObsProjectsResponse"; +import { LLMObsSearchSpansRequest } from "./LLMObsSearchSpansRequest"; +import { LLMObsSearchSpansRequestAttributes } from "./LLMObsSearchSpansRequestAttributes"; +import { LLMObsSearchSpansRequestData } from "./LLMObsSearchSpansRequestData"; +import { LLMObsSpanAttributes } from "./LLMObsSpanAttributes"; +import { LLMObsSpanData } from "./LLMObsSpanData"; +import { LLMObsSpanEvaluationMetric } from "./LLMObsSpanEvaluationMetric"; +import { LLMObsSpanFilter } from "./LLMObsSpanFilter"; +import { LLMObsSpanIO } from "./LLMObsSpanIO"; +import { LLMObsSpanMessage } from "./LLMObsSpanMessage"; +import { LLMObsSpanPageQuery } from "./LLMObsSpanPageQuery"; +import { LLMObsSpanSearchOptions } from "./LLMObsSpanSearchOptions"; +import { LLMObsSpanToolCall } from "./LLMObsSpanToolCall"; +import { LLMObsSpanToolDefinition } from "./LLMObsSpanToolDefinition"; +import { LLMObsSpanToolResult } from "./LLMObsSpanToolResult"; +import { LLMObsSpansResponse } from "./LLMObsSpansResponse"; +import { LLMObsSpansResponseLinks } from "./LLMObsSpansResponseLinks"; +import { LLMObsSpansResponseMeta } from "./LLMObsSpansResponseMeta"; +import { LLMObsSpansResponsePage } from "./LLMObsSpansResponsePage"; import { LLMObsTraceAnnotatedInteractionItem } from "./LLMObsTraceAnnotatedInteractionItem"; import { LLMObsTraceInteractionItem } from "./LLMObsTraceInteractionItem"; import { LLMObsTraceInteractionResponseItem } from "./LLMObsTraceInteractionResponseItem"; @@ -191,6 +215,8 @@ export const TypingInfo: ModelTypingInfo = { ], LLMObsCustomEvalConfigParsingType: ["structured_output", "json"], LLMObsCustomEvalConfigType: ["evaluator_config"], + LLMObsDataDeletionRequestType: ["create_deletion_req"], + LLMObsDataDeletionResponseType: ["deletion_request"], LLMObsDatasetType: ["datasets"], LLMObsDisplayBlockInteractionType: ["display_block"], LLMObsEventType: ["events"], @@ -204,6 +230,8 @@ export const TypingInfo: ModelTypingInfo = { LLMObsMetricScoreType: ["score", "categorical", "boolean", "json"], LLMObsProjectType: ["projects"], LLMObsRecordType: ["records"], + LLMObsSearchSpansRequestType: ["spans"], + LLMObsSpanType: ["span"], LLMObsTraceInteractionType: ["trace", "experiment_trace", "session"], }, oneOfMap: { @@ -305,6 +333,12 @@ export const TypingInfo: ModelTypingInfo = { LLMObsCustomEvalConfigUser: LLMObsCustomEvalConfigUser, LLMObsCustomEvalConfigVertexAIOptions: LLMObsCustomEvalConfigVertexAIOptions, + LLMObsDataDeletionRequest: LLMObsDataDeletionRequest, + LLMObsDataDeletionRequestAttributes: LLMObsDataDeletionRequestAttributes, + LLMObsDataDeletionRequestData: LLMObsDataDeletionRequestData, + LLMObsDataDeletionResponse: LLMObsDataDeletionResponse, + LLMObsDataDeletionResponseAttributes: LLMObsDataDeletionResponseAttributes, + LLMObsDataDeletionResponseData: LLMObsDataDeletionResponseData, LLMObsDatasetDataAttributesRequest: LLMObsDatasetDataAttributesRequest, LLMObsDatasetDataAttributesResponse: LLMObsDatasetDataAttributesResponse, LLMObsDatasetDataRequest: LLMObsDatasetDataRequest, @@ -452,6 +486,24 @@ export const TypingInfo: ModelTypingInfo = { LLMObsProjectUpdateDataRequest: LLMObsProjectUpdateDataRequest, LLMObsProjectUpdateRequest: LLMObsProjectUpdateRequest, LLMObsProjectsResponse: LLMObsProjectsResponse, + LLMObsSearchSpansRequest: LLMObsSearchSpansRequest, + LLMObsSearchSpansRequestAttributes: LLMObsSearchSpansRequestAttributes, + LLMObsSearchSpansRequestData: LLMObsSearchSpansRequestData, + LLMObsSpanAttributes: LLMObsSpanAttributes, + LLMObsSpanData: LLMObsSpanData, + LLMObsSpanEvaluationMetric: LLMObsSpanEvaluationMetric, + LLMObsSpanFilter: LLMObsSpanFilter, + LLMObsSpanIO: LLMObsSpanIO, + LLMObsSpanMessage: LLMObsSpanMessage, + LLMObsSpanPageQuery: LLMObsSpanPageQuery, + LLMObsSpanSearchOptions: LLMObsSpanSearchOptions, + LLMObsSpanToolCall: LLMObsSpanToolCall, + LLMObsSpanToolDefinition: LLMObsSpanToolDefinition, + LLMObsSpanToolResult: LLMObsSpanToolResult, + LLMObsSpansResponse: LLMObsSpansResponse, + LLMObsSpansResponseLinks: LLMObsSpansResponseLinks, + LLMObsSpansResponseMeta: LLMObsSpansResponseMeta, + LLMObsSpansResponsePage: LLMObsSpansResponsePage, LLMObsTraceAnnotatedInteractionItem: LLMObsTraceAnnotatedInteractionItem, LLMObsTraceInteractionItem: LLMObsTraceInteractionItem, LLMObsTraceInteractionResponseItem: LLMObsTraceInteractionResponseItem,