diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4d2fffc0cf..c2c0d78b98 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/src/datadog_api_client/v2/api/agent_observability_api.py b/src/datadog_api_client/v2/api/agent_observability_api.py index 6a21501da8..fee72df6ef 100644 --- a/src/datadog_api_client/v2/api/agent_observability_api.py +++ b/src/datadog_api_client/v2/api/agent_observability_api.py @@ -2482,6 +2482,11 @@ def create_llm_obs_prompt( 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 `_ or your Customer Success Manager. + + :param body: Create prompt payload. :type body: LLMObsCreatePromptRequest :rtype: LLMObsCreatePromptResponse @@ -2500,6 +2505,11 @@ def create_llm_obs_prompt_version( Create a new version of an existing Agent Observability prompt. + .. + + **Preview** : Prompt composition is available in Preview. To request access, contact `Datadog Support `_ or your Customer Success Manager. + + :param prompt_id: The customer-provided identifier of the Agent Observability prompt. :type prompt_id: str :param body: Create prompt version payload. diff --git a/src/datadog_api_client/v2/model/llm_obs_create_prompt_data_attributes.py b/src/datadog_api_client/v2/model/llm_obs_create_prompt_data_attributes.py index 1e1df4b86e..40021df017 100644 --- a/src/datadog_api_client/v2/model/llm_obs_create_prompt_data_attributes.py +++ b/src/datadog_api_client/v2/model/llm_obs_create_prompt_data_attributes.py @@ -18,6 +18,9 @@ from datadog_api_client.v2.model.llm_obs_prompt_version_label import LLMObsPromptVersionLabel from datadog_api_client.v2.model.llm_obs_prompt_template import LLMObsPromptTemplate from datadog_api_client.v2.model.llm_obs_prompt_chat_message import LLMObsPromptChatMessage + from datadog_api_client.v2.model.llm_obs_prompt_authoring_messages_template import ( + LLMObsPromptAuthoringMessagesTemplate, + ) class LLMObsCreatePromptDataAttributes(ModelNormal): @@ -58,7 +61,9 @@ def openapi_types(_): def __init__( self_, prompt_id: str, - template: Union[LLMObsPromptTemplate, str, List[LLMObsPromptChatMessage]], + template: Union[ + LLMObsPromptTemplate, str, List[LLMObsPromptChatMessage], LLMObsPromptAuthoringMessagesTemplate + ], config: Union[LLMObsPromptConfig, UnsetType] = unset, description: Union[str, UnsetType] = unset, env_ids: Union[List[str], UnsetType] = unset, @@ -85,7 +90,9 @@ def __init__( :param prompt_id: Customer-provided identifier for the new prompt. :type prompt_id: str - :param template: A text template or a list of chat messages. + :param template: 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 `_ 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. :type template: LLMObsPromptTemplate :param title: Optional title of the prompt. diff --git a/src/datadog_api_client/v2/model/llm_obs_create_prompt_version_data_attributes.py b/src/datadog_api_client/v2/model/llm_obs_create_prompt_version_data_attributes.py index 1f680c0ffd..be1ee69cfa 100644 --- a/src/datadog_api_client/v2/model/llm_obs_create_prompt_version_data_attributes.py +++ b/src/datadog_api_client/v2/model/llm_obs_create_prompt_version_data_attributes.py @@ -18,6 +18,9 @@ from datadog_api_client.v2.model.llm_obs_prompt_version_label import LLMObsPromptVersionLabel from datadog_api_client.v2.model.llm_obs_prompt_template import LLMObsPromptTemplate from datadog_api_client.v2.model.llm_obs_prompt_chat_message import LLMObsPromptChatMessage + from datadog_api_client.v2.model.llm_obs_prompt_authoring_messages_template import ( + LLMObsPromptAuthoringMessagesTemplate, + ) class LLMObsCreatePromptVersionDataAttributes(ModelNormal): @@ -47,7 +50,9 @@ def openapi_types(_): def __init__( self_, - template: Union[LLMObsPromptTemplate, str, List[LLMObsPromptChatMessage]], + template: Union[ + LLMObsPromptTemplate, str, List[LLMObsPromptChatMessage], LLMObsPromptAuthoringMessagesTemplate + ], config: Union[LLMObsPromptConfig, UnsetType] = unset, description: Union[str, UnsetType] = unset, env_ids: Union[List[str], UnsetType] = unset, @@ -70,7 +75,9 @@ def __init__( :param labels: Optional labels to attach to this version. Do not use this attribute for new integrations. **Deprecated**. :type labels: [LLMObsPromptVersionLabel], optional - :param template: A text template or a list of chat messages. + :param template: 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 `_ 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. :type template: LLMObsPromptTemplate :param user_version: Optional user-supplied version identifier for this version. diff --git a/src/datadog_api_client/v2/model/llm_obs_prompt_authoring_item.py b/src/datadog_api_client/v2/model/llm_obs_prompt_authoring_item.py new file mode 100644 index 0000000000..d5620b9208 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_prompt_authoring_item.py @@ -0,0 +1,46 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class LLMObsPromptAuthoringItem(ModelComposed): + def __init__(self, **kwargs): + """ + 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. + + :param content: Content of the message. + :type content: str + + :param role: Role of the message (for example `system`, `user`, or `assistant`). + :type role: str + + :param include: 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. + :type include: LLMObsPromptInclude + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.llm_obs_prompt_chat_message import LLMObsPromptChatMessage + from datadog_api_client.v2.model.llm_obs_prompt_include_item import LLMObsPromptIncludeItem + + return { + "oneOf": [ + LLMObsPromptChatMessage, + LLMObsPromptIncludeItem, + ], + } diff --git a/src/datadog_api_client/v2/model/llm_obs_prompt_authoring_messages_template.py b/src/datadog_api_client/v2/model/llm_obs_prompt_authoring_messages_template.py new file mode 100644 index 0000000000..27c96e23ed --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_prompt_authoring_messages_template.py @@ -0,0 +1,52 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.llm_obs_prompt_authoring_item import LLMObsPromptAuthoringItem + from datadog_api_client.v2.model.llm_obs_prompt_chat_message import LLMObsPromptChatMessage + from datadog_api_client.v2.model.llm_obs_prompt_include_item import LLMObsPromptIncludeItem + + +class LLMObsPromptAuthoringMessagesTemplate(ModelNormal): + validations = { + "messages": { + "min_items": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_prompt_authoring_item import LLMObsPromptAuthoringItem + + return { + "messages": ([LLMObsPromptAuthoringItem],), + } + + attribute_map = { + "messages": "messages", + } + + def __init__( + self_, + messages: List[Union[LLMObsPromptAuthoringItem, LLMObsPromptChatMessage, LLMObsPromptIncludeItem]], + **kwargs, + ): + """ + A chat prompt whose authored items are stored under ``messages``. + + :param messages: A chat prompt containing messages, references to specific versions of other prompts, or both. + :type messages: [LLMObsPromptAuthoringItem] + """ + super().__init__(kwargs) + + self_.messages = messages diff --git a/src/datadog_api_client/v2/model/llm_obs_prompt_include.py b/src/datadog_api_client/v2/model/llm_obs_prompt_include.py new file mode 100644 index 0000000000..a02f1d043d --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_prompt_include.py @@ -0,0 +1,66 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class LLMObsPromptInclude(ModelNormal): + validations = { + "items": { + "min_items": 1, + }, + "prompt_id": { + "min_length": 1, + }, + "version": { + "inclusive_maximum": 2147483647, + "inclusive_minimum": 1, + }, + } + + @cached_property + def additional_properties_type(_): + return None + + @cached_property + def openapi_types(_): + return { + "items": ([int],), + "prompt_id": (str,), + "version": (int,), + } + + attribute_map = { + "items": "items", + "prompt_id": "prompt_id", + "version": "version", + } + + def __init__(self_, prompt_id: str, version: int, items: Union[List[int], UnsetType] = unset, **kwargs): + """ + 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. + + :param items: 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. + :type items: [int], optional + + :param prompt_id: Customer-provided identifier of the included prompt. + :type prompt_id: str + + :param version: Positive sequential version number of the included prompt. + :type version: int + """ + if items is not unset: + kwargs["items"] = items + super().__init__(kwargs) + + self_.prompt_id = prompt_id + self_.version = version diff --git a/src/datadog_api_client/v2/model/llm_obs_prompt_include_item.py b/src/datadog_api_client/v2/model/llm_obs_prompt_include_item.py new file mode 100644 index 0000000000..f640c68b22 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_prompt_include_item.py @@ -0,0 +1,44 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.llm_obs_prompt_include import LLMObsPromptInclude + + +class LLMObsPromptIncludeItem(ModelNormal): + @cached_property + def additional_properties_type(_): + return None + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_prompt_include import LLMObsPromptInclude + + return { + "include": (LLMObsPromptInclude,), + } + + attribute_map = { + "include": "include", + } + + def __init__(self_, include: LLMObsPromptInclude, **kwargs): + """ + Includes all or selected messages from a specific version of another prompt. + + :param include: 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. + :type include: LLMObsPromptInclude + """ + super().__init__(kwargs) + + self_.include = include diff --git a/src/datadog_api_client/v2/model/llm_obs_prompt_template.py b/src/datadog_api_client/v2/model/llm_obs_prompt_template.py index 5d5340dc11..1ec7efd511 100644 --- a/src/datadog_api_client/v2/model/llm_obs_prompt_template.py +++ b/src/datadog_api_client/v2/model/llm_obs_prompt_template.py @@ -13,7 +13,12 @@ class LLMObsPromptTemplate(ModelComposed): def __init__(self, **kwargs): """ - 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 `_ 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. + + :param messages: A chat prompt containing messages, references to specific versions of other prompts, or both. + :type messages: [LLMObsPromptAuthoringItem] """ super().__init__(kwargs) @@ -27,10 +32,14 @@ def _composed_schemas(_): # classes don't exist yet because their module has not finished # loading from datadog_api_client.v2.model.llm_obs_prompt_chat_message import LLMObsPromptChatMessage + from datadog_api_client.v2.model.llm_obs_prompt_authoring_messages_template import ( + LLMObsPromptAuthoringMessagesTemplate, + ) return { "oneOf": [ str, [LLMObsPromptChatMessage], + LLMObsPromptAuthoringMessagesTemplate, ], } diff --git a/src/datadog_api_client/v2/model/llm_obs_prompt_version_data.py b/src/datadog_api_client/v2/model/llm_obs_prompt_version_data.py index ef70c60d3b..6a060a3f77 100644 --- a/src/datadog_api_client/v2/model/llm_obs_prompt_version_data.py +++ b/src/datadog_api_client/v2/model/llm_obs_prompt_version_data.py @@ -40,7 +40,7 @@ def __init__( """ Data object for a specific version of an Agent Observability prompt. - :param attributes: 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. + :param attributes: 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. :type attributes: LLMObsPromptVersionDataAttributes :param id: Unique identifier of the prompt version. diff --git a/src/datadog_api_client/v2/model/llm_obs_prompt_version_data_attributes.py b/src/datadog_api_client/v2/model/llm_obs_prompt_version_data_attributes.py index 000bacb364..3c2ba43c4d 100644 --- a/src/datadog_api_client/v2/model/llm_obs_prompt_version_data_attributes.py +++ b/src/datadog_api_client/v2/model/llm_obs_prompt_version_data_attributes.py @@ -15,10 +15,13 @@ if TYPE_CHECKING: + from datadog_api_client.v2.model.llm_obs_prompt_template import LLMObsPromptTemplate from datadog_api_client.v2.model.llm_obs_prompt_config import LLMObsPromptConfig from datadog_api_client.v2.model.llm_obs_prompt_dataset import LLMObsPromptDataset - from datadog_api_client.v2.model.llm_obs_prompt_template import LLMObsPromptTemplate from datadog_api_client.v2.model.llm_obs_prompt_chat_message import LLMObsPromptChatMessage + from datadog_api_client.v2.model.llm_obs_prompt_authoring_messages_template import ( + LLMObsPromptAuthoringMessagesTemplate, + ) class LLMObsPromptVersionDataAttributes(ModelNormal): @@ -30,12 +33,13 @@ class LLMObsPromptVersionDataAttributes(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_prompt_template import LLMObsPromptTemplate from datadog_api_client.v2.model.llm_obs_prompt_config import LLMObsPromptConfig from datadog_api_client.v2.model.llm_obs_prompt_dataset import LLMObsPromptDataset - from datadog_api_client.v2.model.llm_obs_prompt_template import LLMObsPromptTemplate return { "author": (str,), + "authoring_template": (LLMObsPromptTemplate,), "config": (LLMObsPromptConfig,), "created_at": (datetime,), "datasets": ([LLMObsPromptDataset],), @@ -55,6 +59,7 @@ def openapi_types(_): attribute_map = { "author": "author", + "authoring_template": "authoring_template", "config": "config", "created_at": "created_at", "datasets": "datasets", @@ -76,9 +81,14 @@ def __init__( self_, prompt_id: str, prompt_uuid: str, - template: Union[LLMObsPromptTemplate, str, List[LLMObsPromptChatMessage]], + template: Union[ + LLMObsPromptTemplate, str, List[LLMObsPromptChatMessage], LLMObsPromptAuthoringMessagesTemplate + ], version: int, author: Union[str, UnsetType] = unset, + authoring_template: Union[ + LLMObsPromptTemplate, str, List[LLMObsPromptChatMessage], LLMObsPromptAuthoringMessagesTemplate, UnsetType + ] = unset, config: Union[LLMObsPromptConfig, UnsetType] = unset, created_at: Union[datetime, UnsetType] = unset, datasets: Union[List[LLMObsPromptDataset], UnsetType] = unset, @@ -93,11 +103,16 @@ def __init__( **kwargs, ): """ - 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. :param author: UUID of the user who authored this version. :type author: str, optional + :param authoring_template: 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 `_ 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. + :type authoring_template: LLMObsPromptTemplate, optional + :param config: Versioned prompt configuration is in Preview. To request access, contact `Datadog 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. :type config: LLMObsPromptConfig, optional @@ -131,7 +146,9 @@ def __init__( :param tags: Tags observed on runs of this prompt version. :type tags: [str], optional - :param template: A text template or a list of chat messages. + :param template: 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 `_ 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. :type template: LLMObsPromptTemplate :param user_version: User-supplied identifier for this version. @@ -145,6 +162,8 @@ def __init__( """ if author is not unset: kwargs["author"] = author + if authoring_template is not unset: + kwargs["authoring_template"] = authoring_template if config is not unset: kwargs["config"] = config if created_at is not unset: diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 6fdcd0ee6b..a8fbacf823 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -5196,11 +5196,15 @@ from datadog_api_client.v2.model.llm_obs_project_update_data_request import LLMObsProjectUpdateDataRequest from datadog_api_client.v2.model.llm_obs_project_update_request import LLMObsProjectUpdateRequest from datadog_api_client.v2.model.llm_obs_projects_response import LLMObsProjectsResponse +from datadog_api_client.v2.model.llm_obs_prompt_authoring_item import LLMObsPromptAuthoringItem +from datadog_api_client.v2.model.llm_obs_prompt_authoring_messages_template import LLMObsPromptAuthoringMessagesTemplate from datadog_api_client.v2.model.llm_obs_prompt_chat_message import LLMObsPromptChatMessage from datadog_api_client.v2.model.llm_obs_prompt_config import LLMObsPromptConfig from datadog_api_client.v2.model.llm_obs_prompt_data import LLMObsPromptData from datadog_api_client.v2.model.llm_obs_prompt_data_attributes import LLMObsPromptDataAttributes from datadog_api_client.v2.model.llm_obs_prompt_dataset import LLMObsPromptDataset +from datadog_api_client.v2.model.llm_obs_prompt_include import LLMObsPromptInclude +from datadog_api_client.v2.model.llm_obs_prompt_include_item import LLMObsPromptIncludeItem from datadog_api_client.v2.model.llm_obs_prompt_response import LLMObsPromptResponse from datadog_api_client.v2.model.llm_obs_prompt_response_source import LLMObsPromptResponseSource from datadog_api_client.v2.model.llm_obs_prompt_sdk_data import LLMObsPromptSDKData @@ -15639,11 +15643,15 @@ "LLMObsProjectUpdateDataRequest", "LLMObsProjectUpdateRequest", "LLMObsProjectsResponse", + "LLMObsPromptAuthoringItem", + "LLMObsPromptAuthoringMessagesTemplate", "LLMObsPromptChatMessage", "LLMObsPromptConfig", "LLMObsPromptData", "LLMObsPromptDataAttributes", "LLMObsPromptDataset", + "LLMObsPromptInclude", + "LLMObsPromptIncludeItem", "LLMObsPromptResponse", "LLMObsPromptResponseSource", "LLMObsPromptSDKData",