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/examples/v2/llm-observability/DeleteLLMObsData.rb b/examples/v2/llm-observability/DeleteLLMObsData.rb new file mode 100644 index 000000000000..645bbcd977bb --- /dev/null +++ b/examples/v2/llm-observability/DeleteLLMObsData.rb @@ -0,0 +1,22 @@ +# Delete LLM Observability data returns "Accepted" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_llm_obs_data".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +body = DatadogAPIClient::V2::LLMObsDataDeletionRequest.new({ + data: DatadogAPIClient::V2::LLMObsDataDeletionRequestData.new({ + attributes: DatadogAPIClient::V2::LLMObsDataDeletionRequestAttributes.new({ + delay: 0, + from: 1705314600000, + query: { + query: "@trace_id:abc123def456", + }, + to: 1705315200000, + }), + type: DatadogAPIClient::V2::LLMObsDataDeletionRequestType::CREATE_DELETION_REQ, + }), +}) +p api_instance.delete_llm_obs_data(body) diff --git a/examples/v2/llm-observability/ListLLMObsSpans.rb b/examples/v2/llm-observability/ListLLMObsSpans.rb new file mode 100644 index 000000000000..bcdeaaf4a89c --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsSpans.rb @@ -0,0 +1,8 @@ +# List LLM Observability spans returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_llm_obs_spans".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.list_llm_obs_spans() diff --git a/examples/v2/llm-observability/SearchLLMObsSpans.rb b/examples/v2/llm-observability/SearchLLMObsSpans.rb new file mode 100644 index 000000000000..194de4be8a62 --- /dev/null +++ b/examples/v2/llm-observability/SearchLLMObsSpans.rb @@ -0,0 +1,35 @@ +# Search LLM Observability spans returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.search_llm_obs_spans".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +body = DatadogAPIClient::V2::LLMObsSearchSpansRequest.new({ + data: DatadogAPIClient::V2::LLMObsSearchSpansRequestData.new({ + attributes: DatadogAPIClient::V2::LLMObsSearchSpansRequestAttributes.new({ + filter: DatadogAPIClient::V2::LLMObsSpanFilter.new({ + 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: DatadogAPIClient::V2::LLMObsSpanSearchOptions.new({ + include_attachments: true, + time_offset: 0, + }), + page: DatadogAPIClient::V2::LLMObsSpanPageQuery.new({ + cursor: "eyJzdGFydCI6MTAwfQ==", + limit: 10, + }), + sort: "-start_ns", + }), + type: DatadogAPIClient::V2::LLMObsSearchSpansRequestType::SPANS, + }), +}) +p api_instance.search_llm_obs_spans(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 9fd6af3114f8..9246b6c3a9d0 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -919,6 +919,9 @@ "eval_name" => "String", "body" => "LLMObsCustomEvalConfigUpdateRequest", }, + "v2.DeleteLLMObsData" => { + "body" => "LLMObsDataDeletionRequest", + }, "v2.ListLLMObsAnnotationQueues" => { "project_id" => "String", "queue_ids" => "Array", @@ -997,6 +1000,23 @@ "project_id" => "String", "body" => "LLMObsProjectUpdateRequest", }, + "v2.ListLLMObsSpans" => { + "filter_from" => "String", + "filter_to" => "String", + "filter_query" => "String", + "filter_span_id" => "String", + "filter_trace_id" => "String", + "filter_span_kind" => "String", + "filter_span_name" => "String", + "filter_ml_app" => "String", + "page_limit" => "Integer", + "page_cursor" => "String", + "sort" => "String", + "include_attachments" => "Boolean", + }, + "v2.SearchLLMObsSpans" => { + "body" => "LLMObsSearchSpansRequest", + }, "v2.ListLLMObsDatasets" => { "project_id" => "String", "filter_name" => "String", 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/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 63b14378c2a0..0cac7943cea0 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -218,6 +218,7 @@ def initialize "v2.delete_llm_obs_annotation_queue": false, "v2.delete_llm_obs_annotation_queue_interactions": false, "v2.delete_llm_obs_custom_eval_config": false, + "v2.delete_llm_obs_data": false, "v2.delete_llm_obs_dataset_records": false, "v2.delete_llm_obs_datasets": false, "v2.delete_llm_obs_experiments": false, @@ -231,7 +232,9 @@ def initialize "v2.list_llm_obs_experiment_events": false, "v2.list_llm_obs_experiments": false, "v2.list_llm_obs_projects": false, + "v2.list_llm_obs_spans": false, "v2.search_llm_obs_experimentation": false, + "v2.search_llm_obs_spans": false, "v2.simple_search_llm_obs_experimentation": false, "v2.update_llm_obs_annotation_queue": false, "v2.update_llm_obs_annotation_queue_label_schema": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index c68c30af571a..a9b20652de22 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3748,6 +3748,14 @@ def overrides "v2.llm_obs_custom_eval_config_update_request" => "LLMObsCustomEvalConfigUpdateRequest", "v2.llm_obs_custom_eval_config_user" => "LLMObsCustomEvalConfigUser", "v2.llm_obs_custom_eval_config_vertex_ai_options" => "LLMObsCustomEvalConfigVertexAIOptions", + "v2.llm_obs_data_deletion_request" => "LLMObsDataDeletionRequest", + "v2.llm_obs_data_deletion_request_attributes" => "LLMObsDataDeletionRequestAttributes", + "v2.llm_obs_data_deletion_request_data" => "LLMObsDataDeletionRequestData", + "v2.llm_obs_data_deletion_request_type" => "LLMObsDataDeletionRequestType", + "v2.llm_obs_data_deletion_response" => "LLMObsDataDeletionResponse", + "v2.llm_obs_data_deletion_response_attributes" => "LLMObsDataDeletionResponseAttributes", + "v2.llm_obs_data_deletion_response_data" => "LLMObsDataDeletionResponseData", + "v2.llm_obs_data_deletion_response_type" => "LLMObsDataDeletionResponseType", "v2.llm_obs_dataset_data_attributes_request" => "LLMObsDatasetDataAttributesRequest", "v2.llm_obs_dataset_data_attributes_response" => "LLMObsDatasetDataAttributesResponse", "v2.llm_obs_dataset_data_request" => "LLMObsDatasetDataRequest", @@ -3868,6 +3876,26 @@ def overrides "v2.llm_obs_project_update_data_request" => "LLMObsProjectUpdateDataRequest", "v2.llm_obs_project_update_request" => "LLMObsProjectUpdateRequest", "v2.llm_obs_record_type" => "LLMObsRecordType", + "v2.llm_obs_search_spans_request" => "LLMObsSearchSpansRequest", + "v2.llm_obs_search_spans_request_attributes" => "LLMObsSearchSpansRequestAttributes", + "v2.llm_obs_search_spans_request_data" => "LLMObsSearchSpansRequestData", + "v2.llm_obs_search_spans_request_type" => "LLMObsSearchSpansRequestType", + "v2.llm_obs_span_attributes" => "LLMObsSpanAttributes", + "v2.llm_obs_span_data" => "LLMObsSpanData", + "v2.llm_obs_span_evaluation_metric" => "LLMObsSpanEvaluationMetric", + "v2.llm_obs_span_filter" => "LLMObsSpanFilter", + "v2.llm_obs_span_io" => "LLMObsSpanIO", + "v2.llm_obs_span_message" => "LLMObsSpanMessage", + "v2.llm_obs_span_page_query" => "LLMObsSpanPageQuery", + "v2.llm_obs_span_search_options" => "LLMObsSpanSearchOptions", + "v2.llm_obs_spans_response" => "LLMObsSpansResponse", + "v2.llm_obs_spans_response_links" => "LLMObsSpansResponseLinks", + "v2.llm_obs_spans_response_meta" => "LLMObsSpansResponseMeta", + "v2.llm_obs_spans_response_page" => "LLMObsSpansResponsePage", + "v2.llm_obs_span_tool_call" => "LLMObsSpanToolCall", + "v2.llm_obs_span_tool_definition" => "LLMObsSpanToolDefinition", + "v2.llm_obs_span_tool_result" => "LLMObsSpanToolResult", + "v2.llm_obs_span_type" => "LLMObsSpanType", "v2.llm_obs_trace_annotated_interaction_item" => "LLMObsTraceAnnotatedInteractionItem", "v2.llm_obs_trace_interaction_item" => "LLMObsTraceInteractionItem", "v2.llm_obs_trace_interaction_response_item" => "LLMObsTraceInteractionResponseItem", diff --git a/lib/datadog_api_client/v2/api/llm_observability_api.rb b/lib/datadog_api_client/v2/api/llm_observability_api.rb index e3a6d14ebece..7eb5a93af50e 100644 --- a/lib/datadog_api_client/v2/api/llm_observability_api.rb +++ b/lib/datadog_api_client/v2/api/llm_observability_api.rb @@ -867,6 +867,79 @@ def delete_llm_obs_custom_eval_config_with_http_info(eval_name, opts = {}) return data, status_code, headers end + # Delete LLM Observability data. + # + # @see #delete_llm_obs_data_with_http_info + def delete_llm_obs_data(body, opts = {}) + data, _status_code, _headers = delete_llm_obs_data_with_http_info(body, opts) + data + end + + # Delete LLM Observability data. + # + # Submit a request to delete LLM Observability span data matching a trace ID filter within a specified time range. + # + # @param body [LLMObsDataDeletionRequest] Data deletion request payload. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsDataDeletionResponse, Integer, Hash)>] LLMObsDataDeletionResponse data, response status code and response headers + def delete_llm_obs_data_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_llm_obs_data".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_llm_obs_data") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_llm_obs_data")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.delete_llm_obs_data ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LLMObservabilityAPI.delete_llm_obs_data" + end + # resource path + local_var_path = '/api/v2/llm-obs/deletion/data/llmobs' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsDataDeletionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_llm_obs_data, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#delete_llm_obs_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete LLM Observability dataset records. # # @see #delete_llm_obs_dataset_records_with_http_info @@ -1845,6 +1918,96 @@ def list_llm_obs_projects_with_http_info(opts = {}) return data, status_code, headers end + # List LLM Observability spans. + # + # @see #list_llm_obs_spans_with_http_info + def list_llm_obs_spans(opts = {}) + data, _status_code, _headers = list_llm_obs_spans_with_http_info(opts) + data + end + + # List LLM Observability spans. + # + # List LLM Observability spans matching the specified filters. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_from Start of the time range. Accepts ISO 8601 or relative format (e.g., `now-15m`). Defaults to `now-15m`. + # @option opts [String] :filter_to End of the time range. Accepts ISO 8601 or relative format. Defaults to `now`. + # @option opts [String] :filter_query 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. + # @option opts [String] :filter_span_id Filter by exact span ID. + # @option opts [String] :filter_trace_id Filter by exact trace ID. + # @option opts [String] :filter_span_kind Filter by span kind (e.g., llm, agent, tool, task, workflow). + # @option opts [String] :filter_span_name Filter by span name. + # @option opts [String] :filter_ml_app Filter by ML application name. + # @option opts [Integer] :page_limit Maximum number of spans to return. Defaults to `10`. + # @option opts [String] :page_cursor Cursor from the previous response to retrieve the next page. + # @option opts [String] :sort Sort order for the results. + # @option opts [Boolean] :include_attachments Whether to include attachment data in the response. Defaults to `true`. + # @return [Array<(LLMObsSpansResponse, Integer, Hash)>] LLMObsSpansResponse data, response status code and response headers + def list_llm_obs_spans_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_llm_obs_spans".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_llm_obs_spans") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_llm_obs_spans")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.list_llm_obs_spans ...' + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/spans/events' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[from]'] = opts[:'filter_from'] if !opts[:'filter_from'].nil? + query_params[:'filter[to]'] = opts[:'filter_to'] if !opts[:'filter_to'].nil? + query_params[:'filter[query]'] = opts[:'filter_query'] if !opts[:'filter_query'].nil? + query_params[:'filter[span_id]'] = opts[:'filter_span_id'] if !opts[:'filter_span_id'].nil? + query_params[:'filter[trace_id]'] = opts[:'filter_trace_id'] if !opts[:'filter_trace_id'].nil? + query_params[:'filter[span_kind]'] = opts[:'filter_span_kind'] if !opts[:'filter_span_kind'].nil? + query_params[:'filter[span_name]'] = opts[:'filter_span_name'] if !opts[:'filter_span_name'].nil? + query_params[:'filter[ml_app]'] = opts[:'filter_ml_app'] if !opts[:'filter_ml_app'].nil? + query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'include_attachments'] = opts[:'include_attachments'] if !opts[:'include_attachments'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsSpansResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_llm_obs_spans, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#list_llm_obs_spans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Search LLM Observability experimentation entities. # # @see #search_llm_obs_experimentation_with_http_info @@ -1922,6 +2085,79 @@ def search_llm_obs_experimentation_with_http_info(body, opts = {}) return data, status_code, headers end + # Search LLM Observability spans. + # + # @see #search_llm_obs_spans_with_http_info + def search_llm_obs_spans(body, opts = {}) + data, _status_code, _headers = search_llm_obs_spans_with_http_info(body, opts) + data + end + + # Search LLM Observability spans. + # + # Search LLM Observability spans using structured filters in the request body. + # + # @param body [LLMObsSearchSpansRequest] Search spans payload. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsSpansResponse, Integer, Hash)>] LLMObsSpansResponse data, response status code and response headers + def search_llm_obs_spans_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.search_llm_obs_spans".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.search_llm_obs_spans") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.search_llm_obs_spans")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.search_llm_obs_spans ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LLMObservabilityAPI.search_llm_obs_spans" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/spans/events/search' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsSpansResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :search_llm_obs_spans, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#search_llm_obs_spans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Simple search experimentation entities. # # @see #simple_search_llm_obs_experimentation_with_http_info diff --git a/lib/datadog_api_client/v2/models/llm_obs_data_deletion_request.rb b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_request.rb new file mode 100644 index 000000000000..f9fee0ad157f --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to delete LLM Observability data. + class LLMObsDataDeletionRequest + include BaseGenericModel + + # Data object for an LLM Observability data deletion request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'LLMObsDataDeletionRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDataDeletionRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_data_deletion_request_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_request_attributes.rb new file mode 100644 index 000000000000..55b1eb96cb08 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_request_attributes.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for an LLM Observability data deletion request. + class LLMObsDataDeletionRequestAttributes + include BaseGenericModel + + # Optional delay in seconds before the deletion is executed. + attr_accessor :delay + + # Start of the deletion time range in milliseconds since Unix epoch. + attr_reader :from + + # Query filters selecting the data to delete. Must include a `query` key with an `@trace_id` filter. + attr_reader :query + + # End of the deletion time range in milliseconds since Unix epoch. + attr_reader :to + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'delay' => :'delay', + :'from' => :'from', + :'query' => :'query', + :'to' => :'to' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'delay' => :'Integer', + :'from' => :'Integer', + :'query' => :'Hash', + :'to' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDataDeletionRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'delay') + self.delay = attributes[:'delay'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @from.nil? + return false if @query.nil? + return false if @to.nil? + true + end + + # Custom attribute writer method with validation + # @param from [Object] Object to be assigned + # @!visibility private + def from=(from) + if from.nil? + fail ArgumentError, 'invalid value for "from", from cannot be nil.' + end + @from = from + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Custom attribute writer method with validation + # @param to [Object] Object to be assigned + # @!visibility private + def to=(to) + if to.nil? + fail ArgumentError, 'invalid value for "to", to cannot be nil.' + end + @to = to + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + delay == o.delay && + from == o.from && + query == o.query && + to == o.to && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [delay, from, query, to, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_data_deletion_request_data.rb b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_request_data.rb new file mode 100644 index 000000000000..b781c05d60d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for an LLM Observability data deletion request. + class LLMObsDataDeletionRequestData + include BaseGenericModel + + # Attributes for an LLM Observability data deletion request. + attr_reader :attributes + + # Resource type for an LLM Observability data deletion request. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'LLMObsDataDeletionRequestAttributes', + :'type' => :'LLMObsDataDeletionRequestType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDataDeletionRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_data_deletion_request_type.rb b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_request_type.rb new file mode 100644 index 000000000000..c3ef1a38c138 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_request_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resource type for an LLM Observability data deletion request. + class LLMObsDataDeletionRequestType + include BaseEnumModel + + CREATE_DELETION_REQ = "create_deletion_req".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_data_deletion_response.rb b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_response.rb new file mode 100644 index 000000000000..102187ca4fd1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing details of a submitted LLM Observability data deletion request. + class LLMObsDataDeletionResponse + include BaseGenericModel + + # Data object for an LLM Observability data deletion response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'LLMObsDataDeletionResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDataDeletionResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_data_deletion_response_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_response_attributes.rb new file mode 100644 index 000000000000..234192d78116 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_response_attributes.rb @@ -0,0 +1,249 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a submitted LLM Observability data deletion request. + class LLMObsDataDeletionResponseAttributes + include BaseGenericModel + + # Timestamp when the deletion request was created. + attr_reader :created_at + + # UUID of the user who created the deletion request. + attr_reader :created_by + + # Start of the deletion time range in milliseconds since Unix epoch. + attr_reader :from_time + + # ID of the organization that submitted the deletion request. + attr_reader :org_id + + # Product name for the deletion request. + attr_reader :product + + # The query string used to select data for deletion. + attr_reader :query + + # End of the deletion time range in milliseconds since Unix epoch. + attr_reader :to_time + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'from_time' => :'from_time', + :'org_id' => :'org_id', + :'product' => :'product', + :'query' => :'query', + :'to_time' => :'to_time' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'created_by' => :'String', + :'from_time' => :'Integer', + :'org_id' => :'Integer', + :'product' => :'String', + :'query' => :'String', + :'to_time' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDataDeletionResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'from_time') + self.from_time = attributes[:'from_time'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'product') + self.product = attributes[:'product'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'to_time') + self.to_time = attributes[:'to_time'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @created_by.nil? + return false if @from_time.nil? + return false if @org_id.nil? + return false if @product.nil? + return false if @query.nil? + return false if @to_time.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Custom attribute writer method with validation + # @param from_time [Object] Object to be assigned + # @!visibility private + def from_time=(from_time) + if from_time.nil? + fail ArgumentError, 'invalid value for "from_time", from_time cannot be nil.' + end + @from_time = from_time + end + + # Custom attribute writer method with validation + # @param org_id [Object] Object to be assigned + # @!visibility private + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.' + end + @org_id = org_id + end + + # Custom attribute writer method with validation + # @param product [Object] Object to be assigned + # @!visibility private + def product=(product) + if product.nil? + fail ArgumentError, 'invalid value for "product", product cannot be nil.' + end + @product = product + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Custom attribute writer method with validation + # @param to_time [Object] Object to be assigned + # @!visibility private + def to_time=(to_time) + if to_time.nil? + fail ArgumentError, 'invalid value for "to_time", to_time cannot be nil.' + end + @to_time = to_time + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + created_by == o.created_by && + from_time == o.from_time && + org_id == o.org_id && + product == o.product && + query == o.query && + to_time == o.to_time && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, created_by, from_time, org_id, product, query, to_time, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_data_deletion_response_data.rb b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_response_data.rb new file mode 100644 index 000000000000..4b35ec061395 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for an LLM Observability data deletion response. + class LLMObsDataDeletionResponseData + include BaseGenericModel + + # Attributes of a submitted LLM Observability data deletion request. + attr_reader :attributes + + # Unique identifier of the deletion request. + attr_reader :id + + # Resource type for an LLM Observability data deletion response. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'LLMObsDataDeletionResponseAttributes', + :'id' => :'String', + :'type' => :'LLMObsDataDeletionResponseType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDataDeletionResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_data_deletion_response_type.rb b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_response_type.rb new file mode 100644 index 000000000000..93d4218715db --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_data_deletion_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resource type for an LLM Observability data deletion response. + class LLMObsDataDeletionResponseType + include BaseEnumModel + + DELETION_REQUEST = "deletion_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_search_spans_request.rb b/lib/datadog_api_client/v2/models/llm_obs_search_spans_request.rb new file mode 100644 index 000000000000..283b09dfd80a --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_search_spans_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for searching LLM Observability spans. + class LLMObsSearchSpansRequest + include BaseGenericModel + + # Data object for an LLM Observability spans search request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'LLMObsSearchSpansRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSearchSpansRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_search_spans_request_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_search_spans_request_attributes.rb new file mode 100644 index 000000000000..54226a4403fc --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_search_spans_request_attributes.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an LLM Observability spans search request. + class LLMObsSearchSpansRequestAttributes + include BaseGenericModel + + # Filter criteria for an LLM Observability span search. + attr_accessor :filter + + # Additional options for a span search request. + attr_accessor :options + + # Pagination settings for a span search request. + attr_accessor :page + + # Sort order for the results. Use `-` prefix for descending order. + attr_accessor :sort + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'filter' => :'filter', + :'options' => :'options', + :'page' => :'page', + :'sort' => :'sort' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'filter' => :'LLMObsSpanFilter', + :'options' => :'LLMObsSpanSearchOptions', + :'page' => :'LLMObsSpanPageQuery', + :'sort' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSearchSpansRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'filter') + self.filter = attributes[:'filter'] + end + + if attributes.key?(:'options') + self.options = attributes[:'options'] + end + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + + if attributes.key?(:'sort') + self.sort = attributes[:'sort'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + filter == o.filter && + options == o.options && + page == o.page && + sort == o.sort && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [filter, options, page, sort, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_search_spans_request_data.rb b/lib/datadog_api_client/v2/models/llm_obs_search_spans_request_data.rb new file mode 100644 index 000000000000..807364066f37 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_search_spans_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for an LLM Observability spans search request. + class LLMObsSearchSpansRequestData + include BaseGenericModel + + # Attributes of an LLM Observability spans search request. + attr_reader :attributes + + # Resource type for an LLM Observability spans search request. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'LLMObsSearchSpansRequestAttributes', + :'type' => :'LLMObsSearchSpansRequestType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSearchSpansRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_search_spans_request_type.rb b/lib/datadog_api_client/v2/models/llm_obs_search_spans_request_type.rb new file mode 100644 index 000000000000..123032909ba2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_search_spans_request_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resource type for an LLM Observability spans search request. + class LLMObsSearchSpansRequestType + include BaseEnumModel + + SPANS = "spans".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_span_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_span_attributes.rb new file mode 100644 index 000000000000..46de8149c121 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_span_attributes.rb @@ -0,0 +1,384 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an LLM Observability span. + class LLMObsSpanAttributes + include BaseGenericModel + + # Duration of the span in nanoseconds. + attr_reader :duration + + # Evaluation metrics keyed by evaluator name. + attr_accessor :evaluation + + # Input or output content of an LLM Observability span. + attr_accessor :input + + # Detected intent of the span. + attr_accessor :intent + + # Arbitrary metadata associated with the span. + attr_accessor :metadata + + # Numeric metrics associated with the span (e.g., token counts). + attr_accessor :metrics + + # Name of the ML application this span belongs to. + attr_reader :ml_app + + # Name of the model used in this span. + attr_accessor :model_name + + # Provider of the model used in this span. + attr_accessor :model_provider + + # Name of the span. + attr_reader :name + + # Input or output content of an LLM Observability span. + attr_accessor :output + + # Identifier of the parent span, if any. + attr_accessor :parent_id + + # Unique identifier of the span. + attr_reader :span_id + + # Kind of span (e.g., llm, agent, tool, task, workflow). + attr_reader :span_kind + + # Start time of the span in nanoseconds since Unix epoch. + attr_reader :start_ns + + # Status of the span (e.g., ok, error). + attr_reader :status + + # Tags associated with the span. + attr_accessor :tags + + # Tool definitions available to the span. + attr_accessor :tool_definitions + + # Trace identifier this span belongs to. + attr_reader :trace_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'duration' => :'duration', + :'evaluation' => :'evaluation', + :'input' => :'input', + :'intent' => :'intent', + :'metadata' => :'metadata', + :'metrics' => :'metrics', + :'ml_app' => :'ml_app', + :'model_name' => :'model_name', + :'model_provider' => :'model_provider', + :'name' => :'name', + :'output' => :'output', + :'parent_id' => :'parent_id', + :'span_id' => :'span_id', + :'span_kind' => :'span_kind', + :'start_ns' => :'start_ns', + :'status' => :'status', + :'tags' => :'tags', + :'tool_definitions' => :'tool_definitions', + :'trace_id' => :'trace_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'duration' => :'Float', + :'evaluation' => :'Hash', + :'input' => :'LLMObsSpanIO', + :'intent' => :'String', + :'metadata' => :'Hash', + :'metrics' => :'Hash', + :'ml_app' => :'String', + :'model_name' => :'String', + :'model_provider' => :'String', + :'name' => :'String', + :'output' => :'LLMObsSpanIO', + :'parent_id' => :'String', + :'span_id' => :'String', + :'span_kind' => :'String', + :'start_ns' => :'Integer', + :'status' => :'String', + :'tags' => :'Array', + :'tool_definitions' => :'Array', + :'trace_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpanAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'duration') + self.duration = attributes[:'duration'] + end + + if attributes.key?(:'evaluation') + self.evaluation = attributes[:'evaluation'] + end + + if attributes.key?(:'input') + self.input = attributes[:'input'] + end + + if attributes.key?(:'intent') + self.intent = attributes[:'intent'] + end + + if attributes.key?(:'metadata') + self.metadata = attributes[:'metadata'] + end + + if attributes.key?(:'metrics') + self.metrics = attributes[:'metrics'] + end + + if attributes.key?(:'ml_app') + self.ml_app = attributes[:'ml_app'] + end + + if attributes.key?(:'model_name') + self.model_name = attributes[:'model_name'] + end + + if attributes.key?(:'model_provider') + self.model_provider = attributes[:'model_provider'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'output') + self.output = attributes[:'output'] + end + + if attributes.key?(:'parent_id') + self.parent_id = attributes[:'parent_id'] + end + + if attributes.key?(:'span_id') + self.span_id = attributes[:'span_id'] + end + + if attributes.key?(:'span_kind') + self.span_kind = attributes[:'span_kind'] + end + + if attributes.key?(:'start_ns') + self.start_ns = attributes[:'start_ns'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'tool_definitions') + if (value = attributes[:'tool_definitions']).is_a?(Array) + self.tool_definitions = value + end + end + + if attributes.key?(:'trace_id') + self.trace_id = attributes[:'trace_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @duration.nil? + return false if @ml_app.nil? + return false if @name.nil? + return false if @span_id.nil? + return false if @span_kind.nil? + return false if @start_ns.nil? + return false if @status.nil? + return false if @trace_id.nil? + true + end + + # Custom attribute writer method with validation + # @param duration [Object] Object to be assigned + # @!visibility private + def duration=(duration) + if duration.nil? + fail ArgumentError, 'invalid value for "duration", duration cannot be nil.' + end + @duration = duration + end + + # Custom attribute writer method with validation + # @param ml_app [Object] Object to be assigned + # @!visibility private + def ml_app=(ml_app) + if ml_app.nil? + fail ArgumentError, 'invalid value for "ml_app", ml_app cannot be nil.' + end + @ml_app = ml_app + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param span_id [Object] Object to be assigned + # @!visibility private + def span_id=(span_id) + if span_id.nil? + fail ArgumentError, 'invalid value for "span_id", span_id cannot be nil.' + end + @span_id = span_id + end + + # Custom attribute writer method with validation + # @param span_kind [Object] Object to be assigned + # @!visibility private + def span_kind=(span_kind) + if span_kind.nil? + fail ArgumentError, 'invalid value for "span_kind", span_kind cannot be nil.' + end + @span_kind = span_kind + end + + # Custom attribute writer method with validation + # @param start_ns [Object] Object to be assigned + # @!visibility private + def start_ns=(start_ns) + if start_ns.nil? + fail ArgumentError, 'invalid value for "start_ns", start_ns cannot be nil.' + end + @start_ns = start_ns + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param trace_id [Object] Object to be assigned + # @!visibility private + def trace_id=(trace_id) + if trace_id.nil? + fail ArgumentError, 'invalid value for "trace_id", trace_id cannot be nil.' + end + @trace_id = trace_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + duration == o.duration && + evaluation == o.evaluation && + input == o.input && + intent == o.intent && + metadata == o.metadata && + metrics == o.metrics && + ml_app == o.ml_app && + model_name == o.model_name && + model_provider == o.model_provider && + name == o.name && + output == o.output && + parent_id == o.parent_id && + span_id == o.span_id && + span_kind == o.span_kind && + start_ns == o.start_ns && + status == o.status && + tags == o.tags && + tool_definitions == o.tool_definitions && + trace_id == o.trace_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [duration, evaluation, input, intent, metadata, metrics, ml_app, model_name, model_provider, name, output, parent_id, span_id, span_kind, start_ns, status, tags, tool_definitions, trace_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_span_data.rb b/lib/datadog_api_client/v2/models/llm_obs_span_data.rb new file mode 100644 index 000000000000..3aef607667f8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_span_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single LLM Observability span. + class LLMObsSpanData + include BaseGenericModel + + # Attributes of an LLM Observability span. + attr_reader :attributes + + # Unique identifier of the span. + attr_reader :id + + # Resource type for an LLM Observability span. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'LLMObsSpanAttributes', + :'id' => :'String', + :'type' => :'LLMObsSpanType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpanData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_span_evaluation_metric.rb b/lib/datadog_api_client/v2/models/llm_obs_span_evaluation_metric.rb new file mode 100644 index 000000000000..2ffbd3a058d0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_span_evaluation_metric.rb @@ -0,0 +1,157 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An evaluation metric associated with an LLM Observability span. + class LLMObsSpanEvaluationMetric + include BaseGenericModel + + # Assessment result (e.g., pass or fail). + attr_accessor :assessment + + # Type of the evaluation metric (e.g., score, categorical, boolean). + attr_accessor :eval_metric_type + + # Human-readable reasoning for the evaluation result. + attr_accessor :reasoning + + # Status of the evaluation execution. + attr_accessor :status + + # Tags associated with the evaluation metric. + attr_accessor :tags + + # Value of the evaluation result. + attr_accessor :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assessment' => :'assessment', + :'eval_metric_type' => :'eval_metric_type', + :'reasoning' => :'reasoning', + :'status' => :'status', + :'tags' => :'tags', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assessment' => :'String', + :'eval_metric_type' => :'String', + :'reasoning' => :'String', + :'status' => :'String', + :'tags' => :'Array', + :'value' => :'Object' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpanEvaluationMetric` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'assessment') + self.assessment = attributes[:'assessment'] + end + + if attributes.key?(:'eval_metric_type') + self.eval_metric_type = attributes[:'eval_metric_type'] + end + + if attributes.key?(:'reasoning') + self.reasoning = attributes[:'reasoning'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assessment == o.assessment && + eval_metric_type == o.eval_metric_type && + reasoning == o.reasoning && + status == o.status && + tags == o.tags && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assessment, eval_metric_type, reasoning, status, tags, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_span_filter.rb b/lib/datadog_api_client/v2/models/llm_obs_span_filter.rb new file mode 100644 index 000000000000..38bc5f9a6c7c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_span_filter.rb @@ -0,0 +1,185 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Filter criteria for an LLM Observability span search. + class LLMObsSpanFilter + include BaseGenericModel + + # Start of the time range. Accepts ISO 8601 or relative format (e.g., `now-15m`). Defaults to `now-15m`. + attr_accessor :from + + # Filter by ML application name. + attr_accessor :ml_app + + # 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. + attr_accessor :query + + # Filter by exact span ID. + attr_accessor :span_id + + # Filter by span kind (e.g., llm, agent, tool, task, workflow). + attr_accessor :span_kind + + # Filter by span name. + attr_accessor :span_name + + # Filter by tag key-value pairs. + attr_accessor :tags + + # End of the time range. Accepts ISO 8601 or relative format (e.g., `now`). Defaults to `now`. + attr_accessor :to + + # Filter by exact trace ID. + attr_accessor :trace_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'from' => :'from', + :'ml_app' => :'ml_app', + :'query' => :'query', + :'span_id' => :'span_id', + :'span_kind' => :'span_kind', + :'span_name' => :'span_name', + :'tags' => :'tags', + :'to' => :'to', + :'trace_id' => :'trace_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'from' => :'String', + :'ml_app' => :'String', + :'query' => :'String', + :'span_id' => :'String', + :'span_kind' => :'String', + :'span_name' => :'String', + :'tags' => :'Hash', + :'to' => :'String', + :'trace_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpanFilter` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'ml_app') + self.ml_app = attributes[:'ml_app'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'span_id') + self.span_id = attributes[:'span_id'] + end + + if attributes.key?(:'span_kind') + self.span_kind = attributes[:'span_kind'] + end + + if attributes.key?(:'span_name') + self.span_name = attributes[:'span_name'] + end + + if attributes.key?(:'tags') + self.tags = attributes[:'tags'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'trace_id') + self.trace_id = attributes[:'trace_id'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + from == o.from && + ml_app == o.ml_app && + query == o.query && + span_id == o.span_id && + span_kind == o.span_kind && + span_name == o.span_name && + tags == o.tags && + to == o.to && + trace_id == o.trace_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [from, ml_app, query, span_id, span_kind, span_name, tags, to, trace_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_span_io.rb b/lib/datadog_api_client/v2/models/llm_obs_span_io.rb new file mode 100644 index 000000000000..aa71504514fc --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_span_io.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Input or output content of an LLM Observability span. + class LLMObsSpanIO + include BaseGenericModel + + # List of messages in the input or output. + attr_accessor :messages + + # Plain-text value of the input or output. + attr_accessor :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'messages' => :'messages', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'messages' => :'Array', + :'value' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpanIO` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'messages') + if (value = attributes[:'messages']).is_a?(Array) + self.messages = value + end + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + messages == o.messages && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [messages, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_span_message.rb b/lib/datadog_api_client/v2/models/llm_obs_span_message.rb new file mode 100644 index 000000000000..9b493d56d9b9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_span_message.rb @@ -0,0 +1,149 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single message in a span input or output. + class LLMObsSpanMessage + include BaseGenericModel + + # Text content of the message. + attr_accessor :content + + # Unique identifier of the message. + attr_accessor :id + + # Role of the message sender (e.g., user, assistant, system). + attr_accessor :role + + # Tool calls made in this message. + attr_accessor :tool_calls + + # Tool results returned in this message. + attr_accessor :tool_results + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'content' => :'content', + :'id' => :'id', + :'role' => :'role', + :'tool_calls' => :'tool_calls', + :'tool_results' => :'tool_results' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'content' => :'String', + :'id' => :'String', + :'role' => :'String', + :'tool_calls' => :'Array', + :'tool_results' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpanMessage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'role') + self.role = attributes[:'role'] + end + + if attributes.key?(:'tool_calls') + if (value = attributes[:'tool_calls']).is_a?(Array) + self.tool_calls = value + end + end + + if attributes.key?(:'tool_results') + if (value = attributes[:'tool_results']).is_a?(Array) + self.tool_results = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + content == o.content && + id == o.id && + role == o.role && + tool_calls == o.tool_calls && + tool_results == o.tool_results && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [content, id, role, tool_calls, tool_results, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_span_page_query.rb b/lib/datadog_api_client/v2/models/llm_obs_span_page_query.rb new file mode 100644 index 000000000000..26a1fb6c1dcd --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_span_page_query.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Pagination settings for a span search request. + class LLMObsSpanPageQuery + include BaseGenericModel + + # Cursor from the previous response to retrieve the next page. + attr_accessor :cursor + + # Maximum number of spans to return. Defaults to `10`. + attr_accessor :limit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cursor' => :'cursor', + :'limit' => :'limit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cursor' => :'String', + :'limit' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpanPageQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'cursor') + self.cursor = attributes[:'cursor'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cursor == o.cursor && + limit == o.limit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cursor, limit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_span_search_options.rb b/lib/datadog_api_client/v2/models/llm_obs_span_search_options.rb new file mode 100644 index 000000000000..f7f49faa2276 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_span_search_options.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Additional options for a span search request. + class LLMObsSpanSearchOptions + include BaseGenericModel + + # Whether to include attachment data in the response. Defaults to `true`. + attr_accessor :include_attachments + + # Offset in seconds applied to both `from` and `to` timestamps. + attr_accessor :time_offset + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'include_attachments' => :'include_attachments', + :'time_offset' => :'time_offset' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'include_attachments' => :'Boolean', + :'time_offset' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpanSearchOptions` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'include_attachments') + self.include_attachments = attributes[:'include_attachments'] + end + + if attributes.key?(:'time_offset') + self.time_offset = attributes[:'time_offset'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + include_attachments == o.include_attachments && + time_offset == o.time_offset && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [include_attachments, time_offset, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_span_tool_call.rb b/lib/datadog_api_client/v2/models/llm_obs_span_tool_call.rb new file mode 100644 index 000000000000..2ede077fc748 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_span_tool_call.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A tool call made during a span. + class LLMObsSpanToolCall + include BaseGenericModel + + # Arguments passed to the tool. + attr_accessor :arguments + + # Name of the tool called. + attr_accessor :name + + # Identifier of the tool call. + attr_accessor :tool_id + + # Type of the tool call. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'arguments' => :'arguments', + :'name' => :'name', + :'tool_id' => :'tool_id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'arguments' => :'Hash', + :'name' => :'String', + :'tool_id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpanToolCall` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'arguments') + self.arguments = attributes[:'arguments'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'tool_id') + self.tool_id = attributes[:'tool_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + arguments == o.arguments && + name == o.name && + tool_id == o.tool_id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [arguments, name, tool_id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_span_tool_definition.rb b/lib/datadog_api_client/v2/models/llm_obs_span_tool_definition.rb new file mode 100644 index 000000000000..ccf032a20c92 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_span_tool_definition.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A tool definition available to an LLM span. + class LLMObsSpanToolDefinition + include BaseGenericModel + + # Description of what the tool does. + attr_accessor :description + + # Name of the tool. + attr_accessor :name + + # JSON schema describing the tool's input parameters. + attr_accessor :schema + + # Version of the tool definition. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name', + :'schema' => :'schema', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String', + :'schema' => :'Hash', + :'version' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpanToolDefinition` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'schema') + self.schema = attributes[:'schema'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + schema == o.schema && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, schema, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_span_tool_result.rb b/lib/datadog_api_client/v2/models/llm_obs_span_tool_result.rb new file mode 100644 index 000000000000..f09946e315fc --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_span_tool_result.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A result returned from a tool call during a span. + class LLMObsSpanToolResult + include BaseGenericModel + + # Name of the tool that produced this result. + attr_accessor :name + + # Result value returned by the tool. + attr_accessor :result + + # Identifier of the corresponding tool call. + attr_accessor :tool_id + + # Type of the tool result. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'result' => :'result', + :'tool_id' => :'tool_id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'result' => :'String', + :'tool_id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpanToolResult` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'result') + self.result = attributes[:'result'] + end + + if attributes.key?(:'tool_id') + self.tool_id = attributes[:'tool_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + result == o.result && + tool_id == o.tool_id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, result, tool_id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_span_type.rb b/lib/datadog_api_client/v2/models/llm_obs_span_type.rb new file mode 100644 index 000000000000..f5a01cfad29b --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_span_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resource type for an LLM Observability span. + class LLMObsSpanType + include BaseEnumModel + + SPAN = "span".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_spans_response.rb b/lib/datadog_api_client/v2/models/llm_obs_spans_response.rb new file mode 100644 index 000000000000..40dd1d02ee5a --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_spans_response.rb @@ -0,0 +1,156 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of LLM Observability spans. + class LLMObsSpansResponse + include BaseGenericModel + + # List of spans matching the query. + attr_reader :data + + # Pagination links accompanying the spans response. + attr_accessor :links + + # Metadata accompanying the spans response. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'links' => :'links', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'links' => :'LLMObsSpansResponseLinks', + :'meta' => :'LLMObsSpansResponseMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpansResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'links') + self.links = attributes[:'links'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + links == o.links && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, links, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_spans_response_links.rb b/lib/datadog_api_client/v2/models/llm_obs_spans_response_links.rb new file mode 100644 index 000000000000..0302bdb34da0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_spans_response_links.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Pagination links accompanying the spans response. + class LLMObsSpansResponseLinks + include BaseGenericModel + + # URL to retrieve the next page of results. + attr_accessor :_next + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_next' => :'next' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_next' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpansResponseLinks` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_next') + self._next = attributes[:'_next'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _next == o._next && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_next, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_spans_response_meta.rb b/lib/datadog_api_client/v2/models/llm_obs_spans_response_meta.rb new file mode 100644 index 000000000000..6d958a44868f --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_spans_response_meta.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata accompanying the spans response. + class LLMObsSpansResponseMeta + include BaseGenericModel + + # Time elapsed for the query in milliseconds. + attr_reader :elapsed + + # Pagination cursor for the spans response. + attr_reader :page + + # Unique identifier for the request. + attr_reader :request_id + + # Status of the query execution. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'elapsed' => :'elapsed', + :'page' => :'page', + :'request_id' => :'request_id', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'elapsed' => :'Integer', + :'page' => :'LLMObsSpansResponsePage', + :'request_id' => :'String', + :'status' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpansResponseMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'elapsed') + self.elapsed = attributes[:'elapsed'] + end + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + + if attributes.key?(:'request_id') + self.request_id = attributes[:'request_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @elapsed.nil? + return false if @page.nil? + return false if @request_id.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param elapsed [Object] Object to be assigned + # @!visibility private + def elapsed=(elapsed) + if elapsed.nil? + fail ArgumentError, 'invalid value for "elapsed", elapsed cannot be nil.' + end + @elapsed = elapsed + end + + # Custom attribute writer method with validation + # @param page [Object] Object to be assigned + # @!visibility private + def page=(page) + if page.nil? + fail ArgumentError, 'invalid value for "page", page cannot be nil.' + end + @page = page + end + + # Custom attribute writer method with validation + # @param request_id [Object] Object to be assigned + # @!visibility private + def request_id=(request_id) + if request_id.nil? + fail ArgumentError, 'invalid value for "request_id", request_id cannot be nil.' + end + @request_id = request_id + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + elapsed == o.elapsed && + page == o.page && + request_id == o.request_id && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [elapsed, page, request_id, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_spans_response_page.rb b/lib/datadog_api_client/v2/models/llm_obs_spans_response_page.rb new file mode 100644 index 000000000000..3bd6d5c5388d --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_spans_response_page.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Pagination cursor for the spans response. + class LLMObsSpansResponsePage + include BaseGenericModel + + # Cursor to retrieve the next page of results. Absent when there are no more results. + attr_accessor :after + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'after' => :'after' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'after' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsSpansResponsePage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'after') + self.after = attributes[:'after'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + after == o.after && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [after, additional_properties].hash + end + end +end