diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6c01d9a66b42..bed8d5118405 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: "customer-support-assistant" + in: path + name: prompt_id + required: true + schema: + type: string + LLMObsPromptLabelQueryParameter: + description: >- + **Deprecated.** Optional label of the prompt version to return. Do not use this parameter for new integrations. If omitted, the latest version is returned. If the prompt has no labels, the latest version is returned even when a label is requested. If the prompt has labels but none match the requested label, a 404 response is returned. + 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 @@ -52073,6 +52099,108 @@ 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. `prompt_id` and `template` are required; all other attributes are optional. + properties: + description: + description: Optional description of the prompt. + type: string + env_ids: + description: >- + Optional feature-flag environment UUIDs the service attempts to enable and configure to use the first version as their default after creation. + items: + type: string + type: array + labels: + deprecated: true + description: >- + Optional labels to attach to the first version. Do not use this attribute for new integrations. + items: + $ref: "#/components/schemas/LLMObsPromptVersionLabel" + type: array + prompt_id: + description: Customer-provided identifier for the new prompt. + example: "customer-support-assistant" + minLength: 1 + type: string + template: + $ref: "#/components/schemas/LLMObsPromptTemplate" + title: + description: Optional title of the prompt. + type: string + user_version: + description: Optional 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. `template` is required; all other attributes are optional. + properties: + description: + description: Optional description of this version. + type: string + env_ids: + description: >- + Optional feature-flag environment UUIDs the service attempts to enable and configure to use this version as their default after creation. + items: + type: string + type: array + labels: + deprecated: true + description: Optional labels to attach to this version. Do not use this attribute for new integrations. + items: + $ref: "#/components/schemas/LLMObsPromptVersionLabel" + type: array + template: + $ref: "#/components/schemas/LLMObsPromptTemplate" + user_version: + description: Optional 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: @@ -53548,6 +53676,53 @@ 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: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + 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: "2025-02-10T09:15:00Z" + format: date-time + type: string + prompt_id: + description: Customer-provided identifier of the deleted prompt. + example: "customer-support-assistant" + type: string + required: + - prompt_id + - deleted_at + type: object + LLMObsDeletedPromptResponse: + description: Response confirming that an LLM Observability prompt was deleted. + example: + data: + attributes: + deleted_at: "2025-02-10T09:15:00Z" + prompt_id: "customer-support-assistant" + id: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + type: prompt-templates + properties: + data: + $ref: "#/components/schemas/LLMObsDeletedPromptData" + required: + - data + type: object LLMObsDisplayBlockAnnotatedInteractionItem: description: A display_block interaction with its associated annotations. properties: @@ -56642,6 +56817,521 @@ components: required: - data type: object + LLMObsPromptChatMessage: + description: A single chat message in a prompt template. + properties: + content: + description: Content of the message. + example: "You are a helpful customer support assistant for {{company_name}}." + type: string + role: + description: Role of the message (for example `system`, `user`, or `assistant`). + example: "system" + 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: "sdk-registry" + 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: true + 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: 2 + format: int64 + type: integer + prompt_id: + description: Customer-provided identifier of the prompt. + example: "customer-support-assistant" + 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. + example: + data: + attributes: + author: "3b12f1df-14fd-4e12-bd6f-4a2f5c8b3d1e" + created_at: "2025-01-15T10:00:00Z" + created_from: "sdk-registry" + description: "Answers customer questions using the company knowledge base." + in_registry: true + last_version_created_at: "2025-01-15T10:00:00Z" + num_versions: 1 + prompt_id: "customer-support-assistant" + source: registry + title: "Customer Support Assistant" + id: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + type: prompt-templates + 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: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + 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 and content messages. Omitted for text templates. + items: + $ref: "#/components/schemas/LLMObsPromptChatMessage" + type: array + labels: + deprecated: true + description: Labels attached to the selected version. + items: + type: string + type: array + prompt_id: + description: Customer-provided identifier of the prompt. + example: "customer-support-assistant" + type: string + prompt_version_uuid: + description: Unique identifier of this prompt version. + example: "d83ab666-61cc-5545-a83b-2424bb85467b" + 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 identifier was set, in which case that identifier is used instead. + example: "2" + type: string + type: object + LLMObsPromptSDKResponse: + description: Response containing a flattened LLM Observability prompt version for SDK consumption. + example: + data: + attributes: + chat_template: + - content: "You are a helpful customer support assistant for {{company_name}}." + role: "system" + - content: "Help {{customer_name}} with this question: {{question}}" + role: "user" + prompt_id: "customer-support-assistant" + prompt_version_uuid: "d83ab666-61cc-5545-a83b-2424bb85467b" + version: "2" + id: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + type: prompt-templates + properties: + data: + $ref: "#/components/schemas/LLMObsPromptSDKData" + required: + - data + type: object + LLMObsPromptTemplate: + description: A text template or a list of chat messages. + example: "You are a helpful assistant for {{audience}}." + oneOf: + - $ref: "#/components/schemas/LLMObsPromptTextTemplate" + - $ref: "#/components/schemas/LLMObsPromptChatTemplate" + LLMObsPromptTextTemplate: + description: A text prompt template. + minLength: 1 + pattern: ".*\\S.*" + 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: "d83ab666-61cc-5545-a83b-2424bb85467b" + 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: + deprecated: true + 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: "customer-support-assistant" + type: string + prompt_uuid: + description: Unique identifier of the parent prompt. + example: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + 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 identifier 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 + LLMObsPromptVersionLabel: + description: A label attached to an LLM Observability prompt version. + enum: + - production + - development + type: string + x-enum-varnames: + - PRODUCTION + - DEVELOPMENT + 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: "d83ab666-61cc-5545-a83b-2424bb85467b" + 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: + deprecated: true + 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: "customer-support-assistant" + type: string + prompt_uuid: + description: Unique identifier of the parent prompt. + example: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + type: string + tags: + description: Tags observed on runs of this prompt version. + items: + type: string + type: array + user_version: + description: User-supplied identifier 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. + example: + data: + attributes: + author: "3b12f1df-14fd-4e12-bd6f-4a2f5c8b3d1e" + created_at: "2025-02-01T14:30:00Z" + description: "Give concise answers and cite relevant help-center articles." + prompt_id: "customer-support-assistant" + prompt_uuid: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + template: + - content: "You are a helpful customer support assistant for {{company_name}}." + role: "system" + - content: "Help {{customer_name}} with this question: {{question}}" + role: "user" + version: 2 + version_created_at: "2025-02-01T14:30:00Z" + id: "d83ab666-61cc-5545-a83b-2424bb85467b" + type: prompt-template-versions + 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. + example: + data: + - attributes: + author: "3b12f1df-14fd-4e12-bd6f-4a2f5c8b3d1e" + created_at: "2025-02-01T14:30:00Z" + description: "Give concise answers and cite relevant help-center articles." + prompt_id: "customer-support-assistant" + prompt_uuid: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + version: 2 + version_created_at: "2025-02-01T14:30:00Z" + id: "d83ab666-61cc-5545-a83b-2424bb85467b" + type: prompt-template-versions + - attributes: + author: "3b12f1df-14fd-4e12-bd6f-4a2f5c8b3d1e" + created_at: "2025-01-15T10:00:00Z" + description: "Initial customer support prompt." + prompt_id: "customer-support-assistant" + prompt_uuid: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + version: 1 + version_created_at: "2025-01-15T10:00:00Z" + id: "20e5280b-c75d-5699-8a70-a2773a751428" + type: prompt-template-versions + 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. + example: + data: + - attributes: + author: "3b12f1df-14fd-4e12-bd6f-4a2f5c8b3d1e" + created_at: "2025-01-15T10:00:00Z" + created_from: "sdk-registry" + description: "Answers customer questions using the company knowledge base." + in_registry: true + last_version_created_at: "2025-02-01T14:30:00Z" + num_versions: 2 + prompt_id: "customer-support-assistant" + source: registry + title: "Customer Support Assistant" + id: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + type: prompt-templates + 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: @@ -57135,6 +57825,79 @@ 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: + additionalProperties: false + description: >- + Attributes for updating an LLM Observability prompt. At least one of `title` or `description` must be provided; both attributes are optional individually. + minProperties: 1 + properties: + description: + description: Optional new description for the prompt. + type: string + title: + description: Optional 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: + additionalProperties: false + description: >- + Attributes for updating an LLM Observability prompt version. At least one of `description`, `labels`, or `env_ids` must be provided; all three attributes are optional individually. + minProperties: 1 + properties: + description: + description: Optional new description for this version. + type: string + env_ids: + description: >- + Optional feature-flag environment UUIDs the service attempts to enable and configure to use this version as their default. + items: + type: string + type: array + labels: + deprecated: true + description: Optional new labels for this version. Do not use this attribute for new integrations. + items: + $ref: "#/components/schemas/LLMObsPromptVersionLabel" + 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 @@ -151608,18 +152371,700 @@ 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 organization. + operationId: ListLLMObsPrompts + parameters: + - description: Optional filter for prompts by prompt ID. + example: "customer-support-assistant" + in: query + name: filter[prompt_id] + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + author: "3b12f1df-14fd-4e12-bd6f-4a2f5c8b3d1e" + created_at: "2025-01-15T10:00:00Z" + created_from: "sdk-registry" + description: "Answers customer questions using the company knowledge base." + in_registry: true + last_version_created_at: "2025-02-01T14:30:00Z" + num_versions: 2 + prompt_id: "customer-support-assistant" + source: registry + title: "Customer Support Assistant" + id: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + type: prompt-templates + schema: + $ref: "#/components/schemas/LLMObsPromptsResponse" + description: OK + "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-permission: + operator: OR + permissions: + - llm_observability_read + 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: + description: "Answers customer questions using the company knowledge base." + prompt_id: "customer-support-assistant" + template: + - content: "You are a helpful customer support assistant for {{company_name}}." + role: "system" + - content: "Help {{customer_name}} with this question: {{question}}" + role: "user" + title: "Customer Support Assistant" + 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-15T10:00:00Z" + created_from: "sdk-registry" + description: "Answers customer questions using the company knowledge base." + in_registry: true + last_version_created_at: "2025-01-15T10:00:00Z" + num_versions: 1 + prompt_id: "customer-support-assistant" + source: registry + title: "Customer Support Assistant" + 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-permission: + operator: AND + permissions: + - llm_observability_read + - llm_observability_write + - feature_flag_config_read + - feature_flag_config_write + - feature_flag_environment_config_read + 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-02-10T09:15:00Z" + prompt_id: "customer-support-assistant" + 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-permission: + operator: AND + permissions: + - llm_observability_read + - llm_observability_write + - feature_flag_config_read + - feature_flag_config_write + - feature_flag_environment_config_read 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: @@ -151627,22 +153072,21 @@ 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 helpful customer support assistant for {{company_name}}." + role: "system" + - content: "Help {{customer_name}} with this question: {{question}}" + role: "user" + prompt_id: "customer-support-assistant" + prompt_version_uuid: "d83ab666-61cc-5545-a83b-2424bb85467b" + version: "2" + id: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + 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: @@ -151655,39 +153099,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-permission: + operator: OR + permissions: + - llm_observability_read 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, the description, or both, for an LLM Observability prompt. + 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: + description: "Answers customer questions using the company knowledge base." + title: "Customer Support Assistant" + type: prompt-templates schema: - $ref: "#/components/schemas/LLMObsIntegrationInferenceRequest" - description: Inference request parameters. + $ref: "#/components/schemas/LLMObsUpdatePromptRequest" + description: Update prompt payload. required: true responses: "200": @@ -151696,24 +153147,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-15T10:00:00Z" + created_from: "sdk-registry" + description: "Answers customer questions using the company knowledge base." + in_registry: true + last_version_created_at: "2025-01-15T10:00:00Z" + num_versions: 1 + prompt_id: "customer-support-assistant" + source: registry + title: "Customer Support Assistant" + id: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + type: prompt-templates schema: - $ref: "#/components/schemas/LLMObsIntegrationInferenceResponse" + $ref: "#/components/schemas/LLMObsPromptResponse" description: OK "400": content: @@ -151733,106 +153182,38 @@ 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-permission: + operator: AND + permissions: + - llm_observability_read + - llm_observability_write + - feature_flag_config_read + - feature_flag_config_write + - feature_flag_environment_config_read 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. If the prompt does not exist, is not registered, or is archived, the response contains an empty list. + 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: @@ -151842,21 +153223,28 @@ 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-02-01T14:30:00Z" + description: "Give concise answers and cite relevant help-center articles." + prompt_id: "customer-support-assistant" + prompt_uuid: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + version: 2 + version_created_at: "2025-02-01T14:30:00Z" + id: "d83ab666-61cc-5545-a83b-2424bb85467b" + type: prompt-template-versions + - attributes: + author: "3b12f1df-14fd-4e12-bd6f-4a2f5c8b3d1e" + created_at: "2025-01-15T10:00:00Z" + description: "Initial customer support prompt." + prompt_id: "customer-support-assistant" + prompt_uuid: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + version: 1 + version_created_at: "2025-01-15T10:00:00Z" + id: "20e5280b-c75d-5699-8a70-a2773a751428" + 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: @@ -151874,15 +153262,21 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: List LLM Observability projects + summary: List versions of an LLM Observability prompt tags: - LLM Observability + x-permission: + operator: OR + permissions: + - llm_observability_read 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: @@ -151891,11 +153285,16 @@ paths: value: data: attributes: - name: My LLM Project - type: projects + description: "Give concise answers and cite relevant help-center articles." + template: + - content: "You are a helpful customer support assistant for {{company_name}}." + role: "system" + - content: "Help {{customer_name}} with this question: {{question}}" + 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": @@ -151906,32 +153305,23 @@ 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: "3b12f1df-14fd-4e12-bd6f-4a2f5c8b3d1e" + created_at: "2025-02-01T14:30:00Z" + description: "Give concise answers and cite relevant help-center articles." + prompt_id: "customer-support-assistant" + prompt_uuid: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + template: + - content: "You are a helpful customer support assistant for {{company_name}}." + role: "system" + - content: "Help {{customer_name}} with this question: {{question}}" + role: "user" + version: 2 + version_created_at: "2025-02-01T14:30:00Z" + 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: @@ -151950,39 +153340,64 @@ 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-permission: + operator: AND + permissions: + - llm_observability_read + - llm_observability_write + - feature_flag_config_read + - feature_flag_config_write + - feature_flag_environment_config_read 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-02-01T14:30:00Z" + description: "Give concise answers and cite relevant help-center articles." + prompt_id: "customer-support-assistant" + prompt_uuid: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + template: + - content: "You are a helpful customer support assistant for {{company_name}}." + role: "system" + - content: "Help {{customer_name}} with this question: {{question}}" + role: "user" + version: 2 + version_created_at: "2025-02-01T14:30:00Z" + id: "d83ab666-61cc-5545-a83b-2424bb85467b" + type: prompt-template-versions + schema: + $ref: "#/components/schemas/LLMObsPromptVersionResponse" + description: OK "400": content: application/json: @@ -152001,23 +153416,34 @@ 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-permission: + operator: OR + permissions: + - llm_observability_read 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, the feature-flag environments, or both, for 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: @@ -152025,10 +153451,12 @@ paths: default: value: data: - type: projects + attributes: + description: "Give concise answers and cite relevant help-center articles." + 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": @@ -152039,14 +153467,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-02-01T14:30:00Z" + description: "Give concise answers and cite relevant help-center articles." + prompt_id: "customer-support-assistant" + prompt_uuid: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + template: + - content: "You are a helpful customer support assistant for {{company_name}}." + role: "system" + - content: "Help {{customer_name}} with this question: {{question}}" + role: "user" + version: 2 + version_created_at: "2025-02-01T14:30:00Z" + id: "d83ab666-61cc-5545-a83b-2424bb85467b" + type: prompt-template-versions schema: - $ref: "#/components/schemas/LLMObsProjectResponse" + $ref: "#/components/schemas/LLMObsPromptVersionResponse" description: OK "400": content: @@ -152077,9 +153513,17 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Update an LLM Observability project + summary: Update a specific LLM Observability prompt version tags: - LLM Observability + x-permission: + operator: AND + permissions: + - llm_observability_read + - llm_observability_write + - feature_flag_config_read + - feature_flag_config_write + - feature_flag_environment_config_read 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/). @@ -202449,7 +203893,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/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-Bad-Request-response.frozen b/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..c9cc8bd3d812 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2026-07-20T10:28:03.829Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-Bad-Request-response.yml b/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..1f7ae237e8f2 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-Bad-Request-response.yml @@ -0,0 +1,64 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 10:28:03 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"prompt_id":"Test-Create_a_new_LLM_Observability_prompt_version_returns_Bad_Request_response-1784543283","template":[{"content":"Hello","role":"user"}]},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9c67c0e2-0806-589b-8e8c-83ab2e6f76e3","type":"prompt-templates","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T10:28:04.139526235Z","created_from":"sdk-registry","in_registry":true,"last_version_created_at":"2026-07-20T10:28:04.139526235Z","num_versions":1,"prompt_id":"Test-Create_a_new_LLM_Observability_prompt_version_returns_Bad_Request_response-1784543283","source":"registry"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 10:28:03 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"template":" "},"type":"prompt-template-versions"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Create_a_new_LLM_Observability_prompt_version_returns_Bad_Request_response-1784543283/versions + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"invalid prompt template"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Mon, 20 Jul 2026 10:28:03 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Create_a_new_LLM_Observability_prompt_version_returns_Bad_Request_response-1784543283 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9c67c0e2-0806-589b-8e8c-83ab2e6f76e3","type":"prompt-templates","attributes":{"deleted_at":"2026-07-20T10:28:05.328346Z","prompt_id":"Test-Create_a_new_LLM_Observability_prompt_version_returns_Bad_Request_response-1784543283"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-Not-Found-response.frozen b/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..953941fa6624 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-07-20T09:19:57.708Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-Not-Found-response.yml b/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-Not-Found-response.yml new file mode 100644 index 000000000000..717aa6d20af8 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 09:19:57 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"env_ids":[],"labels":[],"template":[{"content":"Hello + v2","role":"user"}]},"type":"prompt-template-versions"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/nonexistent-prompt/versions + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"prompt template not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-OK-response.frozen b/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-OK-response.frozen new file mode 100644 index 000000000000..c82fbc75d0a2 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-21T12:32:24.134Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-OK-response.yml b/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-OK-response.yml new file mode 100644 index 000000000000..9c00f58121b4 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Create-a-new-LLM-Observability-prompt-version-returns-OK-response.yml @@ -0,0 +1,86 @@ +http_interactions: +- recorded_at: Tue, 21 Jul 2026 12:32:24 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"prompt_id":"Test-Create_a_new_LLM_Observability_prompt_version_returns_OK_response-1784637144","template":[{"content":"Hello","role":"user"}]},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"c0077820-d57d-54d6-be0c-b62e4e827e67","type":"prompt-templates","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-21T12:32:24.497241896Z","created_from":"sdk-registry","in_registry":true,"last_version_created_at":"2026-07-21T12:32:24.497241896Z","num_versions":1,"prompt_id":"Test-Create_a_new_LLM_Observability_prompt_version_returns_OK_response-1784637144","source":"registry"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 21 Jul 2026 12:32:24 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"template":[{"content":"You are a concise customer + support assistant for {{company_name}}.","role":"system"},{"content":"Answer + {{customer_name}}''s question: {{question}}","role":"user"}]},"type":"prompt-template-versions"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Create_a_new_LLM_Observability_prompt_version_returns_OK_response-1784637144/versions + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"a002055b-7e0f-501d-ba5b-45df41fbca73","type":"prompt-template-versions","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-21T12:32:25.272760959Z","prompt_id":"Test-Create_a_new_LLM_Observability_prompt_version_returns_OK_response-1784637144","prompt_uuid":"c0077820-d57d-54d6-be0c-b62e4e827e67","template":[{"content":"You + are a concise customer support assistant for {{company_name}}.","role":"system"},{"content":"Answer + {{customer_name}}''s question: {{question}}","role":"user"}],"version":2,"version_created_at":"2026-07-21T12:32:25.272760959Z"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 21 Jul 2026 12:32:24 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Create_a_new_LLM_Observability_prompt_version_returns_OK_response-1784637144 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"c0077820-d57d-54d6-be0c-b62e4e827e67","type":"prompt-templates","attributes":{"deleted_at":"2026-07-21T12:32:25.768356Z","prompt_id":"Test-Create_a_new_LLM_Observability_prompt_version_returns_OK_response-1784637144"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 21 Jul 2026 12:32:24 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Create_a_new_LLM_Observability_prompt_version_returns_OK_response-1784637144 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"c0077820-d57d-54d6-be0c-b62e4e827e67","type":"prompt-templates","attributes":{"deleted_at":"2026-07-21T12:32:26.168974Z","prompt_id":"Test-Create_a_new_LLM_Observability_prompt_version_returns_OK_response-1784637144"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-Bad-Request-response.frozen b/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..3cfa6ea02068 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2026-07-20T10:28:19.611Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-Bad-Request-response.yml b/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..b747a842c2d5 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 10:28:19 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"prompt_id":"Test-Create_an_LLM_Observability_prompt_returns_Bad_Request_response-1784543299","template":" + "},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"invalid prompt template"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-Conflict-response.frozen b/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-Conflict-response.frozen new file mode 100644 index 000000000000..869e5fe283c7 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-Conflict-response.frozen @@ -0,0 +1 @@ +2026-07-20T09:19:59.888Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-Conflict-response.yml b/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-Conflict-response.yml new file mode 100644 index 000000000000..8dc68c0f5e0e --- /dev/null +++ b/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-Conflict-response.yml @@ -0,0 +1,65 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 09:19:59 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"prompt_id":"Test-Create_an_LLM_Observability_prompt_returns_Conflict_response-1784539199","template":[{"content":"Hello","role":"user"}]},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"2fedf714-8445-571b-bad9-f7d4bb131524","type":"prompt-templates","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T09:20:00.140121332Z","created_from":"sdk-registry","in_registry":true,"last_version_created_at":"2026-07-20T09:20:00.140121332Z","num_versions":1,"prompt_id":"Test-Create_an_LLM_Observability_prompt_returns_Conflict_response-1784539199","source":"registry"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 09:19:59 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"env_ids":[],"labels":[],"prompt_id":"Test-Create_an_LLM_Observability_prompt_returns_Conflict_response-1784539199","template":[{"content":"Hello","role":"user"}]},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"prompt template already + exists"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 409 + message: Conflict +- recorded_at: Mon, 20 Jul 2026 09:19:59 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Create_an_LLM_Observability_prompt_returns_Conflict_response-1784539199 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"2fedf714-8445-571b-bad9-f7d4bb131524","type":"prompt-templates","attributes":{"deleted_at":"2026-07-20T09:20:01.051306Z","prompt_id":"Test-Create_an_LLM_Observability_prompt_returns_Conflict_response-1784539199"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-OK-response.frozen b/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-OK-response.frozen new file mode 100644 index 000000000000..51c734e1f7e6 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-21T12:31:53.516Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-OK-response.yml b/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-OK-response.yml new file mode 100644 index 000000000000..b2040d7bc86c --- /dev/null +++ b/cassettes/features/v2/llm_observability/Create-an-LLM-Observability-prompt-returns-OK-response.yml @@ -0,0 +1,46 @@ +http_interactions: +- recorded_at: Tue, 21 Jul 2026 12:31:53 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"prompt_id":"Test-Create_an_LLM_Observability_prompt_returns_OK_response-1784637113","template":[{"content":"You + are a helpful customer support assistant for {{company_name}}.","role":"system"},{"content":"Help + {{customer_name}} with this question: {{question}}","role":"user"}],"title":"Customer + Support Assistant"},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"7d3137ab-7d6a-5358-b791-26ead4540e09","type":"prompt-templates","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-21T12:31:53.812929348Z","created_from":"sdk-registry","in_registry":true,"last_version_created_at":"2026-07-21T12:31:53.812929348Z","num_versions":1,"prompt_id":"Test-Create_an_LLM_Observability_prompt_returns_OK_response-1784637113","source":"registry","title":"Customer + Support Assistant"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 21 Jul 2026 12:31:53 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Create_an_LLM_Observability_prompt_returns_OK_response-1784637113 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"7d3137ab-7d6a-5358-b791-26ead4540e09","type":"prompt-templates","attributes":{"deleted_at":"2026-07-21T12:31:55.799078Z","prompt_id":"Test-Create_an_LLM_Observability_prompt_returns_OK_response-1784637113"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Delete-an-LLM-Observability-prompt-returns-Not-Found-response.frozen b/cassettes/features/v2/llm_observability/Delete-an-LLM-Observability-prompt-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..aa624718a82b --- /dev/null +++ b/cassettes/features/v2/llm_observability/Delete-an-LLM-Observability-prompt-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-07-20T09:20:02.116Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Delete-an-LLM-Observability-prompt-returns-Not-Found-response.yml b/cassettes/features/v2/llm_observability/Delete-an-LLM-Observability-prompt-returns-Not-Found-response.yml new file mode 100644 index 000000000000..fee7e97a11d2 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Delete-an-LLM-Observability-prompt-returns-Not-Found-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 09:20:02 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/nonexistent-prompt + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"prompt template not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Delete-an-LLM-Observability-prompt-returns-OK-response.frozen b/cassettes/features/v2/llm_observability/Delete-an-LLM-Observability-prompt-returns-OK-response.frozen new file mode 100644 index 000000000000..710a0192eb19 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Delete-an-LLM-Observability-prompt-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-20T09:20:02.406Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Delete-an-LLM-Observability-prompt-returns-OK-response.yml b/cassettes/features/v2/llm_observability/Delete-an-LLM-Observability-prompt-returns-OK-response.yml new file mode 100644 index 000000000000..0713eac6f3dc --- /dev/null +++ b/cassettes/features/v2/llm_observability/Delete-an-LLM-Observability-prompt-returns-OK-response.yml @@ -0,0 +1,60 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 09:20:02 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"prompt_id":"Test-Delete_an_LLM_Observability_prompt_returns_OK_response-1784539202","template":[{"content":"Hello","role":"user"}]},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d5df9e4e-acd0-5d9f-b0d5-c09a643c33e2","type":"prompt-templates","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T09:20:02.660067768Z","created_from":"sdk-registry","in_registry":true,"last_version_created_at":"2026-07-20T09:20:02.660067768Z","num_versions":1,"prompt_id":"Test-Delete_an_LLM_Observability_prompt_returns_OK_response-1784539202","source":"registry"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 09:20:02 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Delete_an_LLM_Observability_prompt_returns_OK_response-1784539202 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d5df9e4e-acd0-5d9f-b0d5-c09a643c33e2","type":"prompt-templates","attributes":{"deleted_at":"2026-07-20T09:20:03.299559Z","prompt_id":"Test-Delete_an_LLM_Observability_prompt_returns_OK_response-1784539202"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 09:20:02 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Delete_an_LLM_Observability_prompt_returns_OK_response-1784539202 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d5df9e4e-acd0-5d9f-b0d5-c09a643c33e2","type":"prompt-templates","attributes":{"deleted_at":"2026-07-20T09:20:03.637257Z","prompt_id":"Test-Delete_an_LLM_Observability_prompt_returns_OK_response-1784539202"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Get-a-specific-LLM-Observability-prompt-version-returns-Not-Found-response.frozen b/cassettes/features/v2/llm_observability/Get-a-specific-LLM-Observability-prompt-version-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..4ccdfe430531 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Get-a-specific-LLM-Observability-prompt-version-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-07-20T10:29:01.052Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Get-a-specific-LLM-Observability-prompt-version-returns-Not-Found-response.yml b/cassettes/features/v2/llm_observability/Get-a-specific-LLM-Observability-prompt-version-returns-Not-Found-response.yml new file mode 100644 index 000000000000..644fac63f227 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Get-a-specific-LLM-Observability-prompt-version-returns-Not-Found-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 10:29:01 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/nonexistent-prompt/versions/1 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Get-a-specific-LLM-Observability-prompt-version-returns-OK-response.frozen b/cassettes/features/v2/llm_observability/Get-a-specific-LLM-Observability-prompt-version-returns-OK-response.frozen new file mode 100644 index 000000000000..51fcc5fc0720 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Get-a-specific-LLM-Observability-prompt-version-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-20T12:24:45.688Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Get-a-specific-LLM-Observability-prompt-version-returns-OK-response.yml b/cassettes/features/v2/llm_observability/Get-a-specific-LLM-Observability-prompt-version-returns-OK-response.yml new file mode 100644 index 000000000000..ee9200ab55ff --- /dev/null +++ b/cassettes/features/v2/llm_observability/Get-a-specific-LLM-Observability-prompt-version-returns-OK-response.yml @@ -0,0 +1,102 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 12:24:45 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"prompt_id":"Test-Get_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784550285","template":[{"content":"Hello","role":"user"}]},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"599ee1f4-9680-5ff8-92c9-ca31130057f3","type":"prompt-templates","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T12:24:46.021742711Z","created_from":"sdk-registry","in_registry":true,"last_version_created_at":"2026-07-20T12:24:46.021742711Z","num_versions":1,"prompt_id":"Test-Get_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784550285","source":"registry"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 12:24:45 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"template":[{"content":"Hello v2","role":"user"}]},"type":"prompt-template-versions"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Get_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784550285/versions + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d80790f5-cd99-5d57-b6e0-4d4bbbc21514","type":"prompt-template-versions","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T12:24:46.796641541Z","prompt_id":"Test-Get_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784550285","prompt_uuid":"599ee1f4-9680-5ff8-92c9-ca31130057f3","template":[{"content":"Hello + v2","role":"user"}],"version":2,"version_created_at":"2026-07-20T12:24:46.796641541Z"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 12:24:45 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Get_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784550285/versions/2 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d80790f5-cd99-5d57-b6e0-4d4bbbc21514","type":"prompt-template-versions","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T12:24:46.796641Z","prompt_id":"Test-Get_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784550285","prompt_uuid":"599ee1f4-9680-5ff8-92c9-ca31130057f3","template":[{"role":"user","content":"Hello + v2"}],"version":2,"version_created_at":"2026-07-20T12:24:46.796641Z"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 12:24:45 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Get_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784550285 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"599ee1f4-9680-5ff8-92c9-ca31130057f3","type":"prompt-templates","attributes":{"deleted_at":"2026-07-20T12:24:48.753279Z","prompt_id":"Test-Get_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784550285"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 12:24:45 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Get_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784550285 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"599ee1f4-9680-5ff8-92c9-ca31130057f3","type":"prompt-templates","attributes":{"deleted_at":"2026-07-20T12:24:49.086069Z","prompt_id":"Test-Get_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784550285"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Get-an-LLM-Observability-prompt-returns-Not-Found-response.frozen b/cassettes/features/v2/llm_observability/Get-an-LLM-Observability-prompt-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..3c46437a8423 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Get-an-LLM-Observability-prompt-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-07-20T09:20:08.586Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Get-an-LLM-Observability-prompt-returns-Not-Found-response.yml b/cassettes/features/v2/llm_observability/Get-an-LLM-Observability-prompt-returns-Not-Found-response.yml new file mode 100644 index 000000000000..88d578e3e4ae --- /dev/null +++ b/cassettes/features/v2/llm_observability/Get-an-LLM-Observability-prompt-returns-Not-Found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 09:20:08 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/nonexistent-prompt + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"prompt with id ''nonexistent-prompt'' + not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Get-an-LLM-Observability-prompt-returns-OK-response.frozen b/cassettes/features/v2/llm_observability/Get-an-LLM-Observability-prompt-returns-OK-response.frozen new file mode 100644 index 000000000000..cbbdf8910247 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Get-an-LLM-Observability-prompt-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-20T09:20:08.880Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Get-an-LLM-Observability-prompt-returns-OK-response.yml b/cassettes/features/v2/llm_observability/Get-an-LLM-Observability-prompt-returns-OK-response.yml new file mode 100644 index 000000000000..8e765eb2e494 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Get-an-LLM-Observability-prompt-returns-OK-response.yml @@ -0,0 +1,60 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 09:20:08 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"prompt_id":"Test-Get_an_LLM_Observability_prompt_returns_OK_response-1784539208","template":[{"content":"Hello","role":"user"}]},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"95e93a91-1020-5a23-9cb7-c8ca6e3b1785","type":"prompt-templates","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T09:20:09.112910708Z","created_from":"sdk-registry","in_registry":true,"last_version_created_at":"2026-07-20T09:20:09.112910708Z","num_versions":1,"prompt_id":"Test-Get_an_LLM_Observability_prompt_returns_OK_response-1784539208","source":"registry"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 09:20:08 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Get_an_LLM_Observability_prompt_returns_OK_response-1784539208 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"95e93a91-1020-5a23-9cb7-c8ca6e3b1785","type":"prompt-templates","attributes":{"chat_template":[{"role":"user","content":"Hello"}],"prompt_id":"Test-Get_an_LLM_Observability_prompt_returns_OK_response-1784539208","prompt_version_uuid":"9cd92cc7-2f51-5867-8148-eaf41efee79d","version":"1"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 09:20:08 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Get_an_LLM_Observability_prompt_returns_OK_response-1784539208 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"95e93a91-1020-5a23-9cb7-c8ca6e3b1785","type":"prompt-templates","attributes":{"deleted_at":"2026-07-20T09:20:10.172623Z","prompt_id":"Test-Get_an_LLM_Observability_prompt_returns_OK_response-1784539208"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/List-LLM-Observability-prompts-returns-OK-response.frozen b/cassettes/features/v2/llm_observability/List-LLM-Observability-prompts-returns-OK-response.frozen new file mode 100644 index 000000000000..9a473ba71551 --- /dev/null +++ b/cassettes/features/v2/llm_observability/List-LLM-Observability-prompts-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-20T09:30:04.586Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/List-LLM-Observability-prompts-returns-OK-response.yml b/cassettes/features/v2/llm_observability/List-LLM-Observability-prompts-returns-OK-response.yml new file mode 100644 index 000000000000..d02d94d3d3ff --- /dev/null +++ b/cassettes/features/v2/llm_observability/List-LLM-Observability-prompts-returns-OK-response.yml @@ -0,0 +1,60 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 09:30:04 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"prompt_id":"Test-List_LLM_Observability_prompts_returns_OK_response-1784539804","template":[{"content":"Hello","role":"user"}]},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"b04a1ded-d2da-578c-a520-1c1dd2046d1c","type":"prompt-templates","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T09:30:04.928462935Z","created_from":"sdk-registry","in_registry":true,"last_version_created_at":"2026-07-20T09:30:04.928462935Z","num_versions":1,"prompt_id":"Test-List_LLM_Observability_prompts_returns_OK_response-1784539804","source":"registry"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 09:30:04 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts?filter%5Bprompt_id%5D=Test-List_LLM_Observability_prompts_returns_OK_response-1784539804 + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"b04a1ded-d2da-578c-a520-1c1dd2046d1c","type":"prompt-templates","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T09:30:04.928462Z","created_from":"sdk-registry","in_registry":true,"last_version_created_at":"2026-07-20T09:30:04.928462Z","num_versions":1,"prompt_id":"Test-List_LLM_Observability_prompts_returns_OK_response-1784539804","source":"registry"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 09:30:04 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-List_LLM_Observability_prompts_returns_OK_response-1784539804 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"b04a1ded-d2da-578c-a520-1c1dd2046d1c","type":"prompt-templates","attributes":{"deleted_at":"2026-07-20T09:30:06.787619Z","prompt_id":"Test-List_LLM_Observability_prompts_returns_OK_response-1784539804"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/List-versions-of-an-LLM-Observability-prompt-returns-OK-response.frozen b/cassettes/features/v2/llm_observability/List-versions-of-an-LLM-Observability-prompt-returns-OK-response.frozen new file mode 100644 index 000000000000..5cbb96b9837c --- /dev/null +++ b/cassettes/features/v2/llm_observability/List-versions-of-an-LLM-Observability-prompt-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-20T09:20:12.882Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/List-versions-of-an-LLM-Observability-prompt-returns-OK-response.yml b/cassettes/features/v2/llm_observability/List-versions-of-an-LLM-Observability-prompt-returns-OK-response.yml new file mode 100644 index 000000000000..541b346e27b0 --- /dev/null +++ b/cassettes/features/v2/llm_observability/List-versions-of-an-LLM-Observability-prompt-returns-OK-response.yml @@ -0,0 +1,60 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 09:20:12 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"prompt_id":"Test-List_versions_of_an_LLM_Observability_prompt_returns_OK_response-1784539212","template":[{"content":"Hello","role":"user"}]},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"31fdf246-89b8-5a48-9544-ff84c4504939","type":"prompt-templates","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T09:20:13.145132213Z","created_from":"sdk-registry","in_registry":true,"last_version_created_at":"2026-07-20T09:20:13.145132213Z","num_versions":1,"prompt_id":"Test-List_versions_of_an_LLM_Observability_prompt_returns_OK_response-1784539212","source":"registry"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 09:20:12 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-List_versions_of_an_LLM_Observability_prompt_returns_OK_response-1784539212/versions + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"e0cc7c1d-cbb6-589c-bcd9-d9c1b35aec60","type":"prompt-template-versions","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T09:20:13.145132Z","prompt_id":"Test-List_versions_of_an_LLM_Observability_prompt_returns_OK_response-1784539212","prompt_uuid":"31fdf246-89b8-5a48-9544-ff84c4504939","version":1,"version_created_at":"2026-07-20T09:20:13.145132Z"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 09:20:12 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-List_versions_of_an_LLM_Observability_prompt_returns_OK_response-1784539212 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"31fdf246-89b8-5a48-9544-ff84c4504939","type":"prompt-templates","attributes":{"deleted_at":"2026-07-20T09:20:15.144489Z","prompt_id":"Test-List_versions_of_an_LLM_Observability_prompt_returns_OK_response-1784539212"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Update-a-specific-LLM-Observability-prompt-version-returns-Not-Found-response.frozen b/cassettes/features/v2/llm_observability/Update-a-specific-LLM-Observability-prompt-version-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..43f402180a43 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Update-a-specific-LLM-Observability-prompt-version-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-07-20T10:29:38.039Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Update-a-specific-LLM-Observability-prompt-version-returns-Not-Found-response.yml b/cassettes/features/v2/llm_observability/Update-a-specific-LLM-Observability-prompt-version-returns-Not-Found-response.yml new file mode 100644 index 000000000000..85a760b28bc1 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Update-a-specific-LLM-Observability-prompt-version-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 10:29:38 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"env_ids":[],"labels":[]},"type":"prompt-template-versions"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/nonexistent-prompt/versions/1 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"prompt template version + not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Update-a-specific-LLM-Observability-prompt-version-returns-OK-response.frozen b/cassettes/features/v2/llm_observability/Update-a-specific-LLM-Observability-prompt-version-returns-OK-response.frozen new file mode 100644 index 000000000000..c0ae65a3ec72 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Update-a-specific-LLM-Observability-prompt-version-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-20T15:43:10.740Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Update-a-specific-LLM-Observability-prompt-version-returns-OK-response.yml b/cassettes/features/v2/llm_observability/Update-a-specific-LLM-Observability-prompt-version-returns-OK-response.yml new file mode 100644 index 000000000000..970c5b181981 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Update-a-specific-LLM-Observability-prompt-version-returns-OK-response.yml @@ -0,0 +1,108 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 15:43:10 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"prompt_id":"Test-Update_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784562190","template":[{"content":"Hello","role":"user"}]},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"3c7ea2ea-52df-5324-8e77-0f01cf441ef9","type":"prompt-templates","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T15:43:11.158625133Z","created_from":"sdk-registry","in_registry":true,"last_version_created_at":"2026-07-20T15:43:11.158625133Z","num_versions":1,"prompt_id":"Test-Update_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784562190","source":"registry"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 15:43:10 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"template":[{"content":"Hello v2","role":"user"}]},"type":"prompt-template-versions"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Update_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784562190/versions + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"c5593d94-81b0-522b-8cae-7fa643ea7ec9","type":"prompt-template-versions","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T15:43:12.623730838Z","prompt_id":"Test-Update_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784562190","prompt_uuid":"3c7ea2ea-52df-5324-8e77-0f01cf441ef9","template":[{"content":"Hello + v2","role":"user"}],"version":2,"version_created_at":"2026-07-20T15:43:12.623730838Z"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 15:43:10 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"Give concise answers and cite + relevant help-center articles."},"type":"prompt-template-versions"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Update_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784562190/versions/2 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"c5593d94-81b0-522b-8cae-7fa643ea7ec9","type":"prompt-template-versions","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T15:43:12.62373Z","description":"Give + concise answers and cite relevant help-center articles.","prompt_id":"Test-Update_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784562190","prompt_uuid":"3c7ea2ea-52df-5324-8e77-0f01cf441ef9","template":[{"role":"user","content":"Hello + v2"}],"version":2,"version_created_at":"2026-07-20T15:43:12.62373Z"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 15:43:10 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Update_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784562190 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"3c7ea2ea-52df-5324-8e77-0f01cf441ef9","type":"prompt-templates","attributes":{"deleted_at":"2026-07-20T15:43:13.804223Z","prompt_id":"Test-Update_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784562190"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 15:43:10 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Update_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784562190 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"3c7ea2ea-52df-5324-8e77-0f01cf441ef9","type":"prompt-templates","attributes":{"deleted_at":"2026-07-20T15:43:14.36251Z","prompt_id":"Test-Update_a_specific_LLM_Observability_prompt_version_returns_OK_response-1784562190"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-Bad-Request-response.frozen b/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..30ae36893a3b --- /dev/null +++ b/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2026-07-20T09:20:18.946Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-Bad-Request-response.yml b/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..3a1dc71d39c0 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-Bad-Request-response.yml @@ -0,0 +1,65 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 09:20:18 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"prompt_id":"Test-Update_an_LLM_Observability_prompt_returns_Bad_Request_response-1784539218","template":[{"content":"Hello","role":"user"}]},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"b28f22d5-eec8-57f0-be7f-5042b6bb4ae1","type":"prompt-templates","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T09:20:19.301545921Z","created_from":"sdk-registry","in_registry":true,"last_version_created_at":"2026-07-20T09:20:19.301545921Z","num_versions":1,"prompt_id":"Test-Update_an_LLM_Observability_prompt_returns_Bad_Request_response-1784539218","source":"registry"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 09:20:18 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Update_an_LLM_Observability_prompt_returns_Bad_Request_response-1784539218 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"at least one of title + or description must be provided"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Mon, 20 Jul 2026 09:20:18 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Update_an_LLM_Observability_prompt_returns_Bad_Request_response-1784539218 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"b28f22d5-eec8-57f0-be7f-5042b6bb4ae1","type":"prompt-templates","attributes":{"deleted_at":"2026-07-20T09:20:20.235152Z","prompt_id":"Test-Update_an_LLM_Observability_prompt_returns_Bad_Request_response-1784539218"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-Not-Found-response.frozen b/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..989a21d45ca8 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-07-20T09:20:20.319Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-Not-Found-response.yml b/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-Not-Found-response.yml new file mode 100644 index 000000000000..0fb3c8b2d22b --- /dev/null +++ b/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-Not-Found-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 09:20:20 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"title":"New title"},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/nonexistent-prompt + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"prompt template not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-OK-response.frozen b/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-OK-response.frozen new file mode 100644 index 000000000000..9eed997d0fd7 --- /dev/null +++ b/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-20T15:43:14.374Z \ No newline at end of file diff --git a/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-OK-response.yml b/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-OK-response.yml new file mode 100644 index 000000000000..73df359ea2ad --- /dev/null +++ b/cassettes/features/v2/llm_observability/Update-an-LLM-Observability-prompt-returns-OK-response.yml @@ -0,0 +1,65 @@ +http_interactions: +- recorded_at: Mon, 20 Jul 2026 15:43:14 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"prompt_id":"Test-Update_an_LLM_Observability_prompt_returns_OK_response-1784562194","template":[{"content":"Hello","role":"user"}]},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"a36505e7-3c2f-5482-b8ac-ac51250a0116","type":"prompt-templates","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T15:43:14.698626703Z","created_from":"sdk-registry","in_registry":true,"last_version_created_at":"2026-07-20T15:43:14.698626703Z","num_versions":1,"prompt_id":"Test-Update_an_LLM_Observability_prompt_returns_OK_response-1784562194","source":"registry"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 15:43:14 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"title":"Customer Support Assistant"},"type":"prompt-templates"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Update_an_LLM_Observability_prompt_returns_OK_response-1784562194 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"a36505e7-3c2f-5482-b8ac-ac51250a0116","type":"prompt-templates","attributes":{"author":"c5e19e5a-ad6b-11ed-ab4f-927130d31ef9","created_at":"2026-07-20T15:43:14.698626Z","created_from":"sdk-registry","in_registry":true,"num_versions":0,"prompt_id":"Test-Update_an_LLM_Observability_prompt_returns_OK_response-1784562194","source":"registry","title":"Customer + Support Assistant"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 20 Jul 2026 15:43:14 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/Test-Update_an_LLM_Observability_prompt_returns_OK_response-1784562194 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"a36505e7-3c2f-5482-b8ac-ac51250a0116","type":"prompt-templates","attributes":{"deleted_at":"2026-07-20T15:43:16.39072Z","prompt_id":"Test-Update_an_LLM_Observability_prompt_returns_OK_response-1784562194"}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/llm-observability/CreateLLMObsPrompt.rb b/examples/v2/llm-observability/CreateLLMObsPrompt.rb new file mode 100644 index 000000000000..442ce98e1d7f --- /dev/null +++ b/examples/v2/llm-observability/CreateLLMObsPrompt.rb @@ -0,0 +1,28 @@ +# 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({ + prompt_id: "Example-LLM-Observability", + title: "Customer Support Assistant", + template: [ + DatadogAPIClient::V2::LLMObsPromptChatMessage.new({ + content: "You are a helpful customer support assistant for {{company_name}}.", + role: "system", + }), + DatadogAPIClient::V2::LLMObsPromptChatMessage.new({ + content: "Help {{customer_name}} with this question: {{question}}", + role: "user", + }), + ], + }), + 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..184dd3635913 --- /dev/null +++ b/examples/v2/llm-observability/CreateLLMObsPromptVersion.rb @@ -0,0 +1,29 @@ +# 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({ + template: [ + DatadogAPIClient::V2::LLMObsPromptChatMessage.new({ + content: "You are a concise customer support assistant for {{company_name}}.", + role: "system", + }), + DatadogAPIClient::V2::LLMObsPromptChatMessage.new({ + content: "Answer {{customer_name}}'s question: {{question}}", + role: "user", + }), + ], + }), + 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..c6619561514a --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsPrompts.rb @@ -0,0 +1,14 @@ +# 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 + +# there is a valid "prompt" in the system +PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"] +opts = { + filter_prompt_id: PROMPT_DATA_ATTRIBUTES_PROMPT_ID, +} +p api_instance.list_llm_obs_prompts(opts) diff --git a/examples/v2/llm-observability/UpdateLLMObsPrompt.rb b/examples/v2/llm-observability/UpdateLLMObsPrompt.rb new file mode 100644 index 000000000000..84f8c1c9a3d7 --- /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: "Customer Support Assistant", + }), + 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..35a99fb79d52 --- /dev/null +++ b/examples/v2/llm-observability/UpdateLLMObsPromptVersion.rb @@ -0,0 +1,23 @@ +# 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({ + description: "Give concise answers and cite relevant help-center articles.", + }), + 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 c69c88b24015..422ed8b0de7c 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 75fa924ff16d..6f57cbefde83 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..2c23f9f6d7b4 100644 --- a/features/v2/llm_observability.feature +++ b/features/v2/llm_observability.feature @@ -1,12 +1,12 @@ @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 + And a valid "appKeyAuth" key in the system @skip @team:DataDog/ml-observability Scenario: Add a display_block interaction returns "Created" response @@ -179,6 +179,35 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @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 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": {"template": " "}, "type": "prompt-template-versions"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/ml-observability + Scenario: Create a new LLM Observability prompt version returns "Not Found" response + Given 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 + + @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 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": {"template": [{"content": "You are a concise customer support assistant for {{ '{{company_name}}' }}.", "role": "system"}, {"content": "Answer {{ '{{customer_name}}' }}'s question: {{ '{{question}}' }}", "role": "user"}]}, "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 @@ -279,6 +308,31 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @team:DataDog/ml-observability + Scenario: Create an LLM Observability prompt returns "Bad Request" response + Given operation "CreateLLMObsPrompt" enabled + And new "CreateLLMObsPrompt" request + And body with value {"data": {"attributes": {"prompt_id": "{{ unique }}", "template": " "}, "type": "prompt-templates"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/ml-observability + Scenario: Create an LLM Observability prompt returns "Conflict" response + Given there is a valid "prompt" 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 + + @team:DataDog/ml-observability + Scenario: Create an LLM Observability prompt returns "OK" response + Given operation "CreateLLMObsPrompt" enabled + And new "CreateLLMObsPrompt" request + And body with value {"data": {"attributes": {"prompt_id": "{{ unique }}", "title": "Customer Support Assistant", "template": [{"content": "You are a helpful customer support assistant for {{ '{{company_name}}' }}.", "role": "system"}, {"content": "Help {{ '{{customer_name}}' }} with this question: {{ '{{question}}' }}", "role": "user"}]}, "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 @@ -535,6 +589,23 @@ Feature: LLM Observability When the request is sent Then the response status is 404 Not Found + @team:DataDog/ml-observability + Scenario: Delete an LLM Observability prompt returns "Not Found" response + Given 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 + + @team:DataDog/ml-observability + Scenario: Delete an LLM Observability prompt returns "OK" response + Given there is a valid "prompt" 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 @@ -688,6 +759,52 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Get a specific LLM Observability prompt version returns "Bad Request" response + Given operation "GetLLMObsPromptVersion" enabled + And new "GetLLMObsPromptVersion" request + And request contains "prompt_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @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 + + @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 + + @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 + + @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 @@ -936,6 +1053,15 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @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 + And request contains "filter[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: List LLM Observability spans returns "Bad Request" response Given operation "ListLLMObsSpans" enabled @@ -1118,6 +1244,15 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @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 @@ -1359,6 +1494,38 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Update a specific LLM Observability prompt version returns "Bad Request" response + Given operation "UpdateLLMObsPromptVersion" enabled + And new "UpdateLLMObsPromptVersion" request + And request contains "prompt_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"env_ids": [], "labels": ["production"]}, "type": "prompt-template-versions"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/ml-observability + Scenario: Update a specific LLM Observability prompt version returns "Not Found" response + Given 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 + + @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 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": {"description": "Give concise answers and cite relevant help-center articles."}, "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 @@ -1470,6 +1637,35 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @team:DataDog/ml-observability + Scenario: Update an LLM Observability prompt returns "Bad Request" response + Given there is a valid "prompt" 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 + + @team:DataDog/ml-observability + Scenario: Update an LLM Observability prompt returns "Not Found" response + Given 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 + + @team:DataDog/ml-observability + Scenario: Update an LLM Observability prompt returns "OK" response + Given there is a valid "prompt" 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": "Customer Support Assistant"}, "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 diff --git a/features/v2/undo.json b/features/v2/undo.json index f7316aecda2c..e72767d8e0d5 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4555,6 +4555,74 @@ "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": "DeleteLLMObsPrompt", + "parameters": [ + { + "name": "prompt_id", + "source": "data.attributes.prompt_id" + } + ], + "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 fb9832d3cdd8..b85b0ffb9d18 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 ad98b6674023..7e745a19486c 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4297,6 +4297,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", @@ -4391,6 +4397,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", @@ -4549,6 +4558,26 @@ 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_label" => "LLMObsPromptVersionLabel", + "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", @@ -4574,6 +4603,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..a0991588041a 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.** Optional label of the prompt version to return. Do not use this parameter for new integrations. If omitted, the latest version is returned. If the prompt has no labels, the latest version is returned even when a label is requested. If the prompt has labels but none match the requested label, a 404 response is returned. + # @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 organization. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_prompt_id Optional filter for 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. If the prompt does not exist, is not registered, or is archived, the response contains an empty list. + # + # @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,170 @@ 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, the description, or both, for an LLM Observability prompt. + # + # @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, the feature-flag environments, or both, for 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..e95259e64692 --- /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. `prompt_id` and `template` are required; all other attributes are optional. + 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..2cf94366b7b2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_create_prompt_data_attributes.rb @@ -0,0 +1,202 @@ +=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. `prompt_id` and `template` are required; all other attributes are optional. + class LLMObsCreatePromptDataAttributes + include BaseGenericModel + + # Optional description of the prompt. + attr_accessor :description + + # Optional feature-flag environment UUIDs the service attempts to enable and configure to use the first version as their default after creation. + attr_accessor :env_ids + + # Optional labels to attach to the first version. Do not use this attribute for new integrations. + 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 + + # Optional title of the prompt. + attr_accessor :title + + # Optional 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 @prompt_id.to_s.length < 1 + 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 + if prompt_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "prompt_id", the character length must be great than or equal to 1.' + 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..eb9057ce2f66 --- /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. `template` is required; all other attributes are optional. + 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..662c99f221d4 --- /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. `template` is required; all other attributes are optional. + class LLMObsCreatePromptVersionDataAttributes + include BaseGenericModel + + # Optional description of this version. + attr_accessor :description + + # Optional feature-flag environment UUIDs the service attempts to enable and configure to use this version as their default after creation. + attr_accessor :env_ids + + # Optional labels to attach to this version. Do not use this attribute for new integrations. + attr_accessor :labels + + # A text template or a list of chat messages. + attr_reader :template + + # Optional 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..680e5a7b9850 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_sdk_data_attributes.rb @@ -0,0 +1,159 @@ +=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 and content messages. Omitted for text templates. + attr_accessor :chat_template + + # Labels attached to the selected version. + attr_accessor :labels + + # 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 identifier was set, in which case that identifier 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', + :'labels' => :'labels', + :'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', + :'labels' => :'Array', + :'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?(:'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?(:'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 && + labels == o.labels && + 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, labels, 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..35813072372e --- /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 identifier 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_label.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_version_label.rb new file mode 100644 index 000000000000..98d048f1d321 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_version_label.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 + # A label attached to an LLM Observability prompt version. + class LLMObsPromptVersionLabel + include BaseEnumModel + + PRODUCTION = "production".freeze + DEVELOPMENT = "development".freeze + 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..7bd8d6b051bb --- /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 identifier 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..924fabb765df --- /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 of `title` or `description` must be provided; both attributes are optional individually. + 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..91e373865753 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_update_prompt_data_attributes.rb @@ -0,0 +1,90 @@ +=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 of `title` or `description` must be provided; both attributes are optional individually. + class LLMObsUpdatePromptDataAttributes + include BaseGenericModel + + # Optional new description for the prompt. + attr_accessor :description + + # Optional new title for the prompt. + attr_accessor :title + + # 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 + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::LLMObsUpdatePromptDataAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + 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 + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, title].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..485a1620d033 --- /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 of `description`, `labels`, or `env_ids` must be provided; all three attributes are optional individually. + 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..579a2441f5a9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_update_prompt_version_data_attributes.rb @@ -0,0 +1,104 @@ +=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 of `description`, `labels`, or `env_ids` must be provided; all three attributes are optional individually. + class LLMObsUpdatePromptVersionDataAttributes + include BaseGenericModel + + # Optional new description for this version. + attr_accessor :description + + # Optional feature-flag environment UUIDs the service attempts to enable and configure to use this version as their default. + attr_accessor :env_ids + + # Optional new labels for this version. Do not use this attribute for new integrations. + attr_accessor :labels + + # 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 + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::LLMObsUpdatePromptVersionDataAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + 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 + + # 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 + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, env_ids, labels].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