diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ed984a56d0ee..8c2c3e3ae507 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1009,6 +1009,32 @@ components: required: true schema: type: string + LLMObsPromptIDPathParameter: + description: The customer-provided identifier of the LLM Observability prompt. + example: "my-prompt" + in: path + name: prompt_id + required: true + schema: + type: string + LLMObsPromptLabelQueryParameter: + description: >- + **Deprecated. Do not use this parameter for new integrations.** The label of the prompt version to return. If omitted, the latest version is returned. If the prompt has no labels, the latest version is returned even when a label is requested. + in: query + name: label + required: false + schema: + type: string + LLMObsPromptVersionPathParameter: + description: The version number of the LLM Observability prompt. + example: 1 + in: path + name: version + required: true + schema: + format: int64 + minimum: 1 + type: integer LinkIDPathParameter: description: "The UUID of the case link." in: path @@ -51818,6 +51844,101 @@ components: $ref: "#/components/schemas/LLMObsContentBlock" minItems: 1 type: array + LLMObsCreatePromptData: + description: Data object for creating an LLM Observability prompt. + properties: + attributes: + $ref: "#/components/schemas/LLMObsCreatePromptDataAttributes" + type: + $ref: "#/components/schemas/LLMObsPromptType" + required: + - type + - attributes + type: object + LLMObsCreatePromptDataAttributes: + description: Attributes for creating an LLM Observability prompt and its first version. + properties: + description: + description: Description of the prompt. + type: string + env_ids: + description: Feature-flag environment UUIDs to enable for this prompt immediately after creation. + items: + type: string + type: array + labels: + description: Labels to attach to the first version. + items: + type: string + type: array + prompt_id: + description: Customer-provided identifier for the new prompt. + example: "my-prompt" + type: string + template: + $ref: "#/components/schemas/LLMObsPromptTemplate" + title: + description: Title of the prompt. + type: string + user_version: + description: User-supplied version identifier for the first version. + type: string + required: + - prompt_id + - template + type: object + LLMObsCreatePromptRequest: + description: Request to create an LLM Observability prompt. + properties: + data: + $ref: "#/components/schemas/LLMObsCreatePromptData" + required: + - data + type: object + LLMObsCreatePromptVersionData: + description: Data object for creating an LLM Observability prompt version. + properties: + attributes: + $ref: "#/components/schemas/LLMObsCreatePromptVersionDataAttributes" + type: + $ref: "#/components/schemas/LLMObsPromptVersionType" + required: + - type + - attributes + type: object + LLMObsCreatePromptVersionDataAttributes: + description: Attributes for creating a new version of an LLM Observability prompt. + properties: + description: + description: Description of this version. + type: string + env_ids: + description: >- + Feature-flag environment UUIDs whose default variant should be set to this version after creation. + items: + type: string + type: array + labels: + description: Labels to attach to this version. + items: + type: string + type: array + template: + $ref: "#/components/schemas/LLMObsPromptTemplate" + user_version: + description: User-supplied version identifier for this version. + type: string + required: + - template + type: object + LLMObsCreatePromptVersionRequest: + description: Request to create a new version of an LLM Observability prompt. + properties: + data: + $ref: "#/components/schemas/LLMObsCreatePromptVersionData" + required: + - data + type: object LLMObsCursorMeta: description: Pagination cursor metadata. properties: @@ -53293,6 +53414,46 @@ components: required: - data type: object + LLMObsDeletedPromptData: + description: Data object confirming that an LLM Observability prompt was deleted. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDeletedPromptDataAttributes" + id: + description: Unique identifier of the deleted prompt. + example: "" + type: string + type: + $ref: "#/components/schemas/LLMObsPromptType" + required: + - id + - type + - attributes + type: object + LLMObsDeletedPromptDataAttributes: + description: Attributes confirming that an LLM Observability prompt was deleted. + properties: + deleted_at: + description: Timestamp when the prompt was deleted. + example: "" + format: date-time + type: string + prompt_id: + description: Customer-provided identifier of the deleted prompt. + example: "" + type: string + required: + - prompt_id + - deleted_at + type: object + LLMObsDeletedPromptResponse: + description: Response confirming that an LLM Observability prompt was deleted. + properties: + data: + $ref: "#/components/schemas/LLMObsDeletedPromptData" + required: + - data + type: object LLMObsDisplayBlockAnnotatedInteractionItem: description: A display_block interaction with its associated annotations. properties: @@ -56387,6 +56548,421 @@ components: required: - data type: object + LLMObsPromptChatMessage: + description: A single chat message in a prompt template. + properties: + content: + description: Content of the message. + example: "" + type: string + role: + description: Role of the message (for example `system`, `user`, or `assistant`). + example: "" + type: string + required: + - role + - content + type: object + LLMObsPromptChatTemplate: + description: A chat prompt template. + items: + $ref: "#/components/schemas/LLMObsPromptChatMessage" + minItems: 1 + type: array + x-generate-alias-as-model: true + LLMObsPromptData: + description: Data object for an LLM Observability prompt. + properties: + attributes: + $ref: "#/components/schemas/LLMObsPromptDataAttributes" + id: + description: Unique identifier of the prompt. + example: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + type: string + type: + $ref: "#/components/schemas/LLMObsPromptType" + required: + - id + - type + - attributes + type: object + LLMObsPromptDataAttributes: + description: Attributes of an LLM Observability prompt registry entry. + properties: + author: + description: UUID of the user who authored the prompt. + type: string + created_at: + description: Timestamp when the prompt was created. + format: date-time + type: string + created_from: + description: >- + Source that created the prompt, such as `ui-registry`, `sdk-registry`, or `sdk-instrumentation`. + example: "" + type: string + datasets: + description: Datasets observed in runs associated with this prompt. + items: + $ref: "#/components/schemas/LLMObsPromptDataset" + type: array + description: + description: Description of the prompt. + type: string + extracted_from: + description: Source prompt from which this prompt was extracted, when applicable. + type: string + in_registry: + description: Whether the prompt is a registry entry (as opposed to a code-discovered prompt). + example: false + type: boolean + last_seen_at: + description: Timestamp of the most recent observed run of this prompt. + format: date-time + type: string + last_version_created_at: + description: Timestamp when the most recent version of the prompt was created. + format: date-time + type: string + ml_app: + description: The ML application this prompt is associated with. + type: string + ml_apps: + description: ML applications observed running this prompt. + items: + type: string + type: array + num_versions: + description: Number of versions of the prompt. + example: 0 + format: int64 + type: integer + prompt_id: + description: Customer-provided identifier of the prompt. + example: "my-prompt" + type: string + source: + $ref: "#/components/schemas/LLMObsPromptResponseSource" + tags: + description: Tags observed on runs of this prompt. + items: + type: string + type: array + title: + description: Title of the prompt. + type: string + required: + - prompt_id + - source + - num_versions + - in_registry + - created_from + type: object + LLMObsPromptDataset: + description: A dataset observed in runs associated with a prompt or prompt version. + properties: + id: + description: Unique identifier of the dataset. + example: "" + type: string + name: + description: Name of the dataset. + type: string + required: + - id + type: object + LLMObsPromptResponse: + description: Response containing a single LLM Observability prompt. + properties: + data: + $ref: "#/components/schemas/LLMObsPromptData" + required: + - data + type: object + LLMObsPromptResponseSource: + description: Whether the prompt was created from the registry or discovered from observed LLM calls. + enum: + - registry + - code + example: registry + type: string + x-enum-varnames: + - REGISTRY + - CODE + LLMObsPromptSDKData: + description: Data object for a flattened LLM Observability prompt version returned for SDK consumption. + properties: + attributes: + $ref: "#/components/schemas/LLMObsPromptSDKDataAttributes" + id: + description: Unique identifier of the prompt. + example: "" + type: string + type: + $ref: "#/components/schemas/LLMObsPromptType" + required: + - id + - type + - attributes + type: object + LLMObsPromptSDKDataAttributes: + description: >- + Attributes of a flattened prompt version returned for SDK consumption. Exactly one of `template` and `chat_template` is returned. + properties: + chat_template: + description: >- + Chat template for this prompt version, as a list of role/content messages. Omitted for text templates. + items: + $ref: "#/components/schemas/LLMObsPromptChatMessage" + type: array + label: + description: The label requested through the `label` query parameter. Empty if no label was requested. + type: string + prompt_id: + description: Customer-provided identifier of the prompt. + type: string + prompt_version_uuid: + description: Unique identifier of this prompt version. + type: string + template: + description: Text template for this prompt version. Omitted for chat templates. + type: string + version: + description: >- + Version identifier for this prompt version. This is the sequential version number unless a user-supplied version label was set, in which case that label is used instead. + type: string + type: object + LLMObsPromptSDKResponse: + description: Response containing a flattened LLM Observability prompt version for SDK consumption. + properties: + data: + $ref: "#/components/schemas/LLMObsPromptSDKData" + required: + - data + type: object + LLMObsPromptTemplate: + description: A text template or a list of chat messages. + example: L + oneOf: + - $ref: "#/components/schemas/LLMObsPromptTextTemplate" + - $ref: "#/components/schemas/LLMObsPromptChatTemplate" + LLMObsPromptTextTemplate: + description: A text prompt template. + minLength: 1 + type: string + LLMObsPromptType: + description: Resource type of an LLM Observability prompt. + enum: + - prompt-templates + example: prompt-templates + type: string + x-enum-varnames: + - PROMPT_TEMPLATES + LLMObsPromptVersionData: + description: Data object for a specific version of an LLM Observability prompt. + properties: + attributes: + $ref: "#/components/schemas/LLMObsPromptVersionDataAttributes" + id: + description: Unique identifier of the prompt version. + example: "" + type: string + type: + $ref: "#/components/schemas/LLMObsPromptVersionType" + required: + - id + - type + - attributes + type: object + LLMObsPromptVersionDataAttributes: + description: Attributes of a specific version of an LLM Observability prompt. + properties: + author: + description: UUID of the user who authored this version. + type: string + created_at: + description: Timestamp stored on this prompt version. + format: date-time + type: string + datasets: + description: Datasets observed in runs associated with this prompt version. + items: + $ref: "#/components/schemas/LLMObsPromptDataset" + type: array + description: + description: Description of this version. + type: string + labels: + description: Labels attached to this version (for example `development`, `staging`, `production`). + items: + type: string + type: array + last_seen_at: + description: Timestamp of the most recent observed run of this prompt version. + format: date-time + type: string + ml_app: + description: The ML application this prompt is associated with. + type: string + ml_apps: + description: ML applications observed running this prompt version. + items: + type: string + type: array + prompt_id: + description: Customer-provided identifier of the parent prompt. + example: "" + type: string + prompt_uuid: + description: Unique identifier of the parent prompt. + example: "" + type: string + tags: + description: Tags observed on runs of this prompt version. + items: + type: string + type: array + template: + $ref: "#/components/schemas/LLMObsPromptTemplate" + user_version: + description: User-supplied label for this version. + type: string + version: + description: Sequential version number. + example: 1 + format: int64 + minimum: 1 + type: integer + version_created_at: + description: Timestamp when this version was created. + format: date-time + type: string + required: + - prompt_uuid + - prompt_id + - template + - version + type: object + LLMObsPromptVersionListData: + description: Data object for a prompt version returned in a list. + properties: + attributes: + $ref: "#/components/schemas/LLMObsPromptVersionListDataAttributes" + id: + description: Unique identifier of the prompt version. + example: "" + type: string + type: + $ref: "#/components/schemas/LLMObsPromptVersionType" + required: + - id + - type + - attributes + type: object + LLMObsPromptVersionListDataAttributes: + description: Attributes of a prompt version returned in a list, excluding its template. + properties: + author: + description: UUID of the user who authored this version. + type: string + created_at: + description: Timestamp stored on this prompt version. + format: date-time + type: string + datasets: + description: Datasets observed in runs associated with this prompt version. + items: + $ref: "#/components/schemas/LLMObsPromptDataset" + type: array + description: + description: Description of this version. + type: string + labels: + description: Labels attached to this version (for example `development`, `staging`, `production`). + items: + type: string + type: array + last_seen_at: + description: Timestamp of the most recent observed run of this prompt version. + format: date-time + type: string + ml_app: + description: The ML application this prompt is associated with. + type: string + ml_apps: + description: ML applications observed running this prompt version. + items: + type: string + type: array + prompt_id: + description: Customer-provided identifier of the parent prompt. + example: "" + type: string + prompt_uuid: + description: Unique identifier of the parent prompt. + example: "" + type: string + tags: + description: Tags observed on runs of this prompt version. + items: + type: string + type: array + user_version: + description: User-supplied label for this version. + type: string + version: + description: Sequential version number. + example: 1 + format: int64 + minimum: 1 + type: integer + version_created_at: + description: Timestamp when this version was created. + format: date-time + type: string + required: + - prompt_uuid + - prompt_id + - version + type: object + LLMObsPromptVersionResponse: + description: Response containing a specific version of an LLM Observability prompt. + properties: + data: + $ref: "#/components/schemas/LLMObsPromptVersionData" + required: + - data + type: object + LLMObsPromptVersionType: + description: Resource type of an LLM Observability prompt version. + enum: + - prompt-template-versions + example: prompt-template-versions + type: string + x-enum-varnames: + - PROMPT_TEMPLATE_VERSIONS + LLMObsPromptVersionsResponse: + description: Response containing the versions of an LLM Observability prompt. + properties: + data: + description: Prompt versions ordered from newest to oldest. + items: + $ref: "#/components/schemas/LLMObsPromptVersionListData" + type: array + required: + - data + type: object + LLMObsPromptsResponse: + description: Response containing a list of LLM Observability prompts. + properties: + data: + description: List of LLM Observability prompts. + items: + $ref: "#/components/schemas/LLMObsPromptData" + type: array + required: + - data + type: object LLMObsRecordType: description: Resource type of LLM Observability dataset records. enum: @@ -56880,6 +57456,73 @@ components: - TRACE - EXPERIMENT_TRACE - SESSION + LLMObsUpdatePromptData: + description: Data object for updating an LLM Observability prompt. + properties: + attributes: + $ref: "#/components/schemas/LLMObsUpdatePromptDataAttributes" + type: + $ref: "#/components/schemas/LLMObsPromptType" + required: + - type + - attributes + type: object + LLMObsUpdatePromptDataAttributes: + description: Attributes for updating an LLM Observability prompt. At least one field must be provided. + minProperties: 1 + properties: + description: + description: New description for the prompt. + type: string + title: + description: New title for the prompt. + type: string + type: object + LLMObsUpdatePromptRequest: + description: Request to update an LLM Observability prompt's metadata. + properties: + data: + $ref: "#/components/schemas/LLMObsUpdatePromptData" + required: + - data + type: object + LLMObsUpdatePromptVersionData: + description: Data object for updating an LLM Observability prompt version. + properties: + attributes: + $ref: "#/components/schemas/LLMObsUpdatePromptVersionDataAttributes" + type: + $ref: "#/components/schemas/LLMObsPromptVersionType" + required: + - type + - attributes + type: object + LLMObsUpdatePromptVersionDataAttributes: + description: Attributes for updating an LLM Observability prompt version. At least one field must be provided. + minProperties: 1 + properties: + description: + description: New description for this version. + type: string + env_ids: + description: Feature-flag environment UUIDs whose default variant should be set to this version. + items: + type: string + type: array + labels: + description: New labels for this version. + items: + type: string + type: array + type: object + LLMObsUpdatePromptVersionRequest: + description: Request to update an LLM Observability prompt version's metadata or feature-flag environments. + properties: + data: + $ref: "#/components/schemas/LLMObsUpdatePromptVersionData" + required: + - data + type: object LLMObsUpsertAnnotationItem: description: |- A single annotation to create or update. The annotation is matched by @@ -151107,18 +151750,693 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Push events for an LLM Observability experiment + summary: Push events for an LLM Observability experiment + 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/integrations/{integration}/accounts: + get: + description: Retrieve the list of configured accounts for the specified LLM provider integration. + operationId: ListLLMObsIntegrationAccounts + parameters: + - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + - account_id: "org-XYZ123" + account_name: "Production OpenAI" + account_region: "" + id: "account-abc123" + integration: "openai" + schema: + items: + $ref: "#/components/schemas/LLMObsIntegrationAccount" + type: array + 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 integration accounts + 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/integrations/{integration}/{account_id}/inference: + post: + description: Run an LLM inference request through the specified integration and account, returning the model response and token usage. + operationId: CreateLLMObsIntegrationInference + parameters: + - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" + - $ref: "#/components/parameters/LLMObsAccountIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + max_tokens: 256 + messages: + - content: "What is the capital of France?" + role: "user" + model_id: "gpt-4o" + temperature: 0.7 + schema: + $ref: "#/components/schemas/LLMObsIntegrationInferenceRequest" + description: Inference request parameters. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + max_tokens: 256 + messages: + - content: "What is the capital of France?" + role: "user" + model_id: "gpt-4o" + response: + assessment: "pass" + content: "The capital of France is Paris." + finish_reason: "stop" + inference_codes: [] + input_tokens: 15 + latency: 843 + output_tokens: 9 + tools: [] + total_tokens: 24 + temperature: 0.7 + schema: + $ref: "#/components/schemas/LLMObsIntegrationInferenceResponse" + 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" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Run an LLM inference + 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/integrations/{integration}/{account_id}/models: + get: + description: Retrieve the list of models available for the specified LLM provider integration and account. + operationId: ListLLMObsIntegrationModels + parameters: + - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" + - $ref: "#/components/parameters/LLMObsAccountIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + - has_access: true + id: "gpt-4o" + integration: "openai" + integration_display_name: "OpenAI" + json_schema: true + model_display_name: "GPT-4o" + model_id: "gpt-4o" + provider: "openai" + provider_display_name: "OpenAI" + schema: + items: + $ref: "#/components/schemas/LLMObsIntegrationModel" + type: array + 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 integration models + 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/projects: + get: + description: List all LLM Observability projects sorted by creation date, newest first. + operationId: ListLLMObsProjects + parameters: + - description: Filter projects by project ID. + in: query + name: filter[id] + schema: + type: string + - description: Filter projects by name. + in: query + name: filter[name] + schema: + type: string + - description: Use the Pagination cursor to retrieve the next page of results. + in: query + name: page[cursor] + schema: + type: string + - description: Maximum number of results to return per page. + in: query + name: page[limit] + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-01T00:00:00+00:00" + description: "" + name: My LLM Project + updated_at: "2024-01-01T00:00:00+00:00" + id: 00000000-0000-0000-0000-000000000001 + type: projects + schema: + $ref: "#/components/schemas/LLMObsProjectsResponse" + 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 projects + 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/). + post: + description: Create a new LLM Observability project. Returns the existing project if a name conflict occurs. + operationId: CreateLLMObsProject + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: My LLM Project + type: projects + schema: + $ref: "#/components/schemas/LLMObsProjectRequest" + description: Create project payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + description: "" + name: My LLM Project + updated_at: "2024-01-01T00:00:00+00:00" + id: 00000000-0000-0000-0000-000000000002 + type: projects + schema: + $ref: "#/components/schemas/LLMObsProjectResponse" + description: OK + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + description: "" + name: My LLM Project + updated_at: "2024-01-01T00:00:00+00:00" + id: 00000000-0000-0000-0000-000000000003 + type: projects + schema: + $ref: "#/components/schemas/LLMObsProjectResponse" + description: Created + "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: Create an LLM Observability project + 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/projects/delete: + post: + description: Delete one or more LLM Observability projects. + operationId: DeleteLLMObsProjects + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + project_ids: + - a33671aa-24fd-4dcd-9b33-a8ec7dde7751 + type: projects + schema: + $ref: "#/components/schemas/LLMObsDeleteProjectsRequest" + description: Delete projects payload. + required: true + responses: + "204": + description: No Content + "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 projects + 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/projects/{project_id}: + patch: + description: Partially update an existing LLM Observability project. + operationId: UpdateLLMObsProject + parameters: + - $ref: "#/components/parameters/LLMObsProjectIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + type: projects + schema: + $ref: "#/components/schemas/LLMObsProjectUpdateRequest" + description: Update project payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + description: "" + name: My LLM Project + updated_at: "2024-01-01T00:00:00+00:00" + id: 00000000-0000-0000-0000-000000000004 + type: projects + schema: + $ref: "#/components/schemas/LLMObsProjectResponse" + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update an LLM Observability project + 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/prompts: + get: + description: List all LLM Observability prompts in the prompt registry for the org. + operationId: ListLLMObsPrompts + parameters: + - description: Filter prompts by prompt ID. + in: query + name: filter[prompt_id] + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + author: "b1883807-14fd-4e12-bd6f-4a2f5c8b3d1e" + created_at: "2026-05-07T15:34:58.581041+00:00" + created_from: "ui-registry" + in_registry: true + last_version_created_at: "2026-05-07T15:34:58.581041+00:00" + num_versions: 1 + prompt_id: "genre_classifier" + source: registry + title: "Genre Classifier" + id: "015ac2ea-8a25-5f0f-946f-f48264d772eb" + type: prompt-templates + - attributes: + created_at: "2026-03-25T00:00:00+00:00" + created_from: "sdk-instrumentation" + in_registry: true + last_version_created_at: "2026-03-25T00:00:00+00:00" + ml_app: "dbm-assistant" + num_versions: 2 + prompt_id: "dbm-assistant-system-prompt" + source: registry + id: "bcd10c3d-8a25-5f0f-946f-f48264d772eb" + type: prompt-templates + schema: + $ref: "#/components/schemas/LLMObsPromptsResponse" + 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 prompts + 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/). + post: + description: Create a new prompt (and its first version) in the LLM Observability prompt registry. + operationId: CreateLLMObsPrompt + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + prompt_id: "my-prompt" + template: + - content: "You are a helpful assistant." + role: "system" + - content: "Hello {{name}}" + role: "user" + title: "My prompt" + type: prompt-templates + schema: + $ref: "#/components/schemas/LLMObsCreatePromptRequest" + description: Create prompt payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + author: "3b12f1df-14fd-4e12-bd6f-4a2f5c8b3d1e" + created_at: "2025-01-01T00:00:00+00:00" + created_from: "sdk-registry" + in_registry: true + last_version_created_at: "2025-01-01T00:00:00+00:00" + num_versions: 1 + prompt_id: "my-prompt" + source: registry + title: "My prompt" + id: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + type: prompt-templates + schema: + $ref: "#/components/schemas/LLMObsPromptResponse" + 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 + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create an LLM Observability prompt + 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/prompts/{prompt_id}: + delete: + description: >- + Soft-delete an LLM Observability prompt. The prompt's version rows are retained, but they are no longer accessible through the public prompt registry endpoints. + operationId: DeleteLLMObsPrompt + parameters: + - $ref: "#/components/parameters/LLMObsPromptIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + deleted_at: "2025-01-01T00:00:00.000000Z" + prompt_id: "my-prompt" + id: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + type: prompt-templates + schema: + $ref: "#/components/schemas/LLMObsDeletedPromptResponse" + description: OK + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete an LLM Observability prompt 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/integrations/{integration}/accounts: get: - description: Retrieve the list of configured accounts for the specified LLM provider integration. - operationId: ListLLMObsIntegrationAccounts + description: Get the latest version of an LLM Observability prompt by prompt ID. + operationId: GetLLMObsPrompt parameters: - - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" + - $ref: "#/components/parameters/LLMObsPromptIDPathParameter" + - $ref: "#/components/parameters/LLMObsPromptLabelQueryParameter" responses: "200": content: @@ -151126,22 +152444,22 @@ paths: examples: default: value: - - account_id: "org-XYZ123" - account_name: "Production OpenAI" - account_region: "" - id: "account-abc123" - integration: "openai" + data: + attributes: + chat_template: + - content: "you are a test" + role: "system" + - content: "hello {{template_variable}}" + role: "user" + label: "" + prompt_id: "my-prompt" + prompt_version_uuid: "20e5280b-c75d-5699-8a70-a2773a751428" + version: "1" + id: "78dbd07d-f964-5b1b-97aa-d711fa65b7f7" + type: prompt-templates schema: - items: - $ref: "#/components/schemas/LLMObsIntegrationAccount" - type: array + $ref: "#/components/schemas/LLMObsPromptSDKResponse" description: OK - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request "401": content: application/json: @@ -151154,39 +152472,46 @@ paths: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" security: - apiKeyAuth: [] appKeyAuth: [] - summary: List LLM integration accounts + summary: Get an LLM Observability prompt tags: - LLM Observability x-unstable: |- - **Note**: This endpoint is in Preview and is subject to change. + **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/integrations/{integration}/{account_id}/inference: - post: - description: Run an LLM inference request through the specified integration and account, returning the model response and token usage. - operationId: CreateLLMObsIntegrationInference + patch: + description: |- + Update the title and/or description of an LLM Observability prompt. + + This endpoint does not recompute version aggregate data: `num_versions` and `last_version_created_at` + are not populated in the response and may show as `0` and a zero-value timestamp even if the prompt has + existing versions. + operationId: UpdateLLMObsPrompt parameters: - - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" - - $ref: "#/components/parameters/LLMObsAccountIDPathParameter" + - $ref: "#/components/parameters/LLMObsPromptIDPathParameter" requestBody: content: application/json: examples: default: value: - max_tokens: 256 - messages: - - content: "What is the capital of France?" - role: "user" - model_id: "gpt-4o" - temperature: 0.7 + data: + attributes: + title: "My prompt (updated)" + type: prompt-templates schema: - $ref: "#/components/schemas/LLMObsIntegrationInferenceRequest" - description: Inference request parameters. + $ref: "#/components/schemas/LLMObsUpdatePromptRequest" + description: Update prompt payload. required: true responses: "200": @@ -151195,24 +152520,22 @@ paths: examples: default: value: - max_tokens: 256 - messages: - - content: "What is the capital of France?" - role: "user" - model_id: "gpt-4o" - response: - assessment: "pass" - content: "The capital of France is Paris." - finish_reason: "stop" - inference_codes: [] - input_tokens: 15 - latency: 843 - output_tokens: 9 - tools: [] - total_tokens: 24 - temperature: 0.7 + data: + attributes: + author: "3b12f1df-14fd-4e12-bd6f-4a2f5c8b3d1e" + created_at: "2025-01-01T00:00:00+00:00" + created_from: "ui-registry" + description: "My prompt description" + in_registry: true + last_version_created_at: "0001-01-01T00:00:00Z" + num_versions: 0 + prompt_id: "my-prompt" + source: registry + title: "My prompt (updated)" + id: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + type: prompt-templates schema: - $ref: "#/components/schemas/LLMObsIntegrationInferenceResponse" + $ref: "#/components/schemas/LLMObsPromptResponse" description: OK "400": content: @@ -151232,106 +152555,29 @@ paths: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Forbidden - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - "500": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Internal Server Error - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: Run an LLM inference - 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/integrations/{integration}/{account_id}/models: - get: - description: Retrieve the list of models available for the specified LLM provider integration and account. - operationId: ListLLMObsIntegrationModels - parameters: - - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" - - $ref: "#/components/parameters/LLMObsAccountIDPathParameter" - responses: - "200": - content: - application/json: - examples: - default: - value: - - has_access: true - id: "gpt-4o" - integration: "openai" - integration_display_name: "OpenAI" - json_schema: true - model_display_name: "GPT-4o" - model_id: "gpt-4o" - provider: "openai" - provider_display_name: "OpenAI" - schema: - items: - $ref: "#/components/schemas/LLMObsIntegrationModel" - type: array - 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": + "404": content: application/json: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" security: - apiKeyAuth: [] appKeyAuth: [] - summary: List LLM integration models + summary: Update an LLM Observability prompt tags: - LLM Observability x-unstable: |- - **Note**: This endpoint is in Preview and is subject to change. + **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/projects: + /api/v2/llm-obs/v1/prompts/{prompt_id}/versions: get: - description: List all LLM Observability projects sorted by creation date, newest first. - operationId: ListLLMObsProjects + description: List all versions of an LLM Observability prompt, ordered newest to oldest. + operationId: ListLLMObsPromptVersions parameters: - - description: Filter projects by project ID. - in: query - name: filter[id] - schema: - type: string - - description: Filter projects by name. - in: query - name: filter[name] - schema: - type: string - - description: Use the Pagination cursor to retrieve the next page of results. - in: query - name: page[cursor] - schema: - type: string - - description: Maximum number of results to return per page. - in: query - name: page[limit] - schema: - format: int64 - type: integer + - $ref: "#/components/parameters/LLMObsPromptIDPathParameter" responses: "200": content: @@ -151341,21 +152587,27 @@ paths: value: data: - attributes: - created_at: "2024-01-01T00:00:00+00:00" - description: "" - name: My LLM Project - updated_at: "2024-01-01T00:00:00+00:00" - id: 00000000-0000-0000-0000-000000000001 - type: projects + author: "3b12f1df-14fd-4e12-bd6f-4a2f5c8b3d1e" + created_at: "2025-01-01T00:00:00+00:00" + description: "My prompt version description" + labels: + - "production" + last_seen_at: "2025-01-01T00:00:00+00:00" + ml_app: "my-ml-app" + ml_apps: + - "my-ml-app" + prompt_id: "my-prompt" + prompt_uuid: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + tags: + - "env:prod" + user_version: "v1" + version: 1 + version_created_at: "2025-01-01T00:00:00+00:00" + id: "9c6e5e2a-9b2a-4c6a-8f2a-1a2b3c4d5e6f" + type: prompt-template-versions schema: - $ref: "#/components/schemas/LLMObsProjectsResponse" + $ref: "#/components/schemas/LLMObsPromptVersionsResponse" description: OK - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request "401": content: application/json: @@ -151373,15 +152625,17 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: List LLM Observability projects + summary: List versions of an LLM Observability prompt 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/). post: - description: Create a new LLM Observability project. Returns the existing project if a name conflict occurs. - operationId: CreateLLMObsProject + description: Create a new version of an existing LLM Observability prompt. + operationId: CreateLLMObsPromptVersion + parameters: + - $ref: "#/components/parameters/LLMObsPromptIDPathParameter" requestBody: content: application/json: @@ -151390,11 +152644,15 @@ paths: value: data: attributes: - name: My LLM Project - type: projects + template: + - content: "you are a test v2" + role: "system" + - content: "hello again {{template_variable}}" + role: "user" + type: prompt-template-versions schema: - $ref: "#/components/schemas/LLMObsProjectRequest" - description: Create project payload. + $ref: "#/components/schemas/LLMObsCreatePromptVersionRequest" + description: Create prompt version payload. required: true responses: "200": @@ -151405,32 +152663,22 @@ paths: value: data: attributes: - created_at: "2024-01-01T00:00:00+00:00" - description: "" - name: My LLM Project - updated_at: "2024-01-01T00:00:00+00:00" - id: 00000000-0000-0000-0000-000000000002 - type: projects + author: "c5e19e5a-ad6b-11ed-ab4f-927130d31ef9" + created_at: "2026-07-16T08:07:03.676127798Z" + prompt_id: "spec-audit-1784189220" + prompt_uuid: "78dbd07d-f964-5b1b-97aa-d711fa65b7f7" + template: + - content: "you are a test v2" + role: "system" + - content: "hello again {{template_variable}}" + role: "user" + version: 2 + version_created_at: "2026-07-16T08:07:03.676127798Z" + id: "d83ab666-61cc-5545-a83b-2424bb85467b" + type: prompt-template-versions schema: - $ref: "#/components/schemas/LLMObsProjectResponse" + $ref: "#/components/schemas/LLMObsPromptVersionResponse" description: OK - "201": - content: - application/json: - examples: - default: - value: - data: - attributes: - created_at: "2024-01-01T00:00:00+00:00" - description: "" - name: My LLM Project - updated_at: "2024-01-01T00:00:00+00:00" - id: 00000000-0000-0000-0000-000000000003 - type: projects - schema: - $ref: "#/components/schemas/LLMObsProjectResponse" - description: Created "400": content: application/json: @@ -151449,39 +152697,63 @@ paths: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" security: - apiKeyAuth: [] appKeyAuth: [] - summary: Create an LLM Observability project + summary: Create a new LLM Observability prompt version 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/projects/delete: - post: - description: Delete one or more LLM Observability projects. - operationId: DeleteLLMObsProjects - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - project_ids: - - a33671aa-24fd-4dcd-9b33-a8ec7dde7751 - type: projects - schema: - $ref: "#/components/schemas/LLMObsDeleteProjectsRequest" - description: Delete projects payload. - required: true + /api/v2/llm-obs/v1/prompts/{prompt_id}/versions/{version}: + get: + description: Get the full template of a single, specific version of an LLM Observability prompt. + operationId: GetLLMObsPromptVersion + parameters: + - $ref: "#/components/parameters/LLMObsPromptIDPathParameter" + - $ref: "#/components/parameters/LLMObsPromptVersionPathParameter" responses: - "204": - description: No Content + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + author: "3b12f1df-14fd-4e12-bd6f-4a2f5c8b3d1e" + created_at: "2025-01-01T00:00:00+00:00" + description: "My prompt version description" + labels: + - "production" + last_seen_at: "2025-01-01T00:00:00+00:00" + ml_app: "my-ml-app" + ml_apps: + - "my-ml-app" + prompt_id: "my-prompt" + prompt_uuid: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + tags: + - "env:prod" + template: + - content: "Hello" + role: "user" + user_version: "v1" + version: 1 + version_created_at: "2025-01-01T00:00:00+00:00" + id: "9c6e5e2a-9b2a-4c6a-8f2a-1a2b3c4d5e6f" + type: prompt-template-versions + schema: + $ref: "#/components/schemas/LLMObsPromptVersionResponse" + description: OK "400": content: application/json: @@ -151500,23 +152772,30 @@ paths: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" security: - apiKeyAuth: [] appKeyAuth: [] - summary: Delete LLM Observability projects + summary: Get a specific LLM Observability prompt version 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/projects/{project_id}: patch: - description: Partially update an existing LLM Observability project. - operationId: UpdateLLMObsProject + description: >- + Update the description, labels, and/or feature-flag environments of a specific version of an LLM Observability prompt. + operationId: UpdateLLMObsPromptVersion parameters: - - $ref: "#/components/parameters/LLMObsProjectIDPathParameter" + - $ref: "#/components/parameters/LLMObsPromptIDPathParameter" + - $ref: "#/components/parameters/LLMObsPromptVersionPathParameter" requestBody: content: application/json: @@ -151524,10 +152803,12 @@ paths: default: value: data: - type: projects + attributes: + description: "Audit test version (updated)" + type: prompt-template-versions schema: - $ref: "#/components/schemas/LLMObsProjectUpdateRequest" - description: Update project payload. + $ref: "#/components/schemas/LLMObsUpdatePromptVersionRequest" + description: Update prompt version payload. required: true responses: "200": @@ -151538,14 +152819,22 @@ paths: value: data: attributes: - created_at: "2024-01-01T00:00:00+00:00" - description: "" - name: My LLM Project - updated_at: "2024-01-01T00:00:00+00:00" - id: 00000000-0000-0000-0000-000000000004 - type: projects + author: "3b12f1df-14fd-4e12-bd6f-4a2f5c8b3d1e" + created_at: "2025-01-01T00:00:00+00:00" + description: "Audit test version (updated)" + prompt_id: "my-prompt" + prompt_uuid: "78dbd07d-f964-5b1b-97aa-d711fa65b7f7" + template: + - content: "you are a test" + role: "system" + - content: "hello {{template_variable}}" + role: "user" + version: 1 + version_created_at: "2025-01-01T00:00:00+00:00" + id: "20e5280b-c75d-5699-8a70-a2773a751428" + type: prompt-template-versions schema: - $ref: "#/components/schemas/LLMObsProjectResponse" + $ref: "#/components/schemas/LLMObsPromptVersionResponse" description: OK "400": content: @@ -151576,7 +152865,7 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Update an LLM Observability project + summary: Update a specific LLM Observability prompt version tags: - LLM Observability x-unstable: |- @@ -201942,7 +203231,8 @@ tags: description: Find out more at url: "https://docs.datadoghq.com/account_management/api-app-keys/" name: Key Management - - description: Manage LLM Observability spans, data, projects, datasets, dataset records, experiments, and annotations. + - description: >- + Manage LLM Observability spans, data, projects, datasets, dataset records, experiments, prompts, 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/CreateLLMObsPrompt.rb b/examples/v2/llm-observability/CreateLLMObsPrompt.rb new file mode 100644 index 000000000000..e04e3537cfd7 --- /dev/null +++ b/examples/v2/llm-observability/CreateLLMObsPrompt.rb @@ -0,0 +1,20 @@ +# Create an LLM Observability prompt returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_llm_obs_prompt".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +body = DatadogAPIClient::V2::LLMObsCreatePromptRequest.new({ + data: DatadogAPIClient::V2::LLMObsCreatePromptData.new({ + attributes: DatadogAPIClient::V2::LLMObsCreatePromptDataAttributes.new({ + env_ids: [], + labels: [], + prompt_id: "Example-LLM-Observability", + template: "Hello", + }), + type: DatadogAPIClient::V2::LLMObsPromptType::PROMPT_TEMPLATES, + }), +}) +p api_instance.create_llm_obs_prompt(body) diff --git a/examples/v2/llm-observability/CreateLLMObsPromptVersion.rb b/examples/v2/llm-observability/CreateLLMObsPromptVersion.rb new file mode 100644 index 000000000000..2e18b0d8b0a1 --- /dev/null +++ b/examples/v2/llm-observability/CreateLLMObsPromptVersion.rb @@ -0,0 +1,22 @@ +# Create a new LLM Observability prompt version returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_llm_obs_prompt_version".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +# there is a valid "prompt" in the system +PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"] + +body = DatadogAPIClient::V2::LLMObsCreatePromptVersionRequest.new({ + data: DatadogAPIClient::V2::LLMObsCreatePromptVersionData.new({ + attributes: DatadogAPIClient::V2::LLMObsCreatePromptVersionDataAttributes.new({ + env_ids: [], + labels: [], + template: "Hello v3", + }), + type: DatadogAPIClient::V2::LLMObsPromptVersionType::PROMPT_TEMPLATE_VERSIONS, + }), +}) +p api_instance.create_llm_obs_prompt_version(PROMPT_DATA_ATTRIBUTES_PROMPT_ID, body) diff --git a/examples/v2/llm-observability/DeleteLLMObsPrompt.rb b/examples/v2/llm-observability/DeleteLLMObsPrompt.rb new file mode 100644 index 000000000000..8ba90975c9d1 --- /dev/null +++ b/examples/v2/llm-observability/DeleteLLMObsPrompt.rb @@ -0,0 +1,11 @@ +# Delete an LLM Observability prompt returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_llm_obs_prompt".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +# there is a valid "prompt" in the system +PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"] +p api_instance.delete_llm_obs_prompt(PROMPT_DATA_ATTRIBUTES_PROMPT_ID) diff --git a/examples/v2/llm-observability/GetLLMObsPrompt.rb b/examples/v2/llm-observability/GetLLMObsPrompt.rb new file mode 100644 index 000000000000..1f8210d495c9 --- /dev/null +++ b/examples/v2/llm-observability/GetLLMObsPrompt.rb @@ -0,0 +1,11 @@ +# Get an LLM Observability prompt returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_llm_obs_prompt".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +# there is a valid "prompt" in the system +PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"] +p api_instance.get_llm_obs_prompt(PROMPT_DATA_ATTRIBUTES_PROMPT_ID) diff --git a/examples/v2/llm-observability/GetLLMObsPromptVersion.rb b/examples/v2/llm-observability/GetLLMObsPromptVersion.rb new file mode 100644 index 000000000000..197021c8478a --- /dev/null +++ b/examples/v2/llm-observability/GetLLMObsPromptVersion.rb @@ -0,0 +1,14 @@ +# Get a specific LLM Observability prompt version returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_llm_obs_prompt_version".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +# there is a valid "prompt" in the system +PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"] + +# there is a valid "prompt_version" in the system +PROMPT_VERSION_DATA_ATTRIBUTES_VERSION = ENV["PROMPT_VERSION_DATA_ATTRIBUTES_VERSION"] +p api_instance.get_llm_obs_prompt_version(PROMPT_DATA_ATTRIBUTES_PROMPT_ID, PROMPT_VERSION_DATA_ATTRIBUTES_VERSION.to_i) diff --git a/examples/v2/llm-observability/ListLLMObsPromptVersions.rb b/examples/v2/llm-observability/ListLLMObsPromptVersions.rb new file mode 100644 index 000000000000..5eccc2346653 --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsPromptVersions.rb @@ -0,0 +1,11 @@ +# List versions of an LLM Observability prompt returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_llm_obs_prompt_versions".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +# there is a valid "prompt" in the system +PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"] +p api_instance.list_llm_obs_prompt_versions(PROMPT_DATA_ATTRIBUTES_PROMPT_ID) diff --git a/examples/v2/llm-observability/ListLLMObsPrompts.rb b/examples/v2/llm-observability/ListLLMObsPrompts.rb new file mode 100644 index 000000000000..58d5cbf8f5fa --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsPrompts.rb @@ -0,0 +1,8 @@ +# List LLM Observability prompts returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_llm_obs_prompts".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.list_llm_obs_prompts() diff --git a/examples/v2/llm-observability/UpdateLLMObsPrompt.rb b/examples/v2/llm-observability/UpdateLLMObsPrompt.rb new file mode 100644 index 000000000000..07f368787dd3 --- /dev/null +++ b/examples/v2/llm-observability/UpdateLLMObsPrompt.rb @@ -0,0 +1,20 @@ +# Update an LLM Observability prompt returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_llm_obs_prompt".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +# there is a valid "prompt" in the system +PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"] + +body = DatadogAPIClient::V2::LLMObsUpdatePromptRequest.new({ + data: DatadogAPIClient::V2::LLMObsUpdatePromptData.new({ + attributes: DatadogAPIClient::V2::LLMObsUpdatePromptDataAttributes.new({ + title: "New title", + }), + type: DatadogAPIClient::V2::LLMObsPromptType::PROMPT_TEMPLATES, + }), +}) +p api_instance.update_llm_obs_prompt(PROMPT_DATA_ATTRIBUTES_PROMPT_ID, body) diff --git a/examples/v2/llm-observability/UpdateLLMObsPromptVersion.rb b/examples/v2/llm-observability/UpdateLLMObsPromptVersion.rb new file mode 100644 index 000000000000..89f87ff9d970 --- /dev/null +++ b/examples/v2/llm-observability/UpdateLLMObsPromptVersion.rb @@ -0,0 +1,24 @@ +# Update a specific LLM Observability prompt version returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_llm_obs_prompt_version".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +# there is a valid "prompt" in the system +PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"] + +# there is a valid "prompt_version" in the system +PROMPT_VERSION_DATA_ATTRIBUTES_VERSION = ENV["PROMPT_VERSION_DATA_ATTRIBUTES_VERSION"] + +body = DatadogAPIClient::V2::LLMObsUpdatePromptVersionRequest.new({ + data: DatadogAPIClient::V2::LLMObsUpdatePromptVersionData.new({ + attributes: DatadogAPIClient::V2::LLMObsUpdatePromptVersionDataAttributes.new({ + env_ids: [], + labels: [], + }), + type: DatadogAPIClient::V2::LLMObsPromptVersionType::PROMPT_TEMPLATE_VERSIONS, + }), +}) +p api_instance.update_llm_obs_prompt_version(PROMPT_DATA_ATTRIBUTES_PROMPT_ID, PROMPT_VERSION_DATA_ATTRIBUTES_VERSION.to_i, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 1dd48326e4fb..967b72ff98b2 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1024,6 +1024,39 @@ "project_id" => "String", "body" => "LLMObsProjectUpdateRequest", }, + "v2.ListLLMObsPrompts" => { + "filter_prompt_id" => "String", + }, + "v2.CreateLLMObsPrompt" => { + "body" => "LLMObsCreatePromptRequest", + }, + "v2.DeleteLLMObsPrompt" => { + "prompt_id" => "String", + }, + "v2.GetLLMObsPrompt" => { + "prompt_id" => "String", + "label" => "String", + }, + "v2.UpdateLLMObsPrompt" => { + "prompt_id" => "String", + "body" => "LLMObsUpdatePromptRequest", + }, + "v2.ListLLMObsPromptVersions" => { + "prompt_id" => "String", + }, + "v2.CreateLLMObsPromptVersion" => { + "prompt_id" => "String", + "body" => "LLMObsCreatePromptVersionRequest", + }, + "v2.GetLLMObsPromptVersion" => { + "prompt_id" => "String", + "version" => "Integer", + }, + "v2.UpdateLLMObsPromptVersion" => { + "prompt_id" => "String", + "version" => "Integer", + "body" => "LLMObsUpdatePromptVersionRequest", + }, "v2.ListLLMObsSpans" => { "filter_from" => "String", "filter_to" => "String", diff --git a/features/v2/given.json b/features/v2/given.json index 0f9de6d48a2f..d0cfa2325997 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -858,6 +858,34 @@ "tag": "IP Allowlist", "operationId": "UpdateIPAllowlist" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"prompt-templates\",\n \"attributes\": {\n \"prompt_id\": \"{{ unique }}\",\n \"template\": [{\"role\": \"user\", \"content\": \"Hello\"}]\n }\n }\n}" + } + ], + "step": "there is a valid \"prompt\" in the system", + "key": "prompt", + "tag": "LLM Observability", + "operationId": "CreateLLMObsPrompt" + }, + { + "parameters": [ + { + "name": "prompt_id", + "source": "prompt.data.attributes.prompt_id" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"prompt-template-versions\",\n \"attributes\": {\n \"template\": [{\"role\": \"user\", \"content\": \"Hello v2\"}]\n }\n }\n}" + } + ], + "step": "there is a valid \"prompt_version\" in the system", + "key": "prompt_version", + "tag": "LLM Observability", + "operationId": "CreateLLMObsPromptVersion" + }, { "parameters": [ { diff --git a/features/v2/llm_observability.feature b/features/v2/llm_observability.feature index 35e9592fa0a9..13a928fc8db1 100644 --- a/features/v2/llm_observability.feature +++ b/features/v2/llm_observability.feature @@ -1,16 +1,16 @@ @endpoint(llm-observability) @endpoint(llm-observability-v2) Feature: LLM Observability Manage LLM Observability spans, data, projects, datasets, dataset records, - experiments, and annotations. + experiments, prompts, and annotations. Background: Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system And an instance of "LLMObservability" API @skip @team:DataDog/ml-observability Scenario: Add a display_block interaction returns "Created" response - Given operation "CreateLLMObsAnnotationQueueInteractions" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsAnnotationQueueInteractions" enabled And new "CreateLLMObsAnnotationQueueInteractions" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"interactions": [{"type": "display_block", "display_block": [{"type": "markdown", "content": "## Triage Instructions"}]}]}, "type": "interactions"}} @@ -19,7 +19,8 @@ Feature: LLM Observability @skip @team:DataDog/ml-observability Scenario: Add a display_block interaction with an image block missing url returns "Bad Request" response - Given operation "CreateLLMObsAnnotationQueueInteractions" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsAnnotationQueueInteractions" enabled And new "CreateLLMObsAnnotationQueueInteractions" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"interactions": [{"type": "display_block", "display_block": [{"type": "image"}]}]}, "type": "interactions"}} @@ -28,7 +29,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Add annotation queue interactions returns "Bad Request" response - Given operation "CreateLLMObsAnnotationQueueInteractions" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsAnnotationQueueInteractions" enabled And new "CreateLLMObsAnnotationQueueInteractions" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"interactions": [{"content_id": "trace-abc-123", "type": "trace"}]}, "type": "interactions"}} @@ -37,7 +39,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Add annotation queue interactions returns "Created" response - Given operation "CreateLLMObsAnnotationQueueInteractions" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsAnnotationQueueInteractions" enabled And new "CreateLLMObsAnnotationQueueInteractions" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"interactions": [{"content_id": "trace-abc-123", "type": "trace"}]}, "type": "interactions"}} @@ -46,7 +49,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Add annotation queue interactions returns "Not Found" response - Given operation "CreateLLMObsAnnotationQueueInteractions" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsAnnotationQueueInteractions" enabled And new "CreateLLMObsAnnotationQueueInteractions" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"interactions": [{"content_id": "trace-abc-123", "type": "trace"}]}, "type": "interactions"}} @@ -55,7 +59,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Aggregate LLM Observability experimentation returns "Bad Request" response - Given operation "AggregateLLMObsExperimentation" enabled + Given a valid "appKeyAuth" key in the system + And operation "AggregateLLMObsExperimentation" enabled And new "AggregateLLMObsExperimentation" request And body with value {"data": {"attributes": {"aggregate": {"compute": [{"metric": "score_value", "name": "avg_faithfulness"}], "dataset_version": null, "group_by": [{"field": "span_id"}], "indexes": ["experiment-evals"], "limit": 1000, "search": {"query": "@experiment_id:3fd6b5e0-8910-4b1c-a7d0-5b84de329012"}, "time": {"from": 1705312200000, "to": 1705315800000}}}, "type": "experimentation"}} When the request is sent @@ -63,7 +68,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Aggregate LLM Observability experimentation returns "OK" response - Given operation "AggregateLLMObsExperimentation" enabled + Given a valid "appKeyAuth" key in the system + And operation "AggregateLLMObsExperimentation" enabled And new "AggregateLLMObsExperimentation" request And body with value {"data": {"attributes": {"aggregate": {"compute": [{"metric": "score_value", "name": "avg_faithfulness"}], "dataset_version": null, "group_by": [{"field": "span_id"}], "indexes": ["experiment-evals"], "limit": 1000, "search": {"query": "@experiment_id:3fd6b5e0-8910-4b1c-a7d0-5b84de329012"}, "time": {"from": 1705312200000, "to": 1705315800000}}}, "type": "experimentation"}} When the request is sent @@ -71,7 +77,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Append records to an LLM Observability dataset returns "Bad Request" response - Given operation "CreateLLMObsDatasetRecords" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsDatasetRecords" enabled And new "CreateLLMObsDatasetRecords" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -81,7 +88,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Append records to an LLM Observability dataset returns "Created" response - Given operation "CreateLLMObsDatasetRecords" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsDatasetRecords" enabled And new "CreateLLMObsDatasetRecords" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -91,7 +99,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Append records to an LLM Observability dataset returns "Not Found" response - Given operation "CreateLLMObsDatasetRecords" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsDatasetRecords" enabled And new "CreateLLMObsDatasetRecords" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -101,7 +110,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Append records to an LLM Observability dataset returns "OK" response - Given operation "CreateLLMObsDatasetRecords" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsDatasetRecords" enabled And new "CreateLLMObsDatasetRecords" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -111,7 +121,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Batch update LLM Observability dataset records returns "Bad Request" response - Given operation "BatchUpdateLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "BatchUpdateLLMObsDataset" enabled And new "BatchUpdateLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -121,7 +132,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Batch update LLM Observability dataset records returns "Not Found" response - Given operation "BatchUpdateLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "BatchUpdateLLMObsDataset" enabled And new "BatchUpdateLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -131,7 +143,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Batch update LLM Observability dataset records returns "OK" response - Given operation "BatchUpdateLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "BatchUpdateLLMObsDataset" enabled And new "BatchUpdateLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -141,7 +154,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Batch update LLM Observability dataset records returns "Payload Too Large" response - Given operation "BatchUpdateLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "BatchUpdateLLMObsDataset" enabled And new "BatchUpdateLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -151,7 +165,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Clone an LLM Observability dataset returns "Bad Request" response - Given operation "CloneLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "CloneLLMObsDataset" enabled And new "CloneLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -161,7 +176,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Clone an LLM Observability dataset returns "Not Found" response - Given operation "CloneLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "CloneLLMObsDataset" enabled And new "CloneLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -171,7 +187,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Clone an LLM Observability dataset returns "OK" response - Given operation "CloneLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "CloneLLMObsDataset" enabled And new "CloneLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -179,9 +196,54 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @skip @team:DataDog/ml-observability + Scenario: Create a new LLM Observability prompt version returns "Bad Request" response + Given there is a valid "prompt" in the system + And a valid "appKeyAuth" key in the system + And operation "CreateLLMObsPromptVersion" enabled + And new "CreateLLMObsPromptVersion" request + And request contains "prompt_id" parameter from "prompt.data.attributes.prompt_id" + And body with value {} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/ml-observability + Scenario: Create a new LLM Observability prompt version returns "Conflict" response + Given there is a valid "prompt" in the system + And there is a valid "prompt_version" in the system + And a valid "appKeyAuth" key in the system + And operation "CreateLLMObsPromptVersion" enabled + And new "CreateLLMObsPromptVersion" request + And request contains "prompt_id" parameter from "prompt.data.attributes.prompt_id" + And body with value {"data": {"attributes": {"env_ids": [], "labels": [], "template": [{"content": "Hello v2", "role": "user"}]}, "type": "prompt-template-versions"}} + When the request is sent + Then the response status is 409 Conflict + + @skip @team:DataDog/ml-observability + Scenario: Create a new LLM Observability prompt version returns "Not Found" response + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsPromptVersion" enabled + And new "CreateLLMObsPromptVersion" request + And request contains "prompt_id" parameter with value "nonexistent-prompt" + And body with value {"data": {"attributes": {"env_ids": [], "labels": [], "template": [{"content": "Hello v2", "role": "user"}]}, "type": "prompt-template-versions"}} + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/ml-observability + Scenario: Create a new LLM Observability prompt version returns "OK" response + Given there is a valid "prompt" in the system + And a valid "appKeyAuth" key in the system + And operation "CreateLLMObsPromptVersion" enabled + And new "CreateLLMObsPromptVersion" request + And request contains "prompt_id" parameter from "prompt.data.attributes.prompt_id" + And body with value {"data": {"attributes": {"env_ids": [], "labels": [], "template": "Hello v3"}, "type": "prompt-template-versions"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability annotation queue returns "Bad Request" response - Given operation "CreateLLMObsAnnotationQueue" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsAnnotationQueue" enabled And new "CreateLLMObsAnnotationQueue" request And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "abc-123", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}, "description": "Queue for annotating customer support traces", "name": "My annotation queue", "project_id": "00000000-0000-0000-0000-000000000002"}, "type": "queues"}} When the request is sent @@ -189,7 +251,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability annotation queue returns "Created" response - Given operation "CreateLLMObsAnnotationQueue" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsAnnotationQueue" enabled And new "CreateLLMObsAnnotationQueue" request And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "abc-123", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}, "description": "Queue for annotating customer support traces", "name": "My annotation queue", "project_id": "00000000-0000-0000-0000-000000000002"}, "type": "queues"}} When the request is sent @@ -197,7 +260,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability dataset returns "Bad Request" response - Given operation "CreateLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsDataset" enabled And new "CreateLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "My LLM Dataset"}, "type": "datasets"}} @@ -206,7 +270,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability dataset returns "Created" response - Given operation "CreateLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsDataset" enabled And new "CreateLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "My LLM Dataset"}, "type": "datasets"}} @@ -215,7 +280,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability dataset returns "Not Found" response - Given operation "CreateLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsDataset" enabled And new "CreateLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "My LLM Dataset"}, "type": "datasets"}} @@ -224,7 +290,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability dataset returns "OK" response - Given operation "CreateLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsDataset" enabled And new "CreateLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "My LLM Dataset"}, "type": "datasets"}} @@ -233,7 +300,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability experiment returns "Bad Request" response - Given operation "CreateLLMObsExperiment" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsExperiment" enabled And new "CreateLLMObsExperiment" request And body with value {"data": {"attributes": {"dataset_id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "name": "My Experiment v1", "parent_experiment_id": "3fd6b5e0-8910-4b1c-a7d0-5b84de329012", "project_id": "a33671aa-24fd-4dcd-9b33-a8ec7dde7751"}, "type": "experiments"}} When the request is sent @@ -241,7 +309,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability experiment returns "Created" response - Given operation "CreateLLMObsExperiment" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsExperiment" enabled And new "CreateLLMObsExperiment" request And body with value {"data": {"attributes": {"dataset_id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "name": "My Experiment v1", "parent_experiment_id": "3fd6b5e0-8910-4b1c-a7d0-5b84de329012", "project_id": "a33671aa-24fd-4dcd-9b33-a8ec7dde7751"}, "type": "experiments"}} When the request is sent @@ -249,7 +318,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability experiment returns "OK" response - Given operation "CreateLLMObsExperiment" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsExperiment" enabled And new "CreateLLMObsExperiment" request And body with value {"data": {"attributes": {"dataset_id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "name": "My Experiment v1", "parent_experiment_id": "3fd6b5e0-8910-4b1c-a7d0-5b84de329012", "project_id": "a33671aa-24fd-4dcd-9b33-a8ec7dde7751"}, "type": "experiments"}} When the request is sent @@ -257,7 +327,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability project returns "Bad Request" response - Given operation "CreateLLMObsProject" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsProject" enabled And new "CreateLLMObsProject" request And body with value {"data": {"attributes": {"name": "My LLM Project"}, "type": "projects"}} When the request is sent @@ -265,7 +336,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability project returns "Created" response - Given operation "CreateLLMObsProject" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsProject" enabled And new "CreateLLMObsProject" request And body with value {"data": {"attributes": {"name": "My LLM Project"}, "type": "projects"}} When the request is sent @@ -273,15 +345,45 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability project returns "OK" response - Given operation "CreateLLMObsProject" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsProject" enabled And new "CreateLLMObsProject" request And body with value {"data": {"attributes": {"name": "My LLM Project"}, "type": "projects"}} When the request is sent Then the response status is 200 OK + @skip @team:DataDog/ml-observability + Scenario: Create an LLM Observability prompt returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsPrompt" enabled + And new "CreateLLMObsPrompt" request + And body with value {} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/ml-observability + Scenario: Create an LLM Observability prompt returns "Conflict" response + Given there is a valid "prompt" in the system + And a valid "appKeyAuth" key in the system + And operation "CreateLLMObsPrompt" enabled + And new "CreateLLMObsPrompt" request + And body with value {"data": {"attributes": {"env_ids": [], "labels": [], "prompt_id": "{{ prompt.data.attributes.prompt_id }}", "template": [{"content": "Hello", "role": "user"}]}, "type": "prompt-templates"}} + When the request is sent + Then the response status is 409 Conflict + + @skip @team:DataDog/ml-observability + Scenario: Create an LLM Observability prompt returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsPrompt" enabled + And new "CreateLLMObsPrompt" request + And body with value {"data": {"attributes": {"env_ids": [], "labels": [], "prompt_id": "{{ unique }}", "template": "Hello"}, "type": "prompt-templates"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Create or update a custom evaluator configuration returns "Bad Request" response - Given operation "UpdateLLMObsCustomEvalConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsCustomEvalConfig" enabled And new "UpdateLLMObsCustomEvalConfig" request And request contains "eval_name" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"category": "Custom", "eval_name": "my-custom-evaluator", "llm_judge_config": {"assessment_criteria": {"max_threshold": 1.0, "min_threshold": 0.7, "pass_values": ["pass", "yes"], "pass_when": true}, "inference_params": {"frequency_penalty": 0.0, "max_tokens": 1024, "presence_penalty": 0.0, "temperature": 0.7, "top_k": 50, "top_p": 1.0}, "last_used_library_prompt_template_name": "sentiment-analysis-v1", "modified_library_prompt_template": false, "output_schema": null, "parsing_type": "structured_output", "prompt_template": [{"content": "Rate the quality of the following response:", "contents": [{"type": "text", "value": {"text": "What is the sentiment of this review?", "tool_call": {"arguments": "{\"location\": \"San Francisco\"}", "id": "call_abc123", "name": "get_weather", "type": "function"}, "tool_call_result": {"name": "get_weather", "result": "sunny, 72F", "tool_id": "call_abc123", "type": "function"}}}], "role": "user"}]}, "llm_provider": {"bedrock": {"region": "us-east-1"}, "integration_account_id": "my-account-id", "integration_provider": "openai", "model_name": "gpt-4o", "vertex_ai": {"location": "us-central1", "project": "my-gcp-project"}}, "target": {"application_name": "my-llm-app", "enabled": true, "eval_scope": "span", "filter": "@service:my-service", "root_spans_only": true, "sampling_percentage": 50.0}}, "id": "my-custom-evaluator", "type": "evaluator_config"}} @@ -290,7 +392,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create or update a custom evaluator configuration returns "Not Found" response - Given operation "UpdateLLMObsCustomEvalConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsCustomEvalConfig" enabled And new "UpdateLLMObsCustomEvalConfig" request And request contains "eval_name" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"category": "Custom", "eval_name": "my-custom-evaluator", "llm_judge_config": {"assessment_criteria": {"max_threshold": 1.0, "min_threshold": 0.7, "pass_values": ["pass", "yes"], "pass_when": true}, "inference_params": {"frequency_penalty": 0.0, "max_tokens": 1024, "presence_penalty": 0.0, "temperature": 0.7, "top_k": 50, "top_p": 1.0}, "last_used_library_prompt_template_name": "sentiment-analysis-v1", "modified_library_prompt_template": false, "output_schema": null, "parsing_type": "structured_output", "prompt_template": [{"content": "Rate the quality of the following response:", "contents": [{"type": "text", "value": {"text": "What is the sentiment of this review?", "tool_call": {"arguments": "{\"location\": \"San Francisco\"}", "id": "call_abc123", "name": "get_weather", "type": "function"}, "tool_call_result": {"name": "get_weather", "result": "sunny, 72F", "tool_id": "call_abc123", "type": "function"}}}], "role": "user"}]}, "llm_provider": {"bedrock": {"region": "us-east-1"}, "integration_account_id": "my-account-id", "integration_provider": "openai", "model_name": "gpt-4o", "vertex_ai": {"location": "us-central1", "project": "my-gcp-project"}}, "target": {"application_name": "my-llm-app", "enabled": true, "eval_scope": "span", "filter": "@service:my-service", "root_spans_only": true, "sampling_percentage": 50.0}}, "id": "my-custom-evaluator", "type": "evaluator_config"}} @@ -299,7 +402,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create or update a custom evaluator configuration returns "OK" response - Given operation "UpdateLLMObsCustomEvalConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsCustomEvalConfig" enabled And new "UpdateLLMObsCustomEvalConfig" request And request contains "eval_name" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"category": "Custom", "eval_name": "my-custom-evaluator", "llm_judge_config": {"assessment_criteria": {"max_threshold": 1.0, "min_threshold": 0.7, "pass_values": ["pass", "yes"], "pass_when": true}, "inference_params": {"frequency_penalty": 0.0, "max_tokens": 1024, "presence_penalty": 0.0, "temperature": 0.7, "top_k": 50, "top_p": 1.0}, "last_used_library_prompt_template_name": "sentiment-analysis-v1", "modified_library_prompt_template": false, "output_schema": null, "parsing_type": "structured_output", "prompt_template": [{"content": "Rate the quality of the following response:", "contents": [{"type": "text", "value": {"text": "What is the sentiment of this review?", "tool_call": {"arguments": "{\"location\": \"San Francisco\"}", "id": "call_abc123", "name": "get_weather", "type": "function"}, "tool_call_result": {"name": "get_weather", "result": "sunny, 72F", "tool_id": "call_abc123", "type": "function"}}}], "role": "user"}]}, "llm_provider": {"bedrock": {"region": "us-east-1"}, "integration_account_id": "my-account-id", "integration_provider": "openai", "model_name": "gpt-4o", "vertex_ai": {"location": "us-central1", "project": "my-gcp-project"}}, "target": {"application_name": "my-llm-app", "enabled": true, "eval_scope": "span", "filter": "@service:my-service", "root_spans_only": true, "sampling_percentage": 50.0}}, "id": "my-custom-evaluator", "type": "evaluator_config"}} @@ -308,7 +412,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create or update a custom evaluator configuration returns "Unprocessable Entity" response - Given operation "UpdateLLMObsCustomEvalConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsCustomEvalConfig" enabled And new "UpdateLLMObsCustomEvalConfig" request And request contains "eval_name" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"category": "Custom", "eval_name": "my-custom-evaluator", "llm_judge_config": {"assessment_criteria": {"max_threshold": 1.0, "min_threshold": 0.7, "pass_values": ["pass", "yes"], "pass_when": true}, "inference_params": {"frequency_penalty": 0.0, "max_tokens": 1024, "presence_penalty": 0.0, "temperature": 0.7, "top_k": 50, "top_p": 1.0}, "last_used_library_prompt_template_name": "sentiment-analysis-v1", "modified_library_prompt_template": false, "output_schema": null, "parsing_type": "structured_output", "prompt_template": [{"content": "Rate the quality of the following response:", "contents": [{"type": "text", "value": {"text": "What is the sentiment of this review?", "tool_call": {"arguments": "{\"location\": \"San Francisco\"}", "id": "call_abc123", "name": "get_weather", "type": "function"}, "tool_call_result": {"name": "get_weather", "result": "sunny, 72F", "tool_id": "call_abc123", "type": "function"}}}], "role": "user"}]}, "llm_provider": {"bedrock": {"region": "us-east-1"}, "integration_account_id": "my-account-id", "integration_provider": "openai", "model_name": "gpt-4o", "vertex_ai": {"location": "us-central1", "project": "my-gcp-project"}}, "target": {"application_name": "my-llm-app", "enabled": true, "eval_scope": "span", "filter": "@service:my-service", "root_spans_only": true, "sampling_percentage": 50.0}}, "id": "my-custom-evaluator", "type": "evaluator_config"}} @@ -317,7 +422,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create or update a patterns configuration returns "Bad Request" response - Given operation "UpsertLLMObsPatternsConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpsertLLMObsPatternsConfig" enabled And new "UpsertLLMObsPatternsConfig" request And body with value {"data": {"attributes": {"account_id": "1000000001", "config_id": "a7c8d9e0-1234-5678-9abc-def012345678", "evp_query": "@ml_app:support-bot", "hierarchy_depth": 2, "integration_provider": "openai", "model_name": "gpt-4o", "name": "Support chatbot topics", "num_records": 1000, "sampling_ratio": 0.1, "scope": "", "template": ""}, "type": "topic_discovery_configs"}} When the request is sent @@ -325,7 +431,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create or update a patterns configuration returns "Not Found" response - Given operation "UpsertLLMObsPatternsConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpsertLLMObsPatternsConfig" enabled And new "UpsertLLMObsPatternsConfig" request And body with value {"data": {"attributes": {"account_id": "1000000001", "config_id": "a7c8d9e0-1234-5678-9abc-def012345678", "evp_query": "@ml_app:support-bot", "hierarchy_depth": 2, "integration_provider": "openai", "model_name": "gpt-4o", "name": "Support chatbot topics", "num_records": 1000, "sampling_ratio": 0.1, "scope": "", "template": ""}, "type": "topic_discovery_configs"}} When the request is sent @@ -333,7 +440,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create or update a patterns configuration returns "OK" response - Given operation "UpsertLLMObsPatternsConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpsertLLMObsPatternsConfig" enabled And new "UpsertLLMObsPatternsConfig" request And body with value {"data": {"attributes": {"account_id": "1000000001", "config_id": "a7c8d9e0-1234-5678-9abc-def012345678", "evp_query": "@ml_app:support-bot", "hierarchy_depth": 2, "integration_provider": "openai", "model_name": "gpt-4o", "name": "Support chatbot topics", "num_records": 1000, "sampling_ratio": 0.1, "scope": "", "template": ""}, "type": "topic_discovery_configs"}} When the request is sent @@ -341,7 +449,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create or update annotations returns "Bad Request" response - Given operation "UpsertLLMObsAnnotations" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpsertLLMObsAnnotations" enabled And new "UpsertLLMObsAnnotations" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"annotations": [{"interaction_id": "00000000-0000-0000-0000-000000000001", "label_values": [{"label_schema_id": "abc-123", "value": "good"}, {"label_schema_id": "ef56gh78", "value": "positive"}]}]}, "type": "annotations"}} @@ -350,7 +459,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create or update annotations returns "Not Found — the queue does not exist." response - Given operation "UpsertLLMObsAnnotations" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpsertLLMObsAnnotations" enabled And new "UpsertLLMObsAnnotations" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"annotations": [{"interaction_id": "00000000-0000-0000-0000-000000000001", "label_values": [{"label_schema_id": "abc-123", "value": "good"}, {"label_schema_id": "ef56gh78", "value": "positive"}]}]}, "type": "annotations"}} @@ -359,7 +469,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Create or update annotations returns "OK — annotations created or updated. Per-item errors are listed in `errors`." response - Given operation "UpsertLLMObsAnnotations" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpsertLLMObsAnnotations" enabled And new "UpsertLLMObsAnnotations" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"annotations": [{"interaction_id": "00000000-0000-0000-0000-000000000001", "label_values": [{"label_schema_id": "abc-123", "value": "good"}, {"label_schema_id": "ef56gh78", "value": "positive"}]}]}, "type": "annotations"}} @@ -368,7 +479,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability data returns "Accepted" response - Given operation "DeleteLLMObsData" enabled + Given a valid "appKeyAuth" key in the system + And 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 @@ -376,7 +488,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability data returns "Bad Request" response - Given operation "DeleteLLMObsData" enabled + Given a valid "appKeyAuth" key in the system + And 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 @@ -384,7 +497,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability dataset records returns "Bad Request" response - Given operation "DeleteLLMObsDatasetRecords" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsDatasetRecords" enabled And new "DeleteLLMObsDatasetRecords" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -394,7 +508,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability dataset records returns "No Content" response - Given operation "DeleteLLMObsDatasetRecords" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsDatasetRecords" enabled And new "DeleteLLMObsDatasetRecords" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -404,7 +519,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability dataset records returns "Not Found" response - Given operation "DeleteLLMObsDatasetRecords" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsDatasetRecords" enabled And new "DeleteLLMObsDatasetRecords" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -414,7 +530,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability datasets returns "Bad Request" response - Given operation "DeleteLLMObsDatasets" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsDatasets" enabled And new "DeleteLLMObsDatasets" request And request contains "project_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"dataset_ids": ["9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d"]}, "type": "datasets"}} @@ -423,7 +540,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability datasets returns "No Content" response - Given operation "DeleteLLMObsDatasets" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsDatasets" enabled And new "DeleteLLMObsDatasets" request And request contains "project_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"dataset_ids": ["9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d"]}, "type": "datasets"}} @@ -432,7 +550,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability datasets returns "Not Found" response - Given operation "DeleteLLMObsDatasets" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsDatasets" enabled And new "DeleteLLMObsDatasets" request And request contains "project_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"dataset_ids": ["9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d"]}, "type": "datasets"}} @@ -441,7 +560,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability experiments returns "Bad Request" response - Given operation "DeleteLLMObsExperiments" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsExperiments" enabled And new "DeleteLLMObsExperiments" request And body with value {"data": {"attributes": {"experiment_ids": ["3fd6b5e0-8910-4b1c-a7d0-5b84de329012"]}, "type": "experiments"}} When the request is sent @@ -449,7 +569,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability experiments returns "No Content" response - Given operation "DeleteLLMObsExperiments" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsExperiments" enabled And new "DeleteLLMObsExperiments" request And body with value {"data": {"attributes": {"experiment_ids": ["3fd6b5e0-8910-4b1c-a7d0-5b84de329012"]}, "type": "experiments"}} When the request is sent @@ -457,7 +578,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability projects returns "Bad Request" response - Given operation "DeleteLLMObsProjects" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsProjects" enabled And new "DeleteLLMObsProjects" request And body with value {"data": {"attributes": {"project_ids": ["a33671aa-24fd-4dcd-9b33-a8ec7dde7751"]}, "type": "projects"}} When the request is sent @@ -465,7 +587,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability projects returns "No Content" response - Given operation "DeleteLLMObsProjects" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsProjects" enabled And new "DeleteLLMObsProjects" request And body with value {"data": {"attributes": {"project_ids": ["a33671aa-24fd-4dcd-9b33-a8ec7dde7751"]}, "type": "projects"}} When the request is sent @@ -473,7 +596,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete a custom evaluator configuration returns "Bad Request" response - Given operation "DeleteLLMObsCustomEvalConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsCustomEvalConfig" enabled And new "DeleteLLMObsCustomEvalConfig" request And request contains "eval_name" parameter from "REPLACE.ME" When the request is sent @@ -481,7 +605,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete a custom evaluator configuration returns "No Content" response - Given operation "DeleteLLMObsCustomEvalConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsCustomEvalConfig" enabled And new "DeleteLLMObsCustomEvalConfig" request And request contains "eval_name" parameter from "REPLACE.ME" When the request is sent @@ -489,7 +614,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete a custom evaluator configuration returns "Not Found" response - Given operation "DeleteLLMObsCustomEvalConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsCustomEvalConfig" enabled And new "DeleteLLMObsCustomEvalConfig" request And request contains "eval_name" parameter from "REPLACE.ME" When the request is sent @@ -497,7 +623,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete a patterns configuration returns "Bad Request" response - Given operation "DeleteLLMObsPatternsConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsPatternsConfig" enabled And new "DeleteLLMObsPatternsConfig" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent @@ -505,7 +632,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete a patterns configuration returns "No Content" response - Given operation "DeleteLLMObsPatternsConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsPatternsConfig" enabled And new "DeleteLLMObsPatternsConfig" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent @@ -513,7 +641,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete a patterns configuration returns "Not Found" response - Given operation "DeleteLLMObsPatternsConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsPatternsConfig" enabled And new "DeleteLLMObsPatternsConfig" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent @@ -521,7 +650,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete an LLM Observability annotation queue returns "No Content" response - Given operation "DeleteLLMObsAnnotationQueue" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsAnnotationQueue" enabled And new "DeleteLLMObsAnnotationQueue" request And request contains "queue_id" parameter from "REPLACE.ME" When the request is sent @@ -529,15 +659,36 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete an LLM Observability annotation queue returns "Not Found" response - Given operation "DeleteLLMObsAnnotationQueue" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsAnnotationQueue" enabled And new "DeleteLLMObsAnnotationQueue" request And request contains "queue_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found + @skip @team:DataDog/ml-observability + Scenario: Delete an LLM Observability prompt returns "Not Found" response + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsPrompt" enabled + And new "DeleteLLMObsPrompt" request + And request contains "prompt_id" parameter with value "nonexistent-prompt" + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/ml-observability + Scenario: Delete an LLM Observability prompt returns "OK" response + Given there is a valid "prompt" in the system + And a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsPrompt" enabled + And new "DeleteLLMObsPrompt" request + And request contains "prompt_id" parameter from "prompt.data.attributes.prompt_id" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Delete annotation queue interactions returns "Bad Request" response - Given operation "DeleteLLMObsAnnotationQueueInteractions" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsAnnotationQueueInteractions" enabled And new "DeleteLLMObsAnnotationQueueInteractions" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"interaction_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "interactions"}} @@ -546,7 +697,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete annotation queue interactions returns "No Content" response - Given operation "DeleteLLMObsAnnotationQueueInteractions" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsAnnotationQueueInteractions" enabled And new "DeleteLLMObsAnnotationQueueInteractions" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"interaction_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "interactions"}} @@ -555,7 +707,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete annotation queue interactions returns "Not Found" response - Given operation "DeleteLLMObsAnnotationQueueInteractions" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsAnnotationQueueInteractions" enabled And new "DeleteLLMObsAnnotationQueueInteractions" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"interaction_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "interactions"}} @@ -564,7 +717,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete annotations returns "Bad Request" response - Given operation "DeleteLLMObsAnnotations" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsAnnotations" enabled And new "DeleteLLMObsAnnotations" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"annotation_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "annotations"}} @@ -573,7 +727,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete annotations returns "Not Found — the queue does not exist." response - Given operation "DeleteLLMObsAnnotations" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsAnnotations" enabled And new "DeleteLLMObsAnnotations" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"annotation_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "annotations"}} @@ -582,7 +737,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Delete annotations returns "OK — annotations deleted. Errors for annotations that could not be deleted are listed in `errors`." response - Given operation "DeleteLLMObsAnnotations" enabled + Given a valid "appKeyAuth" key in the system + And operation "DeleteLLMObsAnnotations" enabled And new "DeleteLLMObsAnnotations" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"annotation_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "annotations"}} @@ -591,7 +747,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Export an LLM Observability dataset returns "Bad Request" response - Given operation "ExportLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "ExportLLMObsDataset" enabled And new "ExportLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -600,7 +757,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Export an LLM Observability dataset returns "Not Found" response - Given operation "ExportLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "ExportLLMObsDataset" enabled And new "ExportLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -609,7 +767,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Export an LLM Observability dataset returns "OK" response - Given operation "ExportLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "ExportLLMObsDataset" enabled And new "ExportLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -618,7 +777,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get LLM Observability dataset draft state returns "Bad Request" response - Given operation "GetLLMObsDatasetDraftState" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsDatasetDraftState" enabled And new "GetLLMObsDatasetDraftState" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -627,7 +787,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get LLM Observability dataset draft state returns "Not Found" response - Given operation "GetLLMObsDatasetDraftState" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsDatasetDraftState" enabled And new "GetLLMObsDatasetDraftState" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -636,7 +797,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get LLM Observability dataset draft state returns "OK" response - Given operation "GetLLMObsDatasetDraftState" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsDatasetDraftState" enabled And new "GetLLMObsDatasetDraftState" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -645,7 +807,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get a custom evaluator configuration returns "Bad Request" response - Given operation "GetLLMObsCustomEvalConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsCustomEvalConfig" enabled And new "GetLLMObsCustomEvalConfig" request And request contains "eval_name" parameter from "REPLACE.ME" When the request is sent @@ -653,7 +816,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get a custom evaluator configuration returns "Not Found" response - Given operation "GetLLMObsCustomEvalConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsCustomEvalConfig" enabled And new "GetLLMObsCustomEvalConfig" request And request contains "eval_name" parameter from "REPLACE.ME" When the request is sent @@ -661,7 +825,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get a custom evaluator configuration returns "OK" response - Given operation "GetLLMObsCustomEvalConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsCustomEvalConfig" enabled And new "GetLLMObsCustomEvalConfig" request And request contains "eval_name" parameter from "REPLACE.ME" When the request is sent @@ -669,28 +834,80 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get a patterns configuration returns "Bad Request" response - Given operation "GetLLMObsPatternsConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsPatternsConfig" enabled And new "GetLLMObsPatternsConfig" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ml-observability Scenario: Get a patterns configuration returns "Not Found" response - Given operation "GetLLMObsPatternsConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsPatternsConfig" enabled And new "GetLLMObsPatternsConfig" request When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/ml-observability Scenario: Get a patterns configuration returns "OK" response - Given operation "GetLLMObsPatternsConfig" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsPatternsConfig" enabled And new "GetLLMObsPatternsConfig" request When the request is sent Then the response status is 200 OK + @skip @team:DataDog/ml-observability + Scenario: Get a specific LLM Observability prompt version returns "Bad Request" response + Given there is a valid "prompt" in the system + And there is a valid "prompt_version" in the system + And operation "GetLLMObsPromptVersion" enabled + And new "GetLLMObsPromptVersion" request + And request contains "prompt_id" parameter from "prompt.data.attributes.prompt_id" + And request contains "version" parameter with value "not-a-number" + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/ml-observability + Scenario: Get a specific LLM Observability prompt version returns "Not Found" response + Given operation "GetLLMObsPromptVersion" enabled + And new "GetLLMObsPromptVersion" request + And request contains "prompt_id" parameter with value "nonexistent-prompt" + And request contains "version" parameter with value "1" + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/ml-observability + Scenario: Get a specific LLM Observability prompt version returns "OK" response + Given there is a valid "prompt" in the system + And there is a valid "prompt_version" in the system + And operation "GetLLMObsPromptVersion" enabled + And new "GetLLMObsPromptVersion" request + And request contains "prompt_id" parameter from "prompt.data.attributes.prompt_id" + And request contains "version" parameter from "prompt_version.data.attributes.version" + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/ml-observability + Scenario: Get an LLM Observability prompt returns "Not Found" response + Given operation "GetLLMObsPrompt" enabled + And new "GetLLMObsPrompt" request + And request contains "prompt_id" parameter with value "nonexistent-prompt" + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/ml-observability + Scenario: Get an LLM Observability prompt returns "OK" response + Given there is a valid "prompt" in the system + And operation "GetLLMObsPrompt" enabled + And new "GetLLMObsPrompt" request + And request contains "prompt_id" parameter from "prompt.data.attributes.prompt_id" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Get annotated interactions by content IDs returns "Bad Request" response - Given operation "GetLLMObsAnnotatedInteractionsByTraceIDs" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsAnnotatedInteractionsByTraceIDs" enabled And new "GetLLMObsAnnotatedInteractionsByTraceIDs" request And request contains "contentIds" parameter from "REPLACE.ME" When the request is sent @@ -698,7 +915,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get annotated interactions by content IDs returns "OK" response - Given operation "GetLLMObsAnnotatedInteractionsByTraceIDs" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsAnnotatedInteractionsByTraceIDs" enabled And new "GetLLMObsAnnotatedInteractionsByTraceIDs" request And request contains "contentIds" parameter from "REPLACE.ME" When the request is sent @@ -706,7 +924,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get annotated queue interactions returns "Bad Request" response - Given operation "GetLLMObsAnnotatedInteractions" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsAnnotatedInteractions" enabled And new "GetLLMObsAnnotatedInteractions" request And request contains "queue_id" parameter from "REPLACE.ME" When the request is sent @@ -714,7 +933,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get annotated queue interactions returns "Not Found" response - Given operation "GetLLMObsAnnotatedInteractions" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsAnnotatedInteractions" enabled And new "GetLLMObsAnnotatedInteractions" request And request contains "queue_id" parameter from "REPLACE.ME" When the request is sent @@ -722,7 +942,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get annotated queue interactions returns "OK" response - Given operation "GetLLMObsAnnotatedInteractions" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsAnnotatedInteractions" enabled And new "GetLLMObsAnnotatedInteractions" request And request contains "queue_id" parameter from "REPLACE.ME" When the request is sent @@ -730,7 +951,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get annotation queue label schema returns "Not Found" response - Given operation "GetLLMObsAnnotationQueueLabelSchema" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsAnnotationQueueLabelSchema" enabled And new "GetLLMObsAnnotationQueueLabelSchema" request And request contains "queue_id" parameter from "REPLACE.ME" When the request is sent @@ -738,7 +960,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get annotation queue label schema returns "OK" response - Given operation "GetLLMObsAnnotationQueueLabelSchema" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsAnnotationQueueLabelSchema" enabled And new "GetLLMObsAnnotationQueueLabelSchema" request And request contains "queue_id" parameter from "REPLACE.ME" When the request is sent @@ -746,7 +969,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get patterns run status returns "Bad Request" response - Given operation "GetLLMObsPatternsRunStatus" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsPatternsRunStatus" enabled And new "GetLLMObsPatternsRunStatus" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent @@ -754,7 +978,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get patterns run status returns "Not Found" response - Given operation "GetLLMObsPatternsRunStatus" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsPatternsRunStatus" enabled And new "GetLLMObsPatternsRunStatus" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent @@ -762,7 +987,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Get patterns run status returns "OK" response - Given operation "GetLLMObsPatternsRunStatus" enabled + Given a valid "appKeyAuth" key in the system + And operation "GetLLMObsPatternsRunStatus" enabled And new "GetLLMObsPatternsRunStatus" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent @@ -770,21 +996,24 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability annotation queues returns "Bad Request" response - Given operation "ListLLMObsAnnotationQueues" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsAnnotationQueues" enabled And new "ListLLMObsAnnotationQueues" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability annotation queues returns "OK" response - Given operation "ListLLMObsAnnotationQueues" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsAnnotationQueues" enabled And new "ListLLMObsAnnotationQueues" request When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability dataset records returns "Bad Request" response - Given operation "ListLLMObsDatasetRecords" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsDatasetRecords" enabled And new "ListLLMObsDatasetRecords" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -793,7 +1022,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability dataset records returns "Not Found" response - Given operation "ListLLMObsDatasetRecords" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsDatasetRecords" enabled And new "ListLLMObsDatasetRecords" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -802,7 +1032,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability dataset records returns "OK" response - Given operation "ListLLMObsDatasetRecords" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsDatasetRecords" enabled And new "ListLLMObsDatasetRecords" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -811,7 +1042,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability dataset versions returns "Bad Request" response - Given operation "ListLLMObsDatasetVersions" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsDatasetVersions" enabled And new "ListLLMObsDatasetVersions" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -820,7 +1052,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability dataset versions returns "Not Found" response - Given operation "ListLLMObsDatasetVersions" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsDatasetVersions" enabled And new "ListLLMObsDatasetVersions" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -829,7 +1062,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability dataset versions returns "OK" response - Given operation "ListLLMObsDatasetVersions" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsDatasetVersions" enabled And new "ListLLMObsDatasetVersions" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -838,7 +1072,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability datasets returns "Bad Request" response - Given operation "ListLLMObsDatasets" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsDatasets" enabled And new "ListLLMObsDatasets" request And request contains "project_id" parameter from "REPLACE.ME" When the request is sent @@ -846,7 +1081,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability datasets returns "Not Found" response - Given operation "ListLLMObsDatasets" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsDatasets" enabled And new "ListLLMObsDatasets" request And request contains "project_id" parameter from "REPLACE.ME" When the request is sent @@ -854,7 +1090,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability datasets returns "OK" response - Given operation "ListLLMObsDatasets" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsDatasets" enabled And new "ListLLMObsDatasets" request And request contains "project_id" parameter from "REPLACE.ME" When the request is sent @@ -862,7 +1099,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability experiment events (v2) returns "Bad Request" response - Given operation "ListLLMObsExperimentEventsV2" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsExperimentEventsV2" enabled And new "ListLLMObsExperimentEventsV2" request And request contains "experiment_id" parameter from "REPLACE.ME" When the request is sent @@ -870,7 +1108,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability experiment events (v2) returns "Not Found" response - Given operation "ListLLMObsExperimentEventsV2" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsExperimentEventsV2" enabled And new "ListLLMObsExperimentEventsV2" request And request contains "experiment_id" parameter from "REPLACE.ME" When the request is sent @@ -878,7 +1117,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability experiment events (v2) returns "OK" response - Given operation "ListLLMObsExperimentEventsV2" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsExperimentEventsV2" enabled And new "ListLLMObsExperimentEventsV2" request And request contains "experiment_id" parameter from "REPLACE.ME" When the request is sent @@ -886,7 +1126,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability experiment spans (v1) returns "Bad Request" response - Given operation "ListLLMObsExperimentEventsV1" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsExperimentEventsV1" enabled And new "ListLLMObsExperimentEventsV1" request And request contains "experiment_id" parameter from "REPLACE.ME" When the request is sent @@ -894,7 +1135,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability experiment spans (v1) returns "Not Found" response - Given operation "ListLLMObsExperimentEventsV1" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsExperimentEventsV1" enabled And new "ListLLMObsExperimentEventsV1" request And request contains "experiment_id" parameter from "REPLACE.ME" When the request is sent @@ -902,7 +1144,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability experiment spans (v1) returns "OK" response - Given operation "ListLLMObsExperimentEventsV1" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsExperimentEventsV1" enabled And new "ListLLMObsExperimentEventsV1" request And request contains "experiment_id" parameter from "REPLACE.ME" When the request is sent @@ -910,49 +1153,72 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability experiments returns "Bad Request" response - Given operation "ListLLMObsExperiments" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsExperiments" enabled And new "ListLLMObsExperiments" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability experiments returns "OK" response - Given operation "ListLLMObsExperiments" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsExperiments" enabled And new "ListLLMObsExperiments" request When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability projects returns "Bad Request" response - Given operation "ListLLMObsProjects" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsProjects" enabled And new "ListLLMObsProjects" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability projects returns "OK" response - Given operation "ListLLMObsProjects" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsProjects" enabled And new "ListLLMObsProjects" request When the request is sent Then the response status is 200 OK + @skip @team:DataDog/ml-observability + Scenario: List LLM Observability prompts returns "Bad Request" response + Given operation "ListLLMObsPrompts" enabled + And new "ListLLMObsPrompts" request + And request contains "filter[ml_app]" parameter with value "" + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/ml-observability + Scenario: List LLM Observability prompts returns "OK" response + Given there is a valid "prompt" in the system + And operation "ListLLMObsPrompts" enabled + And new "ListLLMObsPrompts" request + 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 + Given a valid "appKeyAuth" key in the system + And 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 + Given a valid "appKeyAuth" key in the system + And 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 LLM integration accounts returns "Bad Request" response - Given operation "ListLLMObsIntegrationAccounts" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsIntegrationAccounts" enabled And new "ListLLMObsIntegrationAccounts" request And request contains "integration" parameter from "REPLACE.ME" When the request is sent @@ -960,7 +1226,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM integration accounts returns "OK" response - Given operation "ListLLMObsIntegrationAccounts" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsIntegrationAccounts" enabled And new "ListLLMObsIntegrationAccounts" request And request contains "integration" parameter from "REPLACE.ME" When the request is sent @@ -968,7 +1235,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM integration models returns "Bad Request" response - Given operation "ListLLMObsIntegrationModels" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsIntegrationModels" enabled And new "ListLLMObsIntegrationModels" request And request contains "integration" parameter from "REPLACE.ME" And request contains "account_id" parameter from "REPLACE.ME" @@ -977,7 +1245,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List LLM integration models returns "OK" response - Given operation "ListLLMObsIntegrationModels" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsIntegrationModels" enabled And new "ListLLMObsIntegrationModels" request And request contains "integration" parameter from "REPLACE.ME" And request contains "account_id" parameter from "REPLACE.ME" @@ -986,7 +1255,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List events for an LLM Observability experiment returns "Bad Request" response - Given operation "ListLLMObsExperimentEvents" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsExperimentEvents" enabled And new "ListLLMObsExperimentEvents" request And request contains "experiment_id" parameter from "REPLACE.ME" When the request is sent @@ -994,7 +1264,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List events for an LLM Observability experiment returns "Not Found" response - Given operation "ListLLMObsExperimentEvents" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsExperimentEvents" enabled And new "ListLLMObsExperimentEvents" request And request contains "experiment_id" parameter from "REPLACE.ME" When the request is sent @@ -1002,7 +1273,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List events for an LLM Observability experiment returns "OK" response - Given operation "ListLLMObsExperimentEvents" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsExperimentEvents" enabled And new "ListLLMObsExperimentEvents" request And request contains "experiment_id" parameter from "REPLACE.ME" When the request is sent @@ -1010,7 +1282,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List patterns clustered points returns "Bad Request" response - Given operation "ListLLMObsPatternsClusteredPoints" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsPatternsClusteredPoints" enabled And new "ListLLMObsPatternsClusteredPoints" request And request contains "topic_id" parameter from "REPLACE.ME" When the request is sent @@ -1018,7 +1291,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List patterns clustered points returns "Not Found" response - Given operation "ListLLMObsPatternsClusteredPoints" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsPatternsClusteredPoints" enabled And new "ListLLMObsPatternsClusteredPoints" request And request contains "topic_id" parameter from "REPLACE.ME" When the request is sent @@ -1026,7 +1300,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List patterns clustered points returns "OK" response - Given operation "ListLLMObsPatternsClusteredPoints" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsPatternsClusteredPoints" enabled And new "ListLLMObsPatternsClusteredPoints" request And request contains "topic_id" parameter from "REPLACE.ME" When the request is sent @@ -1034,21 +1309,24 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List patterns configurations returns "Bad Request" response - Given operation "ListLLMObsPatternsConfigs" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsPatternsConfigs" enabled And new "ListLLMObsPatternsConfigs" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ml-observability Scenario: List patterns configurations returns "OK" response - Given operation "ListLLMObsPatternsConfigs" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsPatternsConfigs" enabled And new "ListLLMObsPatternsConfigs" request When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/ml-observability Scenario: List patterns runs returns "Bad Request" response - Given operation "ListLLMObsPatternsRuns" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsPatternsRuns" enabled And new "ListLLMObsPatternsRuns" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent @@ -1056,7 +1334,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List patterns runs returns "Not Found" response - Given operation "ListLLMObsPatternsRuns" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsPatternsRuns" enabled And new "ListLLMObsPatternsRuns" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent @@ -1064,7 +1343,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List patterns runs returns "OK" response - Given operation "ListLLMObsPatternsRuns" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsPatternsRuns" enabled And new "ListLLMObsPatternsRuns" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent @@ -1072,7 +1352,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List patterns topics returns "Bad Request" response - Given operation "ListLLMObsPatternsTopics" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsPatternsTopics" enabled And new "ListLLMObsPatternsTopics" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent @@ -1080,7 +1361,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List patterns topics returns "Not Found" response - Given operation "ListLLMObsPatternsTopics" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsPatternsTopics" enabled And new "ListLLMObsPatternsTopics" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent @@ -1088,7 +1370,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List patterns topics returns "OK" response - Given operation "ListLLMObsPatternsTopics" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsPatternsTopics" enabled And new "ListLLMObsPatternsTopics" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent @@ -1096,7 +1379,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List patterns topics with clustered points returns "Bad Request" response - Given operation "ListLLMObsPatternsTopicsWithClusteredPoints" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsPatternsTopicsWithClusteredPoints" enabled And new "ListLLMObsPatternsTopicsWithClusteredPoints" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent @@ -1104,7 +1388,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List patterns topics with clustered points returns "Not Found" response - Given operation "ListLLMObsPatternsTopicsWithClusteredPoints" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsPatternsTopicsWithClusteredPoints" enabled And new "ListLLMObsPatternsTopicsWithClusteredPoints" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent @@ -1112,15 +1397,26 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: List patterns topics with clustered points returns "OK" response - Given operation "ListLLMObsPatternsTopicsWithClusteredPoints" enabled + Given a valid "appKeyAuth" key in the system + And operation "ListLLMObsPatternsTopicsWithClusteredPoints" enabled And new "ListLLMObsPatternsTopicsWithClusteredPoints" request And request contains "config_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 200 OK + @skip @team:DataDog/ml-observability + Scenario: List versions of an LLM Observability prompt returns "OK" response + Given there is a valid "prompt" in the system + And operation "ListLLMObsPromptVersions" enabled + And new "ListLLMObsPromptVersions" request + And request contains "prompt_id" parameter from "prompt.data.attributes.prompt_id" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Lock LLM Observability dataset draft state returns "Bad Request" response - Given operation "LockLLMObsDatasetDraftState" enabled + Given a valid "appKeyAuth" key in the system + And operation "LockLLMObsDatasetDraftState" enabled And new "LockLLMObsDatasetDraftState" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1129,7 +1425,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Lock LLM Observability dataset draft state returns "Not Found" response - Given operation "LockLLMObsDatasetDraftState" enabled + Given a valid "appKeyAuth" key in the system + And operation "LockLLMObsDatasetDraftState" enabled And new "LockLLMObsDatasetDraftState" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1138,7 +1435,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Lock LLM Observability dataset draft state returns "OK" response - Given operation "LockLLMObsDatasetDraftState" enabled + Given a valid "appKeyAuth" key in the system + And operation "LockLLMObsDatasetDraftState" enabled And new "LockLLMObsDatasetDraftState" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1147,7 +1445,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Push events for an LLM Observability experiment returns "Accepted" response - Given operation "CreateLLMObsExperimentEvents" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsExperimentEvents" enabled And new "CreateLLMObsExperimentEvents" request And request contains "experiment_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"metrics": [{"assessment": "pass", "error": {}, "label": "faithfulness", "metric_type": "score", "span_id": "span-7a1b2c3d", "tags": [], "timestamp_ms": 1705314600000}], "spans": [{"dataset_id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "duration": 1500000000, "meta": {"error": {"message": "Model response timed out", "stack": "Traceback (most recent call last):\n File \"main.py\", line 10, in \n response = model.generate(input)\n File \"model.py\", line 45, in generate\n raise TimeoutError(\"Model response timed out\")\nTimeoutError: Model response timed out", "type": "TimeoutError"}, "input": null, "output": null}, "name": "llm_call", "project_id": "a33671aa-24fd-4dcd-9b33-a8ec7dde7751", "span_id": "span-7a1b2c3d", "start_ns": 1705314600000000000, "status": "ok", "tags": [], "trace_id": "abc123def456"}]}, "type": "events"}} @@ -1156,7 +1455,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Push events for an LLM Observability experiment returns "Bad Request" response - Given operation "CreateLLMObsExperimentEvents" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsExperimentEvents" enabled And new "CreateLLMObsExperimentEvents" request And request contains "experiment_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"metrics": [{"assessment": "pass", "error": {}, "label": "faithfulness", "metric_type": "score", "span_id": "span-7a1b2c3d", "tags": [], "timestamp_ms": 1705314600000}], "spans": [{"dataset_id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "duration": 1500000000, "meta": {"error": {"message": "Model response timed out", "stack": "Traceback (most recent call last):\n File \"main.py\", line 10, in \n response = model.generate(input)\n File \"model.py\", line 45, in generate\n raise TimeoutError(\"Model response timed out\")\nTimeoutError: Model response timed out", "type": "TimeoutError"}, "input": null, "output": null}, "name": "llm_call", "project_id": "a33671aa-24fd-4dcd-9b33-a8ec7dde7751", "span_id": "span-7a1b2c3d", "start_ns": 1705314600000000000, "status": "ok", "tags": [], "trace_id": "abc123def456"}]}, "type": "events"}} @@ -1165,7 +1465,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Push events for an LLM Observability experiment returns "Not Found" response - Given operation "CreateLLMObsExperimentEvents" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsExperimentEvents" enabled And new "CreateLLMObsExperimentEvents" request And request contains "experiment_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"metrics": [{"assessment": "pass", "error": {}, "label": "faithfulness", "metric_type": "score", "span_id": "span-7a1b2c3d", "tags": [], "timestamp_ms": 1705314600000}], "spans": [{"dataset_id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "duration": 1500000000, "meta": {"error": {"message": "Model response timed out", "stack": "Traceback (most recent call last):\n File \"main.py\", line 10, in \n response = model.generate(input)\n File \"model.py\", line 45, in generate\n raise TimeoutError(\"Model response timed out\")\nTimeoutError: Model response timed out", "type": "TimeoutError"}, "input": null, "output": null}, "name": "llm_call", "project_id": "a33671aa-24fd-4dcd-9b33-a8ec7dde7751", "span_id": "span-7a1b2c3d", "start_ns": 1705314600000000000, "status": "ok", "tags": [], "trace_id": "abc123def456"}]}, "type": "events"}} @@ -1174,7 +1475,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Restore an LLM Observability dataset version returns "Bad Request" response - Given operation "RestoreLLMObsDatasetVersion" enabled + Given a valid "appKeyAuth" key in the system + And operation "RestoreLLMObsDatasetVersion" enabled And new "RestoreLLMObsDatasetVersion" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1184,7 +1486,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Restore an LLM Observability dataset version returns "Not Found" response - Given operation "RestoreLLMObsDatasetVersion" enabled + Given a valid "appKeyAuth" key in the system + And operation "RestoreLLMObsDatasetVersion" enabled And new "RestoreLLMObsDatasetVersion" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1194,7 +1497,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Restore an LLM Observability dataset version returns "OK" response - Given operation "RestoreLLMObsDatasetVersion" enabled + Given a valid "appKeyAuth" key in the system + And operation "RestoreLLMObsDatasetVersion" enabled And new "RestoreLLMObsDatasetVersion" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1204,7 +1508,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Run an LLM inference returns "Bad Request" response - Given operation "CreateLLMObsIntegrationInference" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsIntegrationInference" enabled And new "CreateLLMObsIntegrationInference" request And request contains "integration" parameter from "REPLACE.ME" And request contains "account_id" parameter from "REPLACE.ME" @@ -1214,7 +1519,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Run an LLM inference returns "OK" response - Given operation "CreateLLMObsIntegrationInference" enabled + Given a valid "appKeyAuth" key in the system + And operation "CreateLLMObsIntegrationInference" enabled And new "CreateLLMObsIntegrationInference" request And request contains "integration" parameter from "REPLACE.ME" And request contains "account_id" parameter from "REPLACE.ME" @@ -1224,7 +1530,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Search LLM Observability experimentation entities returns "Bad Request" response - Given operation "SearchLLMObsExperimentation" enabled + Given a valid "appKeyAuth" key in the system + And operation "SearchLLMObsExperimentation" enabled And new "SearchLLMObsExperimentation" request And body with value {"data": {"attributes": {"content_preview": {"limit": 500}, "filter": {"include_deleted": false, "is_deleted": false, "query": "my experiment", "scope": ["experiments"], "version": null}, "include": {"user_data": false}, "page": {"limit": 100}}, "type": "experimentation"}} When the request is sent @@ -1232,7 +1539,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Search LLM Observability experimentation entities returns "OK — all results returned in a single page." response - Given operation "SearchLLMObsExperimentation" enabled + Given a valid "appKeyAuth" key in the system + And operation "SearchLLMObsExperimentation" enabled And new "SearchLLMObsExperimentation" request And body with value {"data": {"attributes": {"content_preview": {"limit": 500}, "filter": {"include_deleted": false, "is_deleted": false, "query": "my experiment", "scope": ["experiments"], "version": null}, "include": {"user_data": false}, "page": {"limit": 100}}, "type": "experimentation"}} When the request is sent @@ -1240,7 +1548,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Search LLM Observability experimentation entities returns "Partial Content — more results are available. Use `meta.after` as the next `page.cursor`." response - Given operation "SearchLLMObsExperimentation" enabled + Given a valid "appKeyAuth" key in the system + And operation "SearchLLMObsExperimentation" enabled And new "SearchLLMObsExperimentation" request And body with value {"data": {"attributes": {"content_preview": {"limit": 500}, "filter": {"include_deleted": false, "is_deleted": false, "query": "my experiment", "scope": ["experiments"], "version": null}, "include": {"user_data": false}, "page": {"limit": 100}}, "type": "experimentation"}} When the request is sent @@ -1248,7 +1557,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Search LLM Observability spans returns "Bad Request" response - Given operation "SearchLLMObsSpans" enabled + Given a valid "appKeyAuth" key in the system + And 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 @@ -1256,7 +1566,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Search LLM Observability spans returns "OK" response - Given operation "SearchLLMObsSpans" enabled + Given a valid "appKeyAuth" key in the system + And 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 @@ -1264,7 +1575,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Simple search experimentation entities returns "Bad Request" response - Given operation "SimpleSearchLLMObsExperimentation" enabled + Given a valid "appKeyAuth" key in the system + And operation "SimpleSearchLLMObsExperimentation" enabled And new "SimpleSearchLLMObsExperimentation" request And body with value {"data": {"attributes": {"content_preview": {"limit": 500}, "filter": {"include_deleted": false, "is_deleted": false, "query": "my experiment", "scope": ["experiments"], "version": null}, "include": {"user_data": false}, "page": {"limit": 50, "number": 1}, "sort": [{"direction": "desc", "field": "created_at"}]}, "type": "experimentation"}} When the request is sent @@ -1272,7 +1584,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Simple search experimentation entities returns "OK" response - Given operation "SimpleSearchLLMObsExperimentation" enabled + Given a valid "appKeyAuth" key in the system + And operation "SimpleSearchLLMObsExperimentation" enabled And new "SimpleSearchLLMObsExperimentation" request And body with value {"data": {"attributes": {"content_preview": {"limit": 500}, "filter": {"include_deleted": false, "is_deleted": false, "query": "my experiment", "scope": ["experiments"], "version": null}, "include": {"user_data": false}, "page": {"limit": 50, "number": 1}, "sort": [{"direction": "desc", "field": "created_at"}]}, "type": "experimentation"}} When the request is sent @@ -1280,7 +1593,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Trigger a patterns run returns "Accepted" response - Given operation "TriggerLLMObsPatterns" enabled + Given a valid "appKeyAuth" key in the system + And operation "TriggerLLMObsPatterns" enabled And new "TriggerLLMObsPatterns" request And body with value {"data": {"attributes": {"config_id": "a7c8d9e0-1234-5678-9abc-def012345678"}, "type": "topic_discovery"}} When the request is sent @@ -1288,7 +1602,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Trigger a patterns run returns "Bad Request" response - Given operation "TriggerLLMObsPatterns" enabled + Given a valid "appKeyAuth" key in the system + And operation "TriggerLLMObsPatterns" enabled And new "TriggerLLMObsPatterns" request And body with value {"data": {"attributes": {"config_id": "a7c8d9e0-1234-5678-9abc-def012345678"}, "type": "topic_discovery"}} When the request is sent @@ -1296,7 +1611,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Trigger a patterns run returns "Not Found" response - Given operation "TriggerLLMObsPatterns" enabled + Given a valid "appKeyAuth" key in the system + And operation "TriggerLLMObsPatterns" enabled And new "TriggerLLMObsPatterns" request And body with value {"data": {"attributes": {"config_id": "a7c8d9e0-1234-5678-9abc-def012345678"}, "type": "topic_discovery"}} When the request is sent @@ -1304,7 +1620,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Unlock LLM Observability dataset draft state returns "Bad Request" response - Given operation "UnlockLLMObsDatasetDraftState" enabled + Given a valid "appKeyAuth" key in the system + And operation "UnlockLLMObsDatasetDraftState" enabled And new "UnlockLLMObsDatasetDraftState" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1313,7 +1630,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Unlock LLM Observability dataset draft state returns "Not Found" response - Given operation "UnlockLLMObsDatasetDraftState" enabled + Given a valid "appKeyAuth" key in the system + And operation "UnlockLLMObsDatasetDraftState" enabled And new "UnlockLLMObsDatasetDraftState" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1322,7 +1640,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Unlock LLM Observability dataset draft state returns "OK" response - Given operation "UnlockLLMObsDatasetDraftState" enabled + Given a valid "appKeyAuth" key in the system + And operation "UnlockLLMObsDatasetDraftState" enabled And new "UnlockLLMObsDatasetDraftState" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1331,7 +1650,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update LLM Observability dataset records returns "Bad Request" response - Given operation "UpdateLLMObsDatasetRecords" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsDatasetRecords" enabled And new "UpdateLLMObsDatasetRecords" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1341,7 +1661,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update LLM Observability dataset records returns "Not Found" response - Given operation "UpdateLLMObsDatasetRecords" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsDatasetRecords" enabled And new "UpdateLLMObsDatasetRecords" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1351,7 +1672,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update LLM Observability dataset records returns "OK" response - Given operation "UpdateLLMObsDatasetRecords" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsDatasetRecords" enabled And new "UpdateLLMObsDatasetRecords" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1359,9 +1681,47 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @skip @team:DataDog/ml-observability + Scenario: Update a specific LLM Observability prompt version returns "Bad Request" response + Given there is a valid "prompt" in the system + And there is a valid "prompt_version" in the system + And a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsPromptVersion" enabled + And new "UpdateLLMObsPromptVersion" request + And request contains "prompt_id" parameter from "prompt.data.attributes.prompt_id" + And request contains "version" parameter with value "not-a-number" + And body with value {"data": {"attributes": {"env_ids": [], "labels": []}, "type": "prompt-template-versions"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/ml-observability + Scenario: Update a specific LLM Observability prompt version returns "Not Found" response + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsPromptVersion" enabled + And new "UpdateLLMObsPromptVersion" request + And request contains "prompt_id" parameter with value "nonexistent-prompt" + And request contains "version" parameter with value "1" + And body with value {"data": {"attributes": {"env_ids": [], "labels": []}, "type": "prompt-template-versions"}} + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/ml-observability + Scenario: Update a specific LLM Observability prompt version returns "OK" response + Given there is a valid "prompt" in the system + And there is a valid "prompt_version" in the system + And a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsPromptVersion" enabled + And new "UpdateLLMObsPromptVersion" request + And request contains "prompt_id" parameter from "prompt.data.attributes.prompt_id" + And request contains "version" parameter from "prompt_version.data.attributes.version" + And body with value {"data": {"attributes": {"env_ids": [], "labels": []}, "type": "prompt-template-versions"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Update an LLM Observability annotation queue returns "Bad Request" response - Given operation "UpdateLLMObsAnnotationQueue" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsAnnotationQueue" enabled And new "UpdateLLMObsAnnotationQueue" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "abc-123", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}, "description": "Updated description", "name": "Updated queue name"}, "type": "queues"}} @@ -1370,7 +1730,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update an LLM Observability annotation queue returns "Not Found" response - Given operation "UpdateLLMObsAnnotationQueue" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsAnnotationQueue" enabled And new "UpdateLLMObsAnnotationQueue" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "abc-123", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}, "description": "Updated description", "name": "Updated queue name"}, "type": "queues"}} @@ -1379,7 +1740,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update an LLM Observability annotation queue returns "OK" response - Given operation "UpdateLLMObsAnnotationQueue" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsAnnotationQueue" enabled And new "UpdateLLMObsAnnotationQueue" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "abc-123", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}, "description": "Updated description", "name": "Updated queue name"}, "type": "queues"}} @@ -1388,7 +1750,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update an LLM Observability dataset returns "Bad Request" response - Given operation "UpdateLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsDataset" enabled And new "UpdateLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1398,7 +1761,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update an LLM Observability dataset returns "Not Found" response - Given operation "UpdateLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsDataset" enabled And new "UpdateLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1408,7 +1772,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update an LLM Observability dataset returns "OK" response - Given operation "UpdateLLMObsDataset" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsDataset" enabled And new "UpdateLLMObsDataset" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1418,7 +1783,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update an LLM Observability experiment returns "Bad Request" response - Given operation "UpdateLLMObsExperiment" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsExperiment" enabled And new "UpdateLLMObsExperiment" request And request contains "experiment_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"dataset_id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "status": "completed"}, "type": "experiments"}} @@ -1427,7 +1793,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update an LLM Observability experiment returns "Not Found" response - Given operation "UpdateLLMObsExperiment" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsExperiment" enabled And new "UpdateLLMObsExperiment" request And request contains "experiment_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"dataset_id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "status": "completed"}, "type": "experiments"}} @@ -1436,7 +1803,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update an LLM Observability experiment returns "OK" response - Given operation "UpdateLLMObsExperiment" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsExperiment" enabled And new "UpdateLLMObsExperiment" request And request contains "experiment_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"dataset_id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "status": "completed"}, "type": "experiments"}} @@ -1445,7 +1813,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update an LLM Observability project returns "Bad Request" response - Given operation "UpdateLLMObsProject" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsProject" enabled And new "UpdateLLMObsProject" request And request contains "project_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {}, "type": "projects"}} @@ -1454,7 +1823,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update an LLM Observability project returns "Not Found" response - Given operation "UpdateLLMObsProject" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsProject" enabled And new "UpdateLLMObsProject" request And request contains "project_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {}, "type": "projects"}} @@ -1463,16 +1833,50 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update an LLM Observability project returns "OK" response - Given operation "UpdateLLMObsProject" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsProject" enabled And new "UpdateLLMObsProject" request And request contains "project_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {}, "type": "projects"}} When the request is sent Then the response status is 200 OK + @skip @team:DataDog/ml-observability + Scenario: Update an LLM Observability prompt returns "Bad Request" response + Given there is a valid "prompt" in the system + And a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsPrompt" enabled + And new "UpdateLLMObsPrompt" request + And request contains "prompt_id" parameter from "prompt.data.attributes.prompt_id" + And body with value {"data": {"attributes": {}, "type": "prompt-templates"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/ml-observability + Scenario: Update an LLM Observability prompt returns "Not Found" response + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsPrompt" enabled + And new "UpdateLLMObsPrompt" request + And request contains "prompt_id" parameter with value "nonexistent-prompt" + And body with value {"data": {"attributes": {"title": "New title"}, "type": "prompt-templates"}} + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/ml-observability + Scenario: Update an LLM Observability prompt returns "OK" response + Given there is a valid "prompt" in the system + And a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsPrompt" enabled + And new "UpdateLLMObsPrompt" request + And request contains "prompt_id" parameter from "prompt.data.attributes.prompt_id" + And body with value {"data": {"attributes": {"title": "New title"}, "type": "prompt-templates"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Update annotation queue label schema returns "Bad Request" response - Given operation "UpdateLLMObsAnnotationQueueLabelSchema" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsAnnotationQueueLabelSchema" enabled And new "UpdateLLMObsAnnotationQueueLabelSchema" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "abc-123", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}}, "type": "queues"}} @@ -1481,7 +1885,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update annotation queue label schema returns "Not Found" response - Given operation "UpdateLLMObsAnnotationQueueLabelSchema" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsAnnotationQueueLabelSchema" enabled And new "UpdateLLMObsAnnotationQueueLabelSchema" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "abc-123", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}}, "type": "queues"}} @@ -1490,7 +1895,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Update annotation queue label schema returns "OK" response - Given operation "UpdateLLMObsAnnotationQueueLabelSchema" enabled + Given a valid "appKeyAuth" key in the system + And operation "UpdateLLMObsAnnotationQueueLabelSchema" enabled And new "UpdateLLMObsAnnotationQueueLabelSchema" request And request contains "queue_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "abc-123", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}}, "type": "queues"}} @@ -1499,7 +1905,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Upload records to an LLM Observability dataset returns "Bad Request" response - Given operation "UploadLLMObsDatasetRecordsFile" enabled + Given a valid "appKeyAuth" key in the system + And operation "UploadLLMObsDatasetRecordsFile" enabled And new "UploadLLMObsDatasetRecordsFile" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1508,7 +1915,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Upload records to an LLM Observability dataset returns "Not Found" response - Given operation "UploadLLMObsDatasetRecordsFile" enabled + Given a valid "appKeyAuth" key in the system + And operation "UploadLLMObsDatasetRecordsFile" enabled And new "UploadLLMObsDatasetRecordsFile" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" @@ -1517,7 +1925,8 @@ Feature: LLM Observability @generated @skip @team:DataDog/ml-observability Scenario: Upload records to an LLM Observability dataset returns "OK" response - Given operation "UploadLLMObsDatasetRecordsFile" enabled + Given a valid "appKeyAuth" key in the system + And operation "UploadLLMObsDatasetRecordsFile" enabled And new "UploadLLMObsDatasetRecordsFile" request And request contains "project_id" parameter from "REPLACE.ME" And request contains "dataset_id" parameter from "REPLACE.ME" diff --git a/features/v2/undo.json b/features/v2/undo.json index f7316aecda2c..9d548b5ffffe 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4555,6 +4555,69 @@ "type": "idempotent" } }, + "ListLLMObsPrompts": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "CreateLLMObsPrompt": { + "tag": "LLM Observability", + "undo": { + "operationId": "DeleteLLMObsPrompt", + "parameters": [ + { + "name": "prompt_id", + "source": "data.attributes.prompt_id" + } + ], + "type": "unsafe" + } + }, + "DeleteLLMObsPrompt": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, + "GetLLMObsPrompt": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "UpdateLLMObsPrompt": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, + "ListLLMObsPromptVersions": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "CreateLLMObsPromptVersion": { + "tag": "LLM Observability", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "GetLLMObsPromptVersion": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "UpdateLLMObsPromptVersion": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, "ListLLMObsSpans": { "tag": "LLM Observability", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 5871db98c921..44d14ba7f739 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -216,6 +216,8 @@ def initialize "v2.create_llm_obs_experiment_events": false, "v2.create_llm_obs_integration_inference": false, "v2.create_llm_obs_project": false, + "v2.create_llm_obs_prompt": false, + "v2.create_llm_obs_prompt_version": false, "v2.delete_llm_obs_annotation_queue": false, "v2.delete_llm_obs_annotation_queue_interactions": false, "v2.delete_llm_obs_annotations": false, @@ -226,6 +228,7 @@ def initialize "v2.delete_llm_obs_experiments": false, "v2.delete_llm_obs_patterns_config": false, "v2.delete_llm_obs_projects": false, + "v2.delete_llm_obs_prompt": false, "v2.export_llm_obs_dataset": false, "v2.get_llm_obs_annotated_interactions": false, "v2.get_llm_obs_annotated_interactions_by_trace_i_ds": false, @@ -234,6 +237,8 @@ def initialize "v2.get_llm_obs_dataset_draft_state": false, "v2.get_llm_obs_patterns_config": false, "v2.get_llm_obs_patterns_run_status": false, + "v2.get_llm_obs_prompt": false, + "v2.get_llm_obs_prompt_version": false, "v2.list_llm_obs_annotation_queues": false, "v2.list_llm_obs_dataset_records": false, "v2.list_llm_obs_datasets": false, @@ -250,6 +255,8 @@ def initialize "v2.list_llm_obs_patterns_topics": false, "v2.list_llm_obs_patterns_topics_with_clustered_points": false, "v2.list_llm_obs_projects": false, + "v2.list_llm_obs_prompts": false, + "v2.list_llm_obs_prompt_versions": false, "v2.list_llm_obs_spans": false, "v2.lock_llm_obs_dataset_draft_state": false, "v2.restore_llm_obs_dataset_version": false, @@ -265,6 +272,8 @@ def initialize "v2.update_llm_obs_dataset_records": false, "v2.update_llm_obs_experiment": false, "v2.update_llm_obs_project": false, + "v2.update_llm_obs_prompt": false, + "v2.update_llm_obs_prompt_version": false, "v2.upload_llm_obs_dataset_records_file": false, "v2.upsert_llm_obs_annotations": false, "v2.upsert_llm_obs_patterns_config": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 34d2ccb8acd5..2259eb8463c3 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4281,6 +4281,12 @@ def overrides "v2.llm_obs_content_block_llm_obs_trace_interaction_type" => "LLMObsContentBlockLLMObsTraceInteractionType", "v2.llm_obs_content_block_time_frame" => "LLMObsContentBlockTimeFrame", "v2.llm_obs_content_block_type" => "LLMObsContentBlockType", + "v2.llm_obs_create_prompt_data" => "LLMObsCreatePromptData", + "v2.llm_obs_create_prompt_data_attributes" => "LLMObsCreatePromptDataAttributes", + "v2.llm_obs_create_prompt_request" => "LLMObsCreatePromptRequest", + "v2.llm_obs_create_prompt_version_data" => "LLMObsCreatePromptVersionData", + "v2.llm_obs_create_prompt_version_data_attributes" => "LLMObsCreatePromptVersionDataAttributes", + "v2.llm_obs_create_prompt_version_request" => "LLMObsCreatePromptVersionRequest", "v2.llm_obs_cursor_meta" => "LLMObsCursorMeta", "v2.llm_obs_custom_eval_config_assessment_criteria" => "LLMObsCustomEvalConfigAssessmentCriteria", "v2.llm_obs_custom_eval_config_attributes" => "LLMObsCustomEvalConfigAttributes", @@ -4375,6 +4381,9 @@ def overrides "v2.llm_obs_delete_datasets_data_attributes_request" => "LLMObsDeleteDatasetsDataAttributesRequest", "v2.llm_obs_delete_datasets_data_request" => "LLMObsDeleteDatasetsDataRequest", "v2.llm_obs_delete_datasets_request" => "LLMObsDeleteDatasetsRequest", + "v2.llm_obs_deleted_prompt_data" => "LLMObsDeletedPromptData", + "v2.llm_obs_deleted_prompt_data_attributes" => "LLMObsDeletedPromptDataAttributes", + "v2.llm_obs_deleted_prompt_response" => "LLMObsDeletedPromptResponse", "v2.llm_obs_delete_experiments_data_attributes_request" => "LLMObsDeleteExperimentsDataAttributesRequest", "v2.llm_obs_delete_experiments_data_request" => "LLMObsDeleteExperimentsDataRequest", "v2.llm_obs_delete_experiments_request" => "LLMObsDeleteExperimentsRequest", @@ -4533,6 +4542,25 @@ def overrides "v2.llm_obs_project_update_data_attributes_request" => "LLMObsProjectUpdateDataAttributesRequest", "v2.llm_obs_project_update_data_request" => "LLMObsProjectUpdateDataRequest", "v2.llm_obs_project_update_request" => "LLMObsProjectUpdateRequest", + "v2.llm_obs_prompt_chat_message" => "LLMObsPromptChatMessage", + "v2.llm_obs_prompt_data" => "LLMObsPromptData", + "v2.llm_obs_prompt_data_attributes" => "LLMObsPromptDataAttributes", + "v2.llm_obs_prompt_dataset" => "LLMObsPromptDataset", + "v2.llm_obs_prompt_response" => "LLMObsPromptResponse", + "v2.llm_obs_prompt_response_source" => "LLMObsPromptResponseSource", + "v2.llm_obs_prompt_sdk_data" => "LLMObsPromptSDKData", + "v2.llm_obs_prompt_sdk_data_attributes" => "LLMObsPromptSDKDataAttributes", + "v2.llm_obs_prompt_sdk_response" => "LLMObsPromptSDKResponse", + "v2.llm_obs_prompts_response" => "LLMObsPromptsResponse", + "v2.llm_obs_prompt_template" => "LLMObsPromptTemplate", + "v2.llm_obs_prompt_type" => "LLMObsPromptType", + "v2.llm_obs_prompt_version_data" => "LLMObsPromptVersionData", + "v2.llm_obs_prompt_version_data_attributes" => "LLMObsPromptVersionDataAttributes", + "v2.llm_obs_prompt_version_list_data" => "LLMObsPromptVersionListData", + "v2.llm_obs_prompt_version_list_data_attributes" => "LLMObsPromptVersionListDataAttributes", + "v2.llm_obs_prompt_version_response" => "LLMObsPromptVersionResponse", + "v2.llm_obs_prompt_versions_response" => "LLMObsPromptVersionsResponse", + "v2.llm_obs_prompt_version_type" => "LLMObsPromptVersionType", "v2.llm_obs_record_type" => "LLMObsRecordType", "v2.llm_obs_search_spans_request" => "LLMObsSearchSpansRequest", "v2.llm_obs_search_spans_request_attributes" => "LLMObsSearchSpansRequestAttributes", @@ -4558,6 +4586,12 @@ def overrides "v2.llm_obs_trace_interaction_item" => "LLMObsTraceInteractionItem", "v2.llm_obs_trace_interaction_response_item" => "LLMObsTraceInteractionResponseItem", "v2.llm_obs_trace_interaction_type" => "LLMObsTraceInteractionType", + "v2.llm_obs_update_prompt_data" => "LLMObsUpdatePromptData", + "v2.llm_obs_update_prompt_data_attributes" => "LLMObsUpdatePromptDataAttributes", + "v2.llm_obs_update_prompt_request" => "LLMObsUpdatePromptRequest", + "v2.llm_obs_update_prompt_version_data" => "LLMObsUpdatePromptVersionData", + "v2.llm_obs_update_prompt_version_data_attributes" => "LLMObsUpdatePromptVersionDataAttributes", + "v2.llm_obs_update_prompt_version_request" => "LLMObsUpdatePromptVersionRequest", "v2.llm_obs_upsert_annotation_item" => "LLMObsUpsertAnnotationItem", "v2.llm_obs_vertex_ai_metadata" => "LLMObsVertexAIMetadata", "v2.log" => "Log", 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 956cd540eabd..8f86d381c1e0 100644 --- a/lib/datadog_api_client/v2/api/llm_observability_api.rb +++ b/lib/datadog_api_client/v2/api/llm_observability_api.rb @@ -901,6 +901,157 @@ def create_llm_obs_project_with_http_info(body, opts = {}) return data, status_code, headers end + # Create an LLM Observability prompt. + # + # @see #create_llm_obs_prompt_with_http_info + def create_llm_obs_prompt(body, opts = {}) + data, _status_code, _headers = create_llm_obs_prompt_with_http_info(body, opts) + data + end + + # Create an LLM Observability prompt. + # + # Create a new prompt (and its first version) in the LLM Observability prompt registry. + # + # @param body [LLMObsCreatePromptRequest] Create prompt payload. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsPromptResponse, Integer, Hash)>] LLMObsPromptResponse data, response status code and response headers + def create_llm_obs_prompt_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_llm_obs_prompt".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_llm_obs_prompt") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_llm_obs_prompt")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.create_llm_obs_prompt ...' + 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.create_llm_obs_prompt" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/prompts' + + # 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] || 'LLMObsPromptResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_llm_obs_prompt, + :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#create_llm_obs_prompt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a new LLM Observability prompt version. + # + # @see #create_llm_obs_prompt_version_with_http_info + def create_llm_obs_prompt_version(prompt_id, body, opts = {}) + data, _status_code, _headers = create_llm_obs_prompt_version_with_http_info(prompt_id, body, opts) + data + end + + # Create a new LLM Observability prompt version. + # + # Create a new version of an existing LLM Observability prompt. + # + # @param prompt_id [String] The customer-provided identifier of the LLM Observability prompt. + # @param body [LLMObsCreatePromptVersionRequest] Create prompt version payload. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsPromptVersionResponse, Integer, Hash)>] LLMObsPromptVersionResponse data, response status code and response headers + def create_llm_obs_prompt_version_with_http_info(prompt_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_llm_obs_prompt_version".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_llm_obs_prompt_version") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_llm_obs_prompt_version")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.create_llm_obs_prompt_version ...' + end + # verify the required parameter 'prompt_id' is set + if @api_client.config.client_side_validation && prompt_id.nil? + fail ArgumentError, "Missing the required parameter 'prompt_id' when calling LLMObservabilityAPI.create_llm_obs_prompt_version" + 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.create_llm_obs_prompt_version" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/prompts/{prompt_id}/versions'.sub('{prompt_id}', CGI.escape(prompt_id.to_s).gsub('%2F', '/')) + + # 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] || 'LLMObsPromptVersionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_llm_obs_prompt_version, + :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#create_llm_obs_prompt_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete an LLM Observability annotation queue. # # @see #delete_llm_obs_annotation_queue_with_http_info @@ -1650,6 +1801,77 @@ def delete_llm_obs_projects_with_http_info(body, opts = {}) return data, status_code, headers end + # Delete an LLM Observability prompt. + # + # @see #delete_llm_obs_prompt_with_http_info + def delete_llm_obs_prompt(prompt_id, opts = {}) + data, _status_code, _headers = delete_llm_obs_prompt_with_http_info(prompt_id, opts) + data + end + + # Delete an LLM Observability prompt. + # + # Soft-delete an LLM Observability prompt. The prompt's version rows are retained, but they are no longer accessible through the public prompt registry endpoints. + # + # @param prompt_id [String] The customer-provided identifier of the LLM Observability prompt. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsDeletedPromptResponse, Integer, Hash)>] LLMObsDeletedPromptResponse data, response status code and response headers + def delete_llm_obs_prompt_with_http_info(prompt_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_llm_obs_prompt".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_llm_obs_prompt") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_llm_obs_prompt")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.delete_llm_obs_prompt ...' + end + # verify the required parameter 'prompt_id' is set + if @api_client.config.client_side_validation && prompt_id.nil? + fail ArgumentError, "Missing the required parameter 'prompt_id' when calling LLMObservabilityAPI.delete_llm_obs_prompt" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/prompts/{prompt_id}'.sub('{prompt_id}', CGI.escape(prompt_id.to_s).gsub('%2F', '/')) + + # 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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsDeletedPromptResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_llm_obs_prompt, + :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::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#delete_llm_obs_prompt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Export an LLM Observability dataset. # # @see #export_llm_obs_dataset_with_http_info @@ -2255,6 +2477,158 @@ def get_llm_obs_patterns_run_status_with_http_info(config_id, opts = {}) return data, status_code, headers end + # Get an LLM Observability prompt. + # + # @see #get_llm_obs_prompt_with_http_info + def get_llm_obs_prompt(prompt_id, opts = {}) + data, _status_code, _headers = get_llm_obs_prompt_with_http_info(prompt_id, opts) + data + end + + # Get an LLM Observability prompt. + # + # Get the latest version of an LLM Observability prompt by prompt ID. + # + # @param prompt_id [String] The customer-provided identifier of the LLM Observability prompt. + # @param opts [Hash] the optional parameters + # @option opts [String] :label **Deprecated. Do not use this parameter for new integrations.** The label of the prompt version to return. If omitted, the latest version is returned. If the prompt has no labels, the latest version is returned even when a label is requested. + # @return [Array<(LLMObsPromptSDKResponse, Integer, Hash)>] LLMObsPromptSDKResponse data, response status code and response headers + def get_llm_obs_prompt_with_http_info(prompt_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_llm_obs_prompt".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_llm_obs_prompt") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_llm_obs_prompt")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.get_llm_obs_prompt ...' + end + # verify the required parameter 'prompt_id' is set + if @api_client.config.client_side_validation && prompt_id.nil? + fail ArgumentError, "Missing the required parameter 'prompt_id' when calling LLMObservabilityAPI.get_llm_obs_prompt" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/prompts/{prompt_id}'.sub('{prompt_id}', CGI.escape(prompt_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'label'] = opts[:'label'] if !opts[:'label'].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] || 'LLMObsPromptSDKResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_llm_obs_prompt, + :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#get_llm_obs_prompt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a specific LLM Observability prompt version. + # + # @see #get_llm_obs_prompt_version_with_http_info + def get_llm_obs_prompt_version(prompt_id, version, opts = {}) + data, _status_code, _headers = get_llm_obs_prompt_version_with_http_info(prompt_id, version, opts) + data + end + + # Get a specific LLM Observability prompt version. + # + # Get the full template of a single, specific version of an LLM Observability prompt. + # + # @param prompt_id [String] The customer-provided identifier of the LLM Observability prompt. + # @param version [Integer] The version number of the LLM Observability prompt. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsPromptVersionResponse, Integer, Hash)>] LLMObsPromptVersionResponse data, response status code and response headers + def get_llm_obs_prompt_version_with_http_info(prompt_id, version, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_llm_obs_prompt_version".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_llm_obs_prompt_version") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_llm_obs_prompt_version")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.get_llm_obs_prompt_version ...' + end + # verify the required parameter 'prompt_id' is set + if @api_client.config.client_side_validation && prompt_id.nil? + fail ArgumentError, "Missing the required parameter 'prompt_id' when calling LLMObservabilityAPI.get_llm_obs_prompt_version" + end + # verify the required parameter 'version' is set + if @api_client.config.client_side_validation && version.nil? + fail ArgumentError, "Missing the required parameter 'version' when calling LLMObservabilityAPI.get_llm_obs_prompt_version" + end + if @api_client.config.client_side_validation && version < 1 + fail ArgumentError, 'invalid value for "version" when calling LLMObservabilityAPI.get_llm_obs_prompt_version, must be greater than or equal to 1.' + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/prompts/{prompt_id}/versions/{version}'.sub('{prompt_id}', CGI.escape(prompt_id.to_s).gsub('%2F', '/')).sub('{version}', CGI.escape(version.to_s).gsub('%2F', '/')) + + # 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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsPromptVersionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_llm_obs_prompt_version, + :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#get_llm_obs_prompt_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List LLM Observability annotation queues. # # @see #list_llm_obs_annotation_queues_with_http_info @@ -3479,6 +3853,145 @@ def list_llm_obs_projects_with_http_info(opts = {}) return data, status_code, headers end + # List LLM Observability prompts. + # + # @see #list_llm_obs_prompts_with_http_info + def list_llm_obs_prompts(opts = {}) + data, _status_code, _headers = list_llm_obs_prompts_with_http_info(opts) + data + end + + # List LLM Observability prompts. + # + # List all LLM Observability prompts in the prompt registry for the org. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_prompt_id Filter prompts by prompt ID. + # @return [Array<(LLMObsPromptsResponse, Integer, Hash)>] LLMObsPromptsResponse data, response status code and response headers + def list_llm_obs_prompts_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_llm_obs_prompts".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_llm_obs_prompts") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_llm_obs_prompts")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.list_llm_obs_prompts ...' + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/prompts' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[prompt_id]'] = opts[:'filter_prompt_id'] if !opts[:'filter_prompt_id'].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] || 'LLMObsPromptsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_llm_obs_prompts, + :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_prompts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List versions of an LLM Observability prompt. + # + # @see #list_llm_obs_prompt_versions_with_http_info + def list_llm_obs_prompt_versions(prompt_id, opts = {}) + data, _status_code, _headers = list_llm_obs_prompt_versions_with_http_info(prompt_id, opts) + data + end + + # List versions of an LLM Observability prompt. + # + # List all versions of an LLM Observability prompt, ordered newest to oldest. + # + # @param prompt_id [String] The customer-provided identifier of the LLM Observability prompt. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsPromptVersionsResponse, Integer, Hash)>] LLMObsPromptVersionsResponse data, response status code and response headers + def list_llm_obs_prompt_versions_with_http_info(prompt_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_llm_obs_prompt_versions".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_llm_obs_prompt_versions") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_llm_obs_prompt_versions")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.list_llm_obs_prompt_versions ...' + end + # verify the required parameter 'prompt_id' is set + if @api_client.config.client_side_validation && prompt_id.nil? + fail ArgumentError, "Missing the required parameter 'prompt_id' when calling LLMObservabilityAPI.list_llm_obs_prompt_versions" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/prompts/{prompt_id}/versions'.sub('{prompt_id}', CGI.escape(prompt_id.to_s).gsub('%2F', '/')) + + # 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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsPromptVersionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_llm_obs_prompt_versions, + :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_prompt_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List LLM Observability spans. # # @see #list_llm_obs_spans_with_http_info @@ -4662,6 +5175,174 @@ def update_llm_obs_project_with_http_info(project_id, body, opts = {}) return data, status_code, headers end + # Update an LLM Observability prompt. + # + # @see #update_llm_obs_prompt_with_http_info + def update_llm_obs_prompt(prompt_id, body, opts = {}) + data, _status_code, _headers = update_llm_obs_prompt_with_http_info(prompt_id, body, opts) + data + end + + # Update an LLM Observability prompt. + # + # Update the title and/or description of an LLM Observability prompt. + # + # This endpoint does not recompute version aggregate data: `num_versions` and `last_version_created_at` + # are not populated in the response and may show as `0` and a zero-value timestamp even if the prompt has + # existing versions. + # + # @param prompt_id [String] The customer-provided identifier of the LLM Observability prompt. + # @param body [LLMObsUpdatePromptRequest] Update prompt payload. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsPromptResponse, Integer, Hash)>] LLMObsPromptResponse data, response status code and response headers + def update_llm_obs_prompt_with_http_info(prompt_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_llm_obs_prompt".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_llm_obs_prompt") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_llm_obs_prompt")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.update_llm_obs_prompt ...' + end + # verify the required parameter 'prompt_id' is set + if @api_client.config.client_side_validation && prompt_id.nil? + fail ArgumentError, "Missing the required parameter 'prompt_id' when calling LLMObservabilityAPI.update_llm_obs_prompt" + 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.update_llm_obs_prompt" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/prompts/{prompt_id}'.sub('{prompt_id}', CGI.escape(prompt_id.to_s).gsub('%2F', '/')) + + # 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] || 'LLMObsPromptResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_llm_obs_prompt, + :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::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#update_llm_obs_prompt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a specific LLM Observability prompt version. + # + # @see #update_llm_obs_prompt_version_with_http_info + def update_llm_obs_prompt_version(prompt_id, version, body, opts = {}) + data, _status_code, _headers = update_llm_obs_prompt_version_with_http_info(prompt_id, version, body, opts) + data + end + + # Update a specific LLM Observability prompt version. + # + # Update the description, labels, and/or feature-flag environments of a specific version of an LLM Observability prompt. + # + # @param prompt_id [String] The customer-provided identifier of the LLM Observability prompt. + # @param version [Integer] The version number of the LLM Observability prompt. + # @param body [LLMObsUpdatePromptVersionRequest] Update prompt version payload. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsPromptVersionResponse, Integer, Hash)>] LLMObsPromptVersionResponse data, response status code and response headers + def update_llm_obs_prompt_version_with_http_info(prompt_id, version, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_llm_obs_prompt_version".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_llm_obs_prompt_version") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_llm_obs_prompt_version")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.update_llm_obs_prompt_version ...' + end + # verify the required parameter 'prompt_id' is set + if @api_client.config.client_side_validation && prompt_id.nil? + fail ArgumentError, "Missing the required parameter 'prompt_id' when calling LLMObservabilityAPI.update_llm_obs_prompt_version" + end + # verify the required parameter 'version' is set + if @api_client.config.client_side_validation && version.nil? + fail ArgumentError, "Missing the required parameter 'version' when calling LLMObservabilityAPI.update_llm_obs_prompt_version" + end + if @api_client.config.client_side_validation && version < 1 + fail ArgumentError, 'invalid value for "version" when calling LLMObservabilityAPI.update_llm_obs_prompt_version, must be greater than or equal to 1.' + 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.update_llm_obs_prompt_version" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/prompts/{prompt_id}/versions/{version}'.sub('{prompt_id}', CGI.escape(prompt_id.to_s).gsub('%2F', '/')).sub('{version}', CGI.escape(version.to_s).gsub('%2F', '/')) + + # 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] || 'LLMObsPromptVersionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_llm_obs_prompt_version, + :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::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#update_llm_obs_prompt_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Upload records to an LLM Observability dataset. # # @see #upload_llm_obs_dataset_records_file_with_http_info diff --git a/lib/datadog_api_client/v2/models/llm_obs_create_prompt_data.rb b/lib/datadog_api_client/v2/models/llm_obs_create_prompt_data.rb new file mode 100644 index 000000000000..0a98c9e6133b --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_create_prompt_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 creating an LLM Observability prompt. + class LLMObsCreatePromptData + include BaseGenericModel + + # Attributes for creating an LLM Observability prompt and its first version. + attr_reader :attributes + + # Resource type of an LLM Observability prompt. + 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' => :'LLMObsCreatePromptDataAttributes', + :'type' => :'LLMObsPromptType' + } + 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::LLMObsCreatePromptData` 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_create_prompt_data_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_create_prompt_data_attributes.rb new file mode 100644 index 000000000000..baa5577b05ae --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_create_prompt_data_attributes.rb @@ -0,0 +1,198 @@ +=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 creating an LLM Observability prompt and its first version. + class LLMObsCreatePromptDataAttributes + include BaseGenericModel + + # Description of the prompt. + attr_accessor :description + + # Feature-flag environment UUIDs to enable for this prompt immediately after creation. + attr_accessor :env_ids + + # Labels to attach to the first version. + attr_accessor :labels + + # Customer-provided identifier for the new prompt. + attr_reader :prompt_id + + # A text template or a list of chat messages. + attr_reader :template + + # Title of the prompt. + attr_accessor :title + + # User-supplied version identifier for the first version. + attr_accessor :user_version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'env_ids' => :'env_ids', + :'labels' => :'labels', + :'prompt_id' => :'prompt_id', + :'template' => :'template', + :'title' => :'title', + :'user_version' => :'user_version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'env_ids' => :'Array', + :'labels' => :'Array', + :'prompt_id' => :'String', + :'template' => :'LLMObsPromptTemplate', + :'title' => :'String', + :'user_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::LLMObsCreatePromptDataAttributes` 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?(:'env_ids') + if (value = attributes[:'env_ids']).is_a?(Array) + self.env_ids = value + end + end + + if attributes.key?(:'labels') + if (value = attributes[:'labels']).is_a?(Array) + self.labels = value + end + end + + if attributes.key?(:'prompt_id') + self.prompt_id = attributes[:'prompt_id'] + end + + if attributes.key?(:'template') + self.template = attributes[:'template'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'user_version') + self.user_version = attributes[:'user_version'] + 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 @prompt_id.nil? + return false if @template.nil? + true + end + + # Custom attribute writer method with validation + # @param prompt_id [Object] Object to be assigned + # @!visibility private + def prompt_id=(prompt_id) + if prompt_id.nil? + fail ArgumentError, 'invalid value for "prompt_id", prompt_id cannot be nil.' + end + @prompt_id = prompt_id + end + + # Custom attribute writer method with validation + # @param template [Object] Object to be assigned + # @!visibility private + def template=(template) + if template.nil? + fail ArgumentError, 'invalid value for "template", template cannot be nil.' + end + @template = template + 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 && + env_ids == o.env_ids && + labels == o.labels && + prompt_id == o.prompt_id && + template == o.template && + title == o.title && + user_version == o.user_version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, env_ids, labels, prompt_id, template, title, user_version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_create_prompt_request.rb b/lib/datadog_api_client/v2/models/llm_obs_create_prompt_request.rb new file mode 100644 index 000000000000..93f4c3170fae --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_create_prompt_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 create an LLM Observability prompt. + class LLMObsCreatePromptRequest + include BaseGenericModel + + # Data object for creating an LLM Observability prompt. + 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' => :'LLMObsCreatePromptData' + } + 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::LLMObsCreatePromptRequest` 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_create_prompt_version_data.rb b/lib/datadog_api_client/v2/models/llm_obs_create_prompt_version_data.rb new file mode 100644 index 000000000000..e0454c34ec2b --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_create_prompt_version_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 creating an LLM Observability prompt version. + class LLMObsCreatePromptVersionData + include BaseGenericModel + + # Attributes for creating a new version of an LLM Observability prompt. + attr_reader :attributes + + # Resource type of an LLM Observability prompt version. + 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' => :'LLMObsCreatePromptVersionDataAttributes', + :'type' => :'LLMObsPromptVersionType' + } + 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::LLMObsCreatePromptVersionData` 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_create_prompt_version_data_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_create_prompt_version_data_attributes.rb new file mode 100644 index 000000000000..ebc6ad27810c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_create_prompt_version_data_attributes.rb @@ -0,0 +1,167 @@ +=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 creating a new version of an LLM Observability prompt. + class LLMObsCreatePromptVersionDataAttributes + include BaseGenericModel + + # Description of this version. + attr_accessor :description + + # Feature-flag environment UUIDs whose default variant should be set to this version after creation. + attr_accessor :env_ids + + # Labels to attach to this version. + attr_accessor :labels + + # A text template or a list of chat messages. + attr_reader :template + + # User-supplied version identifier for this version. + attr_accessor :user_version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'env_ids' => :'env_ids', + :'labels' => :'labels', + :'template' => :'template', + :'user_version' => :'user_version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'env_ids' => :'Array', + :'labels' => :'Array', + :'template' => :'LLMObsPromptTemplate', + :'user_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::LLMObsCreatePromptVersionDataAttributes` 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?(:'env_ids') + if (value = attributes[:'env_ids']).is_a?(Array) + self.env_ids = value + end + end + + if attributes.key?(:'labels') + if (value = attributes[:'labels']).is_a?(Array) + self.labels = value + end + end + + if attributes.key?(:'template') + self.template = attributes[:'template'] + end + + if attributes.key?(:'user_version') + self.user_version = attributes[:'user_version'] + 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 @template.nil? + true + end + + # Custom attribute writer method with validation + # @param template [Object] Object to be assigned + # @!visibility private + def template=(template) + if template.nil? + fail ArgumentError, 'invalid value for "template", template cannot be nil.' + end + @template = template + 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 && + env_ids == o.env_ids && + labels == o.labels && + template == o.template && + user_version == o.user_version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, env_ids, labels, template, user_version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_create_prompt_version_request.rb b/lib/datadog_api_client/v2/models/llm_obs_create_prompt_version_request.rb new file mode 100644 index 000000000000..07cfafa321f3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_create_prompt_version_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 create a new version of an LLM Observability prompt. + class LLMObsCreatePromptVersionRequest + include BaseGenericModel + + # Data object for creating an LLM Observability prompt version. + 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' => :'LLMObsCreatePromptVersionData' + } + 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::LLMObsCreatePromptVersionRequest` 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_deleted_prompt_data.rb b/lib/datadog_api_client/v2/models/llm_obs_deleted_prompt_data.rb new file mode 100644 index 000000000000..d9fc9ac38f35 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_deleted_prompt_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 confirming that an LLM Observability prompt was deleted. + class LLMObsDeletedPromptData + include BaseGenericModel + + # Attributes confirming that an LLM Observability prompt was deleted. + attr_reader :attributes + + # Unique identifier of the deleted prompt. + attr_reader :id + + # Resource type of an LLM Observability prompt. + 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' => :'LLMObsDeletedPromptDataAttributes', + :'id' => :'String', + :'type' => :'LLMObsPromptType' + } + 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::LLMObsDeletedPromptData` 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_deleted_prompt_data_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_deleted_prompt_data_attributes.rb new file mode 100644 index 000000000000..6e33711b0141 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_deleted_prompt_data_attributes.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 + # Attributes confirming that an LLM Observability prompt was deleted. + class LLMObsDeletedPromptDataAttributes + include BaseGenericModel + + # Timestamp when the prompt was deleted. + attr_reader :deleted_at + + # Customer-provided identifier of the deleted prompt. + attr_reader :prompt_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'deleted_at' => :'deleted_at', + :'prompt_id' => :'prompt_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'deleted_at' => :'Time', + :'prompt_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::LLMObsDeletedPromptDataAttributes` 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?(:'deleted_at') + self.deleted_at = attributes[:'deleted_at'] + end + + if attributes.key?(:'prompt_id') + self.prompt_id = attributes[:'prompt_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 @deleted_at.nil? + return false if @prompt_id.nil? + true + end + + # Custom attribute writer method with validation + # @param deleted_at [Object] Object to be assigned + # @!visibility private + def deleted_at=(deleted_at) + if deleted_at.nil? + fail ArgumentError, 'invalid value for "deleted_at", deleted_at cannot be nil.' + end + @deleted_at = deleted_at + end + + # Custom attribute writer method with validation + # @param prompt_id [Object] Object to be assigned + # @!visibility private + def prompt_id=(prompt_id) + if prompt_id.nil? + fail ArgumentError, 'invalid value for "prompt_id", prompt_id cannot be nil.' + end + @prompt_id = prompt_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 && + deleted_at == o.deleted_at && + prompt_id == o.prompt_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [deleted_at, prompt_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_deleted_prompt_response.rb b/lib/datadog_api_client/v2/models/llm_obs_deleted_prompt_response.rb new file mode 100644 index 000000000000..a5cb0d7599ce --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_deleted_prompt_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 confirming that an LLM Observability prompt was deleted. + class LLMObsDeletedPromptResponse + include BaseGenericModel + + # Data object confirming that an LLM Observability prompt was deleted. + 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' => :'LLMObsDeletedPromptData' + } + 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::LLMObsDeletedPromptResponse` 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_prompt_chat_message.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_chat_message.rb new file mode 100644 index 000000000000..07accba40a2d --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_chat_message.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 + # A single chat message in a prompt template. + class LLMObsPromptChatMessage + include BaseGenericModel + + # Content of the message. + attr_reader :content + + # Role of the message (for example `system`, `user`, or `assistant`). + attr_reader :role + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'content' => :'content', + :'role' => :'role' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'content' => :'String', + :'role' => :'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::LLMObsPromptChatMessage` 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?(:'role') + self.role = attributes[:'role'] + 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 @content.nil? + return false if @role.nil? + true + end + + # Custom attribute writer method with validation + # @param content [Object] Object to be assigned + # @!visibility private + def content=(content) + if content.nil? + fail ArgumentError, 'invalid value for "content", content cannot be nil.' + end + @content = content + end + + # Custom attribute writer method with validation + # @param role [Object] Object to be assigned + # @!visibility private + def role=(role) + if role.nil? + fail ArgumentError, 'invalid value for "role", role cannot be nil.' + end + @role = role + 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 && + role == o.role && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [content, role, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_prompt_data.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_data.rb new file mode 100644 index 000000000000..76fabae91b1a --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_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 prompt. + class LLMObsPromptData + include BaseGenericModel + + # Attributes of an LLM Observability prompt registry entry. + attr_reader :attributes + + # Unique identifier of the prompt. + attr_reader :id + + # Resource type of an LLM Observability prompt. + 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' => :'LLMObsPromptDataAttributes', + :'id' => :'String', + :'type' => :'LLMObsPromptType' + } + 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::LLMObsPromptData` 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_prompt_data_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_data_attributes.rb new file mode 100644 index 000000000000..4e7eb7883a8f --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_data_attributes.rb @@ -0,0 +1,323 @@ +=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 prompt registry entry. + class LLMObsPromptDataAttributes + include BaseGenericModel + + # UUID of the user who authored the prompt. + attr_accessor :author + + # Timestamp when the prompt was created. + attr_accessor :created_at + + # Source that created the prompt, such as `ui-registry`, `sdk-registry`, or `sdk-instrumentation`. + attr_reader :created_from + + # Datasets observed in runs associated with this prompt. + attr_accessor :datasets + + # Description of the prompt. + attr_accessor :description + + # Source prompt from which this prompt was extracted, when applicable. + attr_accessor :extracted_from + + # Whether the prompt is a registry entry (as opposed to a code-discovered prompt). + attr_reader :in_registry + + # Timestamp of the most recent observed run of this prompt. + attr_accessor :last_seen_at + + # Timestamp when the most recent version of the prompt was created. + attr_accessor :last_version_created_at + + # The ML application this prompt is associated with. + attr_accessor :ml_app + + # ML applications observed running this prompt. + attr_accessor :ml_apps + + # Number of versions of the prompt. + attr_reader :num_versions + + # Customer-provided identifier of the prompt. + attr_reader :prompt_id + + # Whether the prompt was created from the registry or discovered from observed LLM calls. + attr_reader :source + + # Tags observed on runs of this prompt. + attr_accessor :tags + + # Title of the prompt. + attr_accessor :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'author' => :'author', + :'created_at' => :'created_at', + :'created_from' => :'created_from', + :'datasets' => :'datasets', + :'description' => :'description', + :'extracted_from' => :'extracted_from', + :'in_registry' => :'in_registry', + :'last_seen_at' => :'last_seen_at', + :'last_version_created_at' => :'last_version_created_at', + :'ml_app' => :'ml_app', + :'ml_apps' => :'ml_apps', + :'num_versions' => :'num_versions', + :'prompt_id' => :'prompt_id', + :'source' => :'source', + :'tags' => :'tags', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author' => :'String', + :'created_at' => :'Time', + :'created_from' => :'String', + :'datasets' => :'Array', + :'description' => :'String', + :'extracted_from' => :'String', + :'in_registry' => :'Boolean', + :'last_seen_at' => :'Time', + :'last_version_created_at' => :'Time', + :'ml_app' => :'String', + :'ml_apps' => :'Array', + :'num_versions' => :'Integer', + :'prompt_id' => :'String', + :'source' => :'LLMObsPromptResponseSource', + :'tags' => :'Array', + :'title' => :'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::LLMObsPromptDataAttributes` 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?(:'author') + self.author = attributes[:'author'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_from') + self.created_from = attributes[:'created_from'] + end + + if attributes.key?(:'datasets') + if (value = attributes[:'datasets']).is_a?(Array) + self.datasets = value + end + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'extracted_from') + self.extracted_from = attributes[:'extracted_from'] + end + + if attributes.key?(:'in_registry') + self.in_registry = attributes[:'in_registry'] + end + + if attributes.key?(:'last_seen_at') + self.last_seen_at = attributes[:'last_seen_at'] + end + + if attributes.key?(:'last_version_created_at') + self.last_version_created_at = attributes[:'last_version_created_at'] + end + + if attributes.key?(:'ml_app') + self.ml_app = attributes[:'ml_app'] + end + + if attributes.key?(:'ml_apps') + if (value = attributes[:'ml_apps']).is_a?(Array) + self.ml_apps = value + end + end + + if attributes.key?(:'num_versions') + self.num_versions = attributes[:'num_versions'] + end + + if attributes.key?(:'prompt_id') + self.prompt_id = attributes[:'prompt_id'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + 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_from.nil? + return false if @in_registry.nil? + return false if @num_versions.nil? + return false if @prompt_id.nil? + return false if @source.nil? + true + end + + # Custom attribute writer method with validation + # @param created_from [Object] Object to be assigned + # @!visibility private + def created_from=(created_from) + if created_from.nil? + fail ArgumentError, 'invalid value for "created_from", created_from cannot be nil.' + end + @created_from = created_from + end + + # Custom attribute writer method with validation + # @param in_registry [Object] Object to be assigned + # @!visibility private + def in_registry=(in_registry) + if in_registry.nil? + fail ArgumentError, 'invalid value for "in_registry", in_registry cannot be nil.' + end + @in_registry = in_registry + end + + # Custom attribute writer method with validation + # @param num_versions [Object] Object to be assigned + # @!visibility private + def num_versions=(num_versions) + if num_versions.nil? + fail ArgumentError, 'invalid value for "num_versions", num_versions cannot be nil.' + end + @num_versions = num_versions + end + + # Custom attribute writer method with validation + # @param prompt_id [Object] Object to be assigned + # @!visibility private + def prompt_id=(prompt_id) + if prompt_id.nil? + fail ArgumentError, 'invalid value for "prompt_id", prompt_id cannot be nil.' + end + @prompt_id = prompt_id + end + + # Custom attribute writer method with validation + # @param source [Object] Object to be assigned + # @!visibility private + def source=(source) + if source.nil? + fail ArgumentError, 'invalid value for "source", source cannot be nil.' + end + @source = source + 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 && + author == o.author && + created_at == o.created_at && + created_from == o.created_from && + datasets == o.datasets && + description == o.description && + extracted_from == o.extracted_from && + in_registry == o.in_registry && + last_seen_at == o.last_seen_at && + last_version_created_at == o.last_version_created_at && + ml_app == o.ml_app && + ml_apps == o.ml_apps && + num_versions == o.num_versions && + prompt_id == o.prompt_id && + source == o.source && + tags == o.tags && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author, created_at, created_from, datasets, description, extracted_from, in_registry, last_seen_at, last_version_created_at, ml_app, ml_apps, num_versions, prompt_id, source, tags, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_prompt_dataset.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_dataset.rb new file mode 100644 index 000000000000..20e9523e4b2c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_dataset.rb @@ -0,0 +1,133 @@ +=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 dataset observed in runs associated with a prompt or prompt version. + class LLMObsPromptDataset + include BaseGenericModel + + # Unique identifier of the dataset. + attr_reader :id + + # Name of the dataset. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'name' => :'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::LLMObsPromptDataset` 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?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + 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 @id.nil? + true + 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 + + # 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 && + id == o.id && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_prompt_response.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_response.rb new file mode 100644 index 000000000000..bdebec650f06 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_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 a single LLM Observability prompt. + class LLMObsPromptResponse + include BaseGenericModel + + # Data object for an LLM Observability prompt. + 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' => :'LLMObsPromptData' + } + 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::LLMObsPromptResponse` 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_prompt_response_source.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_response_source.rb new file mode 100644 index 000000000000..059d7aea148c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_response_source.rb @@ -0,0 +1,27 @@ +=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 + # Whether the prompt was created from the registry or discovered from observed LLM calls. + class LLMObsPromptResponseSource + include BaseEnumModel + + REGISTRY = "registry".freeze + CODE = "code".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_prompt_sdk_data.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_sdk_data.rb new file mode 100644 index 000000000000..00da4db811a8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_sdk_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 a flattened LLM Observability prompt version returned for SDK consumption. + class LLMObsPromptSDKData + include BaseGenericModel + + # Attributes of a flattened prompt version returned for SDK consumption. Exactly one of `template` and `chat_template` is returned. + attr_reader :attributes + + # Unique identifier of the prompt. + attr_reader :id + + # Resource type of an LLM Observability prompt. + 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' => :'LLMObsPromptSDKDataAttributes', + :'id' => :'String', + :'type' => :'LLMObsPromptType' + } + 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::LLMObsPromptSDKData` 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_prompt_sdk_data_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_sdk_data_attributes.rb new file mode 100644 index 000000000000..4650cfcbef37 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_sdk_data_attributes.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 + # Attributes of a flattened prompt version returned for SDK consumption. Exactly one of `template` and `chat_template` is returned. + class LLMObsPromptSDKDataAttributes + include BaseGenericModel + + # Chat template for this prompt version, as a list of role/content messages. Omitted for text templates. + attr_accessor :chat_template + + # The label requested through the `label` query parameter. Empty if no label was requested. + attr_accessor :label + + # Customer-provided identifier of the prompt. + attr_accessor :prompt_id + + # Unique identifier of this prompt version. + attr_accessor :prompt_version_uuid + + # Text template for this prompt version. Omitted for chat templates. + attr_accessor :template + + # Version identifier for this prompt version. This is the sequential version number unless a user-supplied version label was set, in which case that label is used instead. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'chat_template' => :'chat_template', + :'label' => :'label', + :'prompt_id' => :'prompt_id', + :'prompt_version_uuid' => :'prompt_version_uuid', + :'template' => :'template', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'chat_template' => :'Array', + :'label' => :'String', + :'prompt_id' => :'String', + :'prompt_version_uuid' => :'String', + :'template' => :'String', + :'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::LLMObsPromptSDKDataAttributes` 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?(:'chat_template') + if (value = attributes[:'chat_template']).is_a?(Array) + self.chat_template = value + end + end + + if attributes.key?(:'label') + self.label = attributes[:'label'] + end + + if attributes.key?(:'prompt_id') + self.prompt_id = attributes[:'prompt_id'] + end + + if attributes.key?(:'prompt_version_uuid') + self.prompt_version_uuid = attributes[:'prompt_version_uuid'] + end + + if attributes.key?(:'template') + self.template = attributes[:'template'] + 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 && + chat_template == o.chat_template && + label == o.label && + prompt_id == o.prompt_id && + prompt_version_uuid == o.prompt_version_uuid && + template == o.template && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [chat_template, label, prompt_id, prompt_version_uuid, template, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_prompt_sdk_response.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_sdk_response.rb new file mode 100644 index 000000000000..20da3e24ff02 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_sdk_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 a flattened LLM Observability prompt version for SDK consumption. + class LLMObsPromptSDKResponse + include BaseGenericModel + + # Data object for a flattened LLM Observability prompt version returned for SDK consumption. + 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' => :'LLMObsPromptSDKData' + } + 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::LLMObsPromptSDKResponse` 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_prompt_template.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_template.rb new file mode 100644 index 000000000000..621a7e715f87 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_template.rb @@ -0,0 +1,63 @@ +=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 text template or a list of chat messages. + module LLMObsPromptTemplate + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'String', + :'Array' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_prompt_type.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_type.rb new file mode 100644 index 000000000000..cae84be401ea --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_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 of an LLM Observability prompt. + class LLMObsPromptType + include BaseEnumModel + + PROMPT_TEMPLATES = "prompt-templates".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_prompt_version_data.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_version_data.rb new file mode 100644 index 000000000000..44d6909b37d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_version_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 a specific version of an LLM Observability prompt. + class LLMObsPromptVersionData + include BaseGenericModel + + # Attributes of a specific version of an LLM Observability prompt. + attr_reader :attributes + + # Unique identifier of the prompt version. + attr_reader :id + + # Resource type of an LLM Observability prompt version. + 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' => :'LLMObsPromptVersionDataAttributes', + :'id' => :'String', + :'type' => :'LLMObsPromptVersionType' + } + 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::LLMObsPromptVersionData` 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_prompt_version_data_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_version_data_attributes.rb new file mode 100644 index 000000000000..bd6644aa93f9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_version_data_attributes.rb @@ -0,0 +1,308 @@ +=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 specific version of an LLM Observability prompt. + class LLMObsPromptVersionDataAttributes + include BaseGenericModel + + # UUID of the user who authored this version. + attr_accessor :author + + # Timestamp stored on this prompt version. + attr_accessor :created_at + + # Datasets observed in runs associated with this prompt version. + attr_accessor :datasets + + # Description of this version. + attr_accessor :description + + # Labels attached to this version (for example `development`, `staging`, `production`). + attr_accessor :labels + + # Timestamp of the most recent observed run of this prompt version. + attr_accessor :last_seen_at + + # The ML application this prompt is associated with. + attr_accessor :ml_app + + # ML applications observed running this prompt version. + attr_accessor :ml_apps + + # Customer-provided identifier of the parent prompt. + attr_reader :prompt_id + + # Unique identifier of the parent prompt. + attr_reader :prompt_uuid + + # Tags observed on runs of this prompt version. + attr_accessor :tags + + # A text template or a list of chat messages. + attr_reader :template + + # User-supplied label for this version. + attr_accessor :user_version + + # Sequential version number. + attr_reader :version + + # Timestamp when this version was created. + attr_accessor :version_created_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'author' => :'author', + :'created_at' => :'created_at', + :'datasets' => :'datasets', + :'description' => :'description', + :'labels' => :'labels', + :'last_seen_at' => :'last_seen_at', + :'ml_app' => :'ml_app', + :'ml_apps' => :'ml_apps', + :'prompt_id' => :'prompt_id', + :'prompt_uuid' => :'prompt_uuid', + :'tags' => :'tags', + :'template' => :'template', + :'user_version' => :'user_version', + :'version' => :'version', + :'version_created_at' => :'version_created_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author' => :'String', + :'created_at' => :'Time', + :'datasets' => :'Array', + :'description' => :'String', + :'labels' => :'Array', + :'last_seen_at' => :'Time', + :'ml_app' => :'String', + :'ml_apps' => :'Array', + :'prompt_id' => :'String', + :'prompt_uuid' => :'String', + :'tags' => :'Array', + :'template' => :'LLMObsPromptTemplate', + :'user_version' => :'String', + :'version' => :'Integer', + :'version_created_at' => :'Time' + } + 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::LLMObsPromptVersionDataAttributes` 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?(:'author') + self.author = attributes[:'author'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'datasets') + if (value = attributes[:'datasets']).is_a?(Array) + self.datasets = value + end + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'labels') + if (value = attributes[:'labels']).is_a?(Array) + self.labels = value + end + end + + if attributes.key?(:'last_seen_at') + self.last_seen_at = attributes[:'last_seen_at'] + end + + if attributes.key?(:'ml_app') + self.ml_app = attributes[:'ml_app'] + end + + if attributes.key?(:'ml_apps') + if (value = attributes[:'ml_apps']).is_a?(Array) + self.ml_apps = value + end + end + + if attributes.key?(:'prompt_id') + self.prompt_id = attributes[:'prompt_id'] + end + + if attributes.key?(:'prompt_uuid') + self.prompt_uuid = attributes[:'prompt_uuid'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'template') + self.template = attributes[:'template'] + end + + if attributes.key?(:'user_version') + self.user_version = attributes[:'user_version'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + + if attributes.key?(:'version_created_at') + self.version_created_at = attributes[:'version_created_at'] + 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 @prompt_id.nil? + return false if @prompt_uuid.nil? + return false if @template.nil? + return false if @version.nil? + return false if @version < 1 + true + end + + # Custom attribute writer method with validation + # @param prompt_id [Object] Object to be assigned + # @!visibility private + def prompt_id=(prompt_id) + if prompt_id.nil? + fail ArgumentError, 'invalid value for "prompt_id", prompt_id cannot be nil.' + end + @prompt_id = prompt_id + end + + # Custom attribute writer method with validation + # @param prompt_uuid [Object] Object to be assigned + # @!visibility private + def prompt_uuid=(prompt_uuid) + if prompt_uuid.nil? + fail ArgumentError, 'invalid value for "prompt_uuid", prompt_uuid cannot be nil.' + end + @prompt_uuid = prompt_uuid + end + + # Custom attribute writer method with validation + # @param template [Object] Object to be assigned + # @!visibility private + def template=(template) + if template.nil? + fail ArgumentError, 'invalid value for "template", template cannot be nil.' + end + @template = template + end + + # Custom attribute writer method with validation + # @param version [Object] Object to be assigned + # @!visibility private + def version=(version) + if version.nil? + fail ArgumentError, 'invalid value for "version", version cannot be nil.' + end + if version < 1 + fail ArgumentError, 'invalid value for "version", must be greater than or equal to 1.' + end + @version = version + 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 && + author == o.author && + created_at == o.created_at && + datasets == o.datasets && + description == o.description && + labels == o.labels && + last_seen_at == o.last_seen_at && + ml_app == o.ml_app && + ml_apps == o.ml_apps && + prompt_id == o.prompt_id && + prompt_uuid == o.prompt_uuid && + tags == o.tags && + template == o.template && + user_version == o.user_version && + version == o.version && + version_created_at == o.version_created_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author, created_at, datasets, description, labels, last_seen_at, ml_app, ml_apps, prompt_id, prompt_uuid, tags, template, user_version, version, version_created_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_prompt_version_list_data.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_version_list_data.rb new file mode 100644 index 000000000000..f925f649b06d --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_version_list_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 a prompt version returned in a list. + class LLMObsPromptVersionListData + include BaseGenericModel + + # Attributes of a prompt version returned in a list, excluding its template. + attr_reader :attributes + + # Unique identifier of the prompt version. + attr_reader :id + + # Resource type of an LLM Observability prompt version. + 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' => :'LLMObsPromptVersionListDataAttributes', + :'id' => :'String', + :'type' => :'LLMObsPromptVersionType' + } + 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::LLMObsPromptVersionListData` 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_prompt_version_list_data_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_version_list_data_attributes.rb new file mode 100644 index 000000000000..c34b3ff4cd12 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_version_list_data_attributes.rb @@ -0,0 +1,287 @@ +=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 prompt version returned in a list, excluding its template. + class LLMObsPromptVersionListDataAttributes + include BaseGenericModel + + # UUID of the user who authored this version. + attr_accessor :author + + # Timestamp stored on this prompt version. + attr_accessor :created_at + + # Datasets observed in runs associated with this prompt version. + attr_accessor :datasets + + # Description of this version. + attr_accessor :description + + # Labels attached to this version (for example `development`, `staging`, `production`). + attr_accessor :labels + + # Timestamp of the most recent observed run of this prompt version. + attr_accessor :last_seen_at + + # The ML application this prompt is associated with. + attr_accessor :ml_app + + # ML applications observed running this prompt version. + attr_accessor :ml_apps + + # Customer-provided identifier of the parent prompt. + attr_reader :prompt_id + + # Unique identifier of the parent prompt. + attr_reader :prompt_uuid + + # Tags observed on runs of this prompt version. + attr_accessor :tags + + # User-supplied label for this version. + attr_accessor :user_version + + # Sequential version number. + attr_reader :version + + # Timestamp when this version was created. + attr_accessor :version_created_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'author' => :'author', + :'created_at' => :'created_at', + :'datasets' => :'datasets', + :'description' => :'description', + :'labels' => :'labels', + :'last_seen_at' => :'last_seen_at', + :'ml_app' => :'ml_app', + :'ml_apps' => :'ml_apps', + :'prompt_id' => :'prompt_id', + :'prompt_uuid' => :'prompt_uuid', + :'tags' => :'tags', + :'user_version' => :'user_version', + :'version' => :'version', + :'version_created_at' => :'version_created_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author' => :'String', + :'created_at' => :'Time', + :'datasets' => :'Array', + :'description' => :'String', + :'labels' => :'Array', + :'last_seen_at' => :'Time', + :'ml_app' => :'String', + :'ml_apps' => :'Array', + :'prompt_id' => :'String', + :'prompt_uuid' => :'String', + :'tags' => :'Array', + :'user_version' => :'String', + :'version' => :'Integer', + :'version_created_at' => :'Time' + } + 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::LLMObsPromptVersionListDataAttributes` 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?(:'author') + self.author = attributes[:'author'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'datasets') + if (value = attributes[:'datasets']).is_a?(Array) + self.datasets = value + end + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'labels') + if (value = attributes[:'labels']).is_a?(Array) + self.labels = value + end + end + + if attributes.key?(:'last_seen_at') + self.last_seen_at = attributes[:'last_seen_at'] + end + + if attributes.key?(:'ml_app') + self.ml_app = attributes[:'ml_app'] + end + + if attributes.key?(:'ml_apps') + if (value = attributes[:'ml_apps']).is_a?(Array) + self.ml_apps = value + end + end + + if attributes.key?(:'prompt_id') + self.prompt_id = attributes[:'prompt_id'] + end + + if attributes.key?(:'prompt_uuid') + self.prompt_uuid = attributes[:'prompt_uuid'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'user_version') + self.user_version = attributes[:'user_version'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + + if attributes.key?(:'version_created_at') + self.version_created_at = attributes[:'version_created_at'] + 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 @prompt_id.nil? + return false if @prompt_uuid.nil? + return false if @version.nil? + return false if @version < 1 + true + end + + # Custom attribute writer method with validation + # @param prompt_id [Object] Object to be assigned + # @!visibility private + def prompt_id=(prompt_id) + if prompt_id.nil? + fail ArgumentError, 'invalid value for "prompt_id", prompt_id cannot be nil.' + end + @prompt_id = prompt_id + end + + # Custom attribute writer method with validation + # @param prompt_uuid [Object] Object to be assigned + # @!visibility private + def prompt_uuid=(prompt_uuid) + if prompt_uuid.nil? + fail ArgumentError, 'invalid value for "prompt_uuid", prompt_uuid cannot be nil.' + end + @prompt_uuid = prompt_uuid + end + + # Custom attribute writer method with validation + # @param version [Object] Object to be assigned + # @!visibility private + def version=(version) + if version.nil? + fail ArgumentError, 'invalid value for "version", version cannot be nil.' + end + if version < 1 + fail ArgumentError, 'invalid value for "version", must be greater than or equal to 1.' + end + @version = version + 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 && + author == o.author && + created_at == o.created_at && + datasets == o.datasets && + description == o.description && + labels == o.labels && + last_seen_at == o.last_seen_at && + ml_app == o.ml_app && + ml_apps == o.ml_apps && + prompt_id == o.prompt_id && + prompt_uuid == o.prompt_uuid && + tags == o.tags && + user_version == o.user_version && + version == o.version && + version_created_at == o.version_created_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author, created_at, datasets, description, labels, last_seen_at, ml_app, ml_apps, prompt_id, prompt_uuid, tags, user_version, version, version_created_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_prompt_version_response.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_version_response.rb new file mode 100644 index 000000000000..8ee6c28fdfc5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_version_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 a specific version of an LLM Observability prompt. + class LLMObsPromptVersionResponse + include BaseGenericModel + + # Data object for a specific version of an LLM Observability prompt. + 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' => :'LLMObsPromptVersionData' + } + 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::LLMObsPromptVersionResponse` 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_prompt_version_type.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_version_type.rb new file mode 100644 index 000000000000..fc12d7ca3e97 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_version_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 of an LLM Observability prompt version. + class LLMObsPromptVersionType + include BaseEnumModel + + PROMPT_TEMPLATE_VERSIONS = "prompt-template-versions".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_prompt_versions_response.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_versions_response.rb new file mode 100644 index 000000000000..aa02c541dff9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_versions_response.rb @@ -0,0 +1,125 @@ +=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 the versions of an LLM Observability prompt. + class LLMObsPromptVersionsResponse + include BaseGenericModel + + # Prompt versions ordered from newest to oldest. + 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' => :'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::LLMObsPromptVersionsResponse` 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 + 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_prompts_response.rb b/lib/datadog_api_client/v2/models/llm_obs_prompts_response.rb new file mode 100644 index 000000000000..4c4266095b0d --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompts_response.rb @@ -0,0 +1,125 @@ +=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 prompts. + class LLMObsPromptsResponse + include BaseGenericModel + + # List of LLM Observability prompts. + 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' => :'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::LLMObsPromptsResponse` 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 + 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_update_prompt_data.rb b/lib/datadog_api_client/v2/models/llm_obs_update_prompt_data.rb new file mode 100644 index 000000000000..0109de211b97 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_update_prompt_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 updating an LLM Observability prompt. + class LLMObsUpdatePromptData + include BaseGenericModel + + # Attributes for updating an LLM Observability prompt. At least one field must be provided. + attr_reader :attributes + + # Resource type of an LLM Observability prompt. + 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' => :'LLMObsUpdatePromptDataAttributes', + :'type' => :'LLMObsPromptType' + } + 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::LLMObsUpdatePromptData` 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_update_prompt_data_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_update_prompt_data_attributes.rb new file mode 100644 index 000000000000..737bad77b07e --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_update_prompt_data_attributes.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 + # Attributes for updating an LLM Observability prompt. At least one field must be provided. + class LLMObsUpdatePromptDataAttributes + include BaseGenericModel + + # New description for the prompt. + attr_accessor :description + + # New title for the prompt. + attr_accessor :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'title' => :'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::LLMObsUpdatePromptDataAttributes` 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?(:'title') + self.title = attributes[:'title'] + 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 && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_update_prompt_request.rb b/lib/datadog_api_client/v2/models/llm_obs_update_prompt_request.rb new file mode 100644 index 000000000000..6ffbc50fa032 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_update_prompt_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 update an LLM Observability prompt's metadata. + class LLMObsUpdatePromptRequest + include BaseGenericModel + + # Data object for updating an LLM Observability prompt. + 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' => :'LLMObsUpdatePromptData' + } + 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::LLMObsUpdatePromptRequest` 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_update_prompt_version_data.rb b/lib/datadog_api_client/v2/models/llm_obs_update_prompt_version_data.rb new file mode 100644 index 000000000000..ea5dff232ef5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_update_prompt_version_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 updating an LLM Observability prompt version. + class LLMObsUpdatePromptVersionData + include BaseGenericModel + + # Attributes for updating an LLM Observability prompt version. At least one field must be provided. + attr_reader :attributes + + # Resource type of an LLM Observability prompt version. + 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' => :'LLMObsUpdatePromptVersionDataAttributes', + :'type' => :'LLMObsPromptVersionType' + } + 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::LLMObsUpdatePromptVersionData` 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_update_prompt_version_data_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_update_prompt_version_data_attributes.rb new file mode 100644 index 000000000000..8b3687c476a3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_update_prompt_version_data_attributes.rb @@ -0,0 +1,129 @@ +=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 updating an LLM Observability prompt version. At least one field must be provided. + class LLMObsUpdatePromptVersionDataAttributes + include BaseGenericModel + + # New description for this version. + attr_accessor :description + + # Feature-flag environment UUIDs whose default variant should be set to this version. + attr_accessor :env_ids + + # New labels for this version. + attr_accessor :labels + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'env_ids' => :'env_ids', + :'labels' => :'labels' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'env_ids' => :'Array', + :'labels' => :'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::LLMObsUpdatePromptVersionDataAttributes` 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?(:'env_ids') + if (value = attributes[:'env_ids']).is_a?(Array) + self.env_ids = value + end + end + + if attributes.key?(:'labels') + if (value = attributes[:'labels']).is_a?(Array) + self.labels = 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 && + description == o.description && + env_ids == o.env_ids && + labels == o.labels && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, env_ids, labels, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_update_prompt_version_request.rb b/lib/datadog_api_client/v2/models/llm_obs_update_prompt_version_request.rb new file mode 100644 index 000000000000..7b5673615830 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_update_prompt_version_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 update an LLM Observability prompt version's metadata or feature-flag environments. + class LLMObsUpdatePromptVersionRequest + include BaseGenericModel + + # Data object for updating an LLM Observability prompt version. + 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' => :'LLMObsUpdatePromptVersionData' + } + 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::LLMObsUpdatePromptVersionRequest` 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