From 568872aa267b0d14037c1e5103904e9bdf0b9638 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 24 Sep 2026 12:03:46 +0000 Subject: [PATCH] Regenerate client from commit 8aeb78f of spec repo --- .generator/schemas/v2/openapi.yaml | 151 ++++++++++++++++- lib/datadog_api_client/inflector.rb | 4 + .../v2/api/agent_observability_api.rb | 4 + .../llm_obs_create_prompt_data_attributes.rb | 4 +- ...s_create_prompt_version_data_attributes.rb | 4 +- .../models/llm_obs_prompt_authoring_item.rb | 63 +++++++ ..._obs_prompt_authoring_messages_template.rb | 129 +++++++++++++++ .../v2/models/llm_obs_prompt_include.rb | 154 ++++++++++++++++++ .../v2/models/llm_obs_prompt_include_item.rb | 98 +++++++++++ .../v2/models/llm_obs_prompt_template.rb | 7 +- .../v2/models/llm_obs_prompt_version_data.rb | 2 +- .../llm_obs_prompt_version_data_attributes.rb | 20 ++- 12 files changed, 628 insertions(+), 12 deletions(-) create mode 100644 lib/datadog_api_client/v2/models/llm_obs_prompt_authoring_item.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_prompt_authoring_messages_template.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_prompt_include.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_prompt_include_item.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4d2fffc0cf47..c2c0d78b9813 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -64785,6 +64785,26 @@ components: required: - data type: object + LLMObsPromptAuthoringChatTemplate: + description: A chat prompt containing messages, references to specific versions of other prompts, or both. + items: + $ref: "#/components/schemas/LLMObsPromptAuthoringItem" + minItems: 1 + type: array + LLMObsPromptAuthoringItem: + description: >- + A chat message or a reference to a specific version of another prompt. A chat message must not contain an `include` field; the API rejects items that combine both forms. + oneOf: + - $ref: "#/components/schemas/LLMObsPromptChatMessage" + - $ref: "#/components/schemas/LLMObsPromptIncludeItem" + LLMObsPromptAuthoringMessagesTemplate: + description: A chat prompt whose authored items are stored under `messages`. + properties: + messages: + $ref: "#/components/schemas/LLMObsPromptAuthoringChatTemplate" + required: + - messages + type: object LLMObsPromptChatMessage: description: A single chat message in a prompt template. properties: @@ -64919,6 +64939,46 @@ components: required: - id type: object + LLMObsPromptInclude: + additionalProperties: false + description: >- + Includes messages from a specific version of another prompt. Omitting `items` includes every message from that version in its original order. When `items` is present, messages are included in the specified order, including repetitions. + properties: + items: + description: >- + Zero-based indexes of messages from the included prompt. For example, `[2, 0, 0]` includes the third message, followed by the first message twice. Omit this field to include all messages in their original order. + items: + format: int64 + maximum: 2147483647 + minimum: 0 + type: integer + minItems: 1 + type: array + prompt_id: + description: Customer-provided identifier of the included prompt. + example: "response-policy" + minLength: 1 + type: string + version: + description: Positive sequential version number of the included prompt. + example: 3 + format: int64 + maximum: 2147483647 + minimum: 1 + type: integer + required: + - prompt_id + - version + type: object + LLMObsPromptIncludeItem: + additionalProperties: false + description: Includes all or selected messages from a specific version of another prompt. + properties: + include: + $ref: "#/components/schemas/LLMObsPromptInclude" + required: + - include + type: object LLMObsPromptResponse: description: Response containing a single Agent Observability prompt. example: @@ -65028,11 +65088,17 @@ components: - data type: object LLMObsPromptTemplate: - description: A text template or a list of chat messages. + description: >- + A text template, a list of chat messages, or an authored chat object. Text can include an exact prompt version with `{{>prompt-id version=N}}`; other text, including `{{>...}}` sequences without a version, remains literal. Use an authored chat object when including prompts as chat messages. + + **Preview**: Prompt composition is available in Preview. To request access, contact [Datadog Support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + + Without access, inline references remain literal text and structured includes are unsupported. Previously compiled prompt versions remain available for execution. example: "You are a helpful assistant for {{audience}}." oneOf: - $ref: "#/components/schemas/LLMObsPromptTextTemplate" - $ref: "#/components/schemas/LLMObsPromptChatTemplate" + - $ref: "#/components/schemas/LLMObsPromptAuthoringMessagesTemplate" LLMObsPromptTextTemplate: description: A text prompt template. minLength: 1 @@ -65064,11 +65130,13 @@ components: type: object LLMObsPromptVersionDataAttributes: description: >- - Attributes of a specific version of an Agent Observability prompt. Empty `config` is omitted when configuration authoring is disabled for the organization. Non-empty saved configuration is always returned. + Attributes of a specific version of an Agent Observability prompt. For a composed version, `authoring_template` contains its pinned include-bearing source; ordinary versions omit that attribute. Empty `config` is omitted when configuration authoring is disabled for the organization. Non-empty saved configuration is always returned. properties: author: description: UUID of the user who authored this version. type: string + authoring_template: + $ref: "#/components/schemas/LLMObsPromptTemplate" config: $ref: "#/components/schemas/LLMObsPromptConfig" created_at: @@ -175955,7 +176023,10 @@ paths: **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 Agent Observability prompt registry. + description: |- + Create a new prompt (and its first version) in the Agent Observability prompt registry. + + > **Preview**: Prompt composition is available in Preview. To request access, contact [Datadog Support](https://docs.datadoghq.com/help/) or your Customer Success Manager. operationId: CreateLLMObsPrompt requestBody: content: @@ -176332,7 +176403,10 @@ paths: **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 version of an existing Agent Observability prompt. + description: |- + Create a new version of an existing Agent Observability prompt. + + > **Preview**: Prompt composition is available in Preview. To request access, contact [Datadog Support](https://docs.datadoghq.com/help/) or your Customer Success Manager. operationId: CreateLLMObsPromptVersion parameters: - $ref: "#/components/parameters/LLMObsPromptIDPathParameter" @@ -176340,6 +176414,31 @@ paths: content: application/json: examples: + composed_chat: + summary: Create a version that includes all or selected messages from other prompts + value: + data: + attributes: + template: + messages: + - include: + prompt_id: "assistant-introduction" + version: 2 + - include: + items: [2, 0, 0] + prompt_id: "response-examples" + version: 4 + - content: "Answer {{question}}." + role: "user" + type: prompt-template-versions + composed_text: + summary: Create a version that includes text from another prompt + value: + data: + attributes: + description: "Reuse the exact response policy." + template: "{{>response-policy version=3}}\n\nAnswer {{question}}." + type: prompt-template-versions default: value: data: @@ -176363,6 +176462,50 @@ paths: content: application/json: examples: + composed_chat: + summary: A composed chat version preserves structured authored includes + value: + data: + attributes: + authoring_template: + messages: + - include: + prompt_id: "assistant-introduction" + version: 2 + - include: + items: [2, 0, 0] + prompt_id: "response-examples" + version: 4 + - content: "Answer {{question}}." + role: "user" + prompt_id: "support-chat" + prompt_uuid: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + template: + - content: "You are a helpful assistant." + role: "system" + - content: "Here is one concise example." + role: "assistant" + - content: "You are a helpful assistant." + role: "system" + - content: "You are a helpful assistant." + role: "system" + - content: "Answer {{question}}." + role: "user" + version: 2 + id: "d83ab666-61cc-5545-a83b-2424bb85467b" + type: prompt-template-versions + composed_text: + summary: A composed text version returns compiled and authored templates + value: + data: + attributes: + authoring_template: "{{>response-policy version=3}}\n\nAnswer {{question}}." + prompt_id: "support-answer" + prompt_uuid: "4a1a28ff-8a25-5f0f-946f-f48264d772eb" + template: "Follow the approved response policy.\n\nAnswer {{question}}." + version: 2 + id: "d83ab666-61cc-5545-a83b-2424bb85467b" + type: prompt-template-versions default: value: data: diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index dcd76acdd2bd..11330a2fed97 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -5044,10 +5044,14 @@ 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_authoring_item" => "LLMObsPromptAuthoringItem", + "v2.llm_obs_prompt_authoring_messages_template" => "LLMObsPromptAuthoringMessagesTemplate", "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_include" => "LLMObsPromptInclude", + "v2.llm_obs_prompt_include_item" => "LLMObsPromptIncludeItem", "v2.llm_obs_prompt_response" => "LLMObsPromptResponse", "v2.llm_obs_prompt_response_source" => "LLMObsPromptResponseSource", "v2.llm_obs_prompt_sdk_data" => "LLMObsPromptSDKData", diff --git a/lib/datadog_api_client/v2/api/agent_observability_api.rb b/lib/datadog_api_client/v2/api/agent_observability_api.rb index d3a69da84405..f4a6a1da5629 100644 --- a/lib/datadog_api_client/v2/api/agent_observability_api.rb +++ b/lib/datadog_api_client/v2/api/agent_observability_api.rb @@ -914,6 +914,8 @@ def create_llm_obs_prompt(body, opts = {}) # # Create a new prompt (and its first version) in the Agent Observability prompt registry. # + # > **Preview**: Prompt composition is available in Preview. To request access, contact [Datadog Support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + # # @param body [LLMObsCreatePromptRequest] Create prompt payload. # @param opts [Hash] the optional parameters # @return [Array<(LLMObsCreatePromptResponse, Integer, Hash)>] LLMObsCreatePromptResponse data, response status code and response headers @@ -987,6 +989,8 @@ def create_llm_obs_prompt_version(prompt_id, body, opts = {}) # # Create a new version of an existing Agent Observability prompt. # + # > **Preview**: Prompt composition is available in Preview. To request access, contact [Datadog Support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + # # @param prompt_id [String] The customer-provided identifier of the Agent Observability prompt. # @param body [LLMObsCreatePromptVersionRequest] Create prompt version payload. # @param opts [Hash] the optional parameters 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 index 1a0327d5f5ea..a8d2985c123d 100644 --- 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 @@ -36,7 +36,9 @@ class LLMObsCreatePromptDataAttributes # Customer-provided identifier for the new prompt. attr_reader :prompt_id - # A text template or a list of chat messages. + # A text template, a list of chat messages, or an authored chat object. Text can include an exact prompt version with `{{>prompt-id version=N}}`; other text, including `{{>...}}` sequences without a version, remains literal. Use an authored chat object when including prompts as chat messages. + # **Preview**: Prompt composition is available in Preview. To request access, contact [Datadog Support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + # Without access, inline references remain literal text and structured includes are unsupported. Previously compiled prompt versions remain available for execution. attr_reader :template # Optional title of the prompt. 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 index 16218dad0210..517ddbc1ecae 100644 --- 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 @@ -33,7 +33,9 @@ class LLMObsCreatePromptVersionDataAttributes # 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. + # A text template, a list of chat messages, or an authored chat object. Text can include an exact prompt version with `{{>prompt-id version=N}}`; other text, including `{{>...}}` sequences without a version, remains literal. Use an authored chat object when including prompts as chat messages. + # **Preview**: Prompt composition is available in Preview. To request access, contact [Datadog Support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + # Without access, inline references remain literal text and structured includes are unsupported. Previously compiled prompt versions remain available for execution. attr_reader :template # Optional user-supplied version identifier for this version. diff --git a/lib/datadog_api_client/v2/models/llm_obs_prompt_authoring_item.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_authoring_item.rb new file mode 100644 index 000000000000..604021d3304a --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_authoring_item.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 chat message or a reference to a specific version of another prompt. A chat message must not contain an `include` field; the API rejects items that combine both forms. + module LLMObsPromptAuthoringItem + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'LLMObsPromptChatMessage', + :'LLMObsPromptIncludeItem' + ] + 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_authoring_messages_template.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_authoring_messages_template.rb new file mode 100644 index 000000000000..75c0e5a7ae03 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_authoring_messages_template.rb @@ -0,0 +1,129 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A chat prompt whose authored items are stored under `messages`. + class LLMObsPromptAuthoringMessagesTemplate + include BaseGenericModel + + # A chat prompt containing messages, references to specific versions of other prompts, or both. + attr_reader :messages + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'messages' => :'messages' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'messages' => :'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::LLMObsPromptAuthoringMessagesTemplate` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'messages') + if (value = attributes[:'messages']).is_a?(Array) + self.messages = value + end + end + 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 @messages.nil? + return false if @messages.length < 1 + true + end + + # Custom attribute writer method with validation + # @param messages [Object] Object to be assigned + # @!visibility private + def messages=(messages) + if messages.nil? + fail ArgumentError, 'invalid value for "messages", messages cannot be nil.' + end + if messages.length < 1 + fail ArgumentError, 'invalid value for "messages", number of items must be greater than or equal to 1.' + end + @messages = messages + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + messages == o.messages && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [messages, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_prompt_include.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_include.rb new file mode 100644 index 000000000000..81de30da8e51 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_include.rb @@ -0,0 +1,154 @@ +=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 + # Includes messages from a specific version of another prompt. Omitting `items` includes every message from that version in its original order. When `items` is present, messages are included in the specified order, including repetitions. + class LLMObsPromptInclude + include BaseGenericModel + + # Zero-based indexes of messages from the included prompt. For example, `[2, 0, 0]` includes the third message, followed by the first message twice. Omit this field to include all messages in their original order. + attr_reader :items + + # Customer-provided identifier of the included prompt. + attr_reader :prompt_id + + # Positive sequential version number of the included prompt. + attr_reader :version + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'items' => :'items', + :'prompt_id' => :'prompt_id', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'items' => :'Array', + :'prompt_id' => :'String', + :'version' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsPromptInclude` 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::LLMObsPromptInclude`. 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?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end + + if attributes.key?(:'prompt_id') + self.prompt_id = attributes[:'prompt_id'] + end + + if attributes.key?(:'version') + self.version = attributes[:'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 !@items.nil? && @items.length < 1 + return false if @prompt_id.nil? + return false if @prompt_id.to_s.length < 1 + return false if @version.nil? + return false if @version > 2147483647 + return false if @version < 1 + true + end + + # Custom attribute writer method with validation + # @param items [Object] Object to be assigned + # @!visibility private + def items=(items) + if !items.nil? && items.length < 1 + fail ArgumentError, 'invalid value for "items", number of items must be greater than or equal to 1.' + end + @items = items + 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 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 > 2147483647 + fail ArgumentError, 'invalid value for "version", must be smaller than or equal to 2147483647.' + end + if version < 1 + fail ArgumentError, 'invalid value for "version", must be greater than or equal to 1.' + end + @version = version + 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 && + items == o.items && + prompt_id == o.prompt_id && + version == o.version + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [items, prompt_id, version].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_prompt_include_item.rb b/lib/datadog_api_client/v2/models/llm_obs_prompt_include_item.rb new file mode 100644 index 000000000000..06c218533937 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_include_item.rb @@ -0,0 +1,98 @@ +=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 + # Includes all or selected messages from a specific version of another prompt. + class LLMObsPromptIncludeItem + include BaseGenericModel + + # Includes messages from a specific version of another prompt. Omitting `items` includes every message from that version in its original order. When `items` is present, messages are included in the specified order, including repetitions. + attr_reader :include + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'include' => :'include' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'include' => :'LLMObsPromptInclude' + } + 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::LLMObsPromptIncludeItem` 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::LLMObsPromptIncludeItem`. 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?(:'include') + self.include = attributes[:'include'] + 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 @include.nil? + true + end + + # Custom attribute writer method with validation + # @param include [Object] Object to be assigned + # @!visibility private + def include=(include) + if include.nil? + fail ArgumentError, 'invalid value for "include", include cannot be nil.' + end + @include = include + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + include == o.include + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [include].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 index 621a7e715f87..0f21b020f868 100644 --- a/lib/datadog_api_client/v2/models/llm_obs_prompt_template.rb +++ b/lib/datadog_api_client/v2/models/llm_obs_prompt_template.rb @@ -17,7 +17,9 @@ require 'time' module DatadogAPIClient::V2 - # A text template or a list of chat messages. + # A text template, a list of chat messages, or an authored chat object. Text can include an exact prompt version with `{{>prompt-id version=N}}`; other text, including `{{>...}}` sequences without a version, remains literal. Use an authored chat object when including prompts as chat messages. + # **Preview**: Prompt composition is available in Preview. To request access, contact [Datadog Support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + # Without access, inline references remain literal text and structured includes are unsupported. Previously compiled prompt versions remain available for execution. module LLMObsPromptTemplate class << self include BaseOneOfModel @@ -27,7 +29,8 @@ class << self def openapi_one_of [ :'String', - :'Array' + :'Array', + :'LLMObsPromptAuthoringMessagesTemplate' ] end # Builds the object 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 index 003740f36aeb..218619012489 100644 --- 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 @@ -21,7 +21,7 @@ module DatadogAPIClient::V2 class LLMObsPromptVersionData include BaseGenericModel - # Attributes of a specific version of an Agent Observability prompt. Empty `config` is omitted when configuration authoring is disabled for the organization. Non-empty saved configuration is always returned. + # Attributes of a specific version of an Agent Observability prompt. For a composed version, `authoring_template` contains its pinned include-bearing source; ordinary versions omit that attribute. Empty `config` is omitted when configuration authoring is disabled for the organization. Non-empty saved configuration is always returned. attr_reader :attributes # Unique identifier of the prompt version. 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 index 17eec3061c3f..85df4a1007bb 100644 --- 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 @@ -17,13 +17,18 @@ require 'time' module DatadogAPIClient::V2 - # Attributes of a specific version of an Agent Observability prompt. Empty `config` is omitted when configuration authoring is disabled for the organization. Non-empty saved configuration is always returned. + # Attributes of a specific version of an Agent Observability prompt. For a composed version, `authoring_template` contains its pinned include-bearing source; ordinary versions omit that attribute. Empty `config` is omitted when configuration authoring is disabled for the organization. Non-empty saved configuration is always returned. class LLMObsPromptVersionDataAttributes include BaseGenericModel # UUID of the user who authored this version. attr_accessor :author + # A text template, a list of chat messages, or an authored chat object. Text can include an exact prompt version with `{{>prompt-id version=N}}`; other text, including `{{>...}}` sequences without a version, remains literal. Use an authored chat object when including prompts as chat messages. + # **Preview**: Prompt composition is available in Preview. To request access, contact [Datadog Support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + # Without access, inline references remain literal text and structured includes are unsupported. Previously compiled prompt versions remain available for execution. + attr_accessor :authoring_template + # Versioned prompt configuration is in Preview. To request access, contact [Datadog Support](https://www.datadoghq.com/support/) or your Customer Success Manager. Customer-owned configuration delivered with a prompt version. Datadog stores and returns the object without interpolating it, validating provider-specific keys, or applying it to model calls. Do not include secrets. attr_accessor :config @@ -57,7 +62,9 @@ class LLMObsPromptVersionDataAttributes # Tags observed on runs of this prompt version. attr_accessor :tags - # A text template or a list of chat messages. + # A text template, a list of chat messages, or an authored chat object. Text can include an exact prompt version with `{{>prompt-id version=N}}`; other text, including `{{>...}}` sequences without a version, remains literal. Use an authored chat object when including prompts as chat messages. + # **Preview**: Prompt composition is available in Preview. To request access, contact [Datadog Support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + # Without access, inline references remain literal text and structured includes are unsupported. Previously compiled prompt versions remain available for execution. attr_reader :template # User-supplied identifier for this version. @@ -76,6 +83,7 @@ class LLMObsPromptVersionDataAttributes def self.attribute_map { :'author' => :'author', + :'authoring_template' => :'authoring_template', :'config' => :'config', :'created_at' => :'created_at', :'datasets' => :'datasets', @@ -99,6 +107,7 @@ def self.attribute_map def self.openapi_types { :'author' => :'String', + :'authoring_template' => :'LLMObsPromptTemplate', :'config' => :'Hash', :'created_at' => :'Time', :'datasets' => :'Array', @@ -139,6 +148,10 @@ def initialize(attributes = {}) self.author = attributes[:'author'] end + if attributes.key?(:'authoring_template') + self.authoring_template = attributes[:'authoring_template'] + end + if attributes.key?(:'config') self.config = attributes[:'config'] end @@ -290,6 +303,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && author == o.author && + authoring_template == o.authoring_template && config == o.config && created_at == o.created_at && datasets == o.datasets && @@ -312,7 +326,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [author, config, 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 + [author, authoring_template, config, 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