diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a5ff8270d1..00dc198e25 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -41631,11 +41631,109 @@ components: format: int64 type: integer type: object + LLMObsAnnotatedInteractionByTraceItem: + description: An annotated interaction returned by the cross-queue lookup, including the source queue metadata. + properties: + annotations: + description: List of annotations for this interaction. + items: + $ref: "#/components/schemas/LLMObsAnnotationItem" + type: array + content_id: + description: Upstream entity identifier (trace ID, session ID, or deterministic display_block ID). + example: "trace-abc-123" + type: string + created_at: + description: Timestamp when the interaction was added to the queue. + example: "2025-06-01T12:00:00Z" + format: date-time + type: string + display_block: + $ref: "#/components/schemas/LLMObsContentBlocks" + id: + description: Unique identifier of the interaction. + example: "interaction-456" + type: string + modified_at: + description: Timestamp when the interaction was last updated. + example: "2025-06-01T12:00:00Z" + format: date-time + type: string + queue_id: + description: Identifier of the annotation queue this interaction belongs to. + example: "queue-uuid-001" + type: string + queue_name: + description: Name of the annotation queue this interaction belongs to. + example: "My Annotation Queue" + type: string + type: + $ref: "#/components/schemas/LLMObsAnyInteractionType" + required: + - id + - type + - content_id + - created_at + - modified_at + - queue_id + - queue_name + - annotations + type: object LLMObsAnnotatedInteractionItem: description: An interaction with its associated annotations. oneOf: - $ref: "#/components/schemas/LLMObsTraceAnnotatedInteractionItem" - $ref: "#/components/schemas/LLMObsDisplayBlockAnnotatedInteractionItem" + LLMObsAnnotatedInteractionsByTraceDataAttributesResponse: + description: Attributes of the cross-queue annotated interactions response. + properties: + annotated_interactions: + description: List of annotated interactions across all queues for the requested content IDs. + items: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionByTraceItem" + type: array + total_count: + description: Total number of annotated interactions matching the query. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + required: + - annotated_interactions + - total_count + type: object + LLMObsAnnotatedInteractionsByTraceDataResponse: + description: Data object for the cross-queue annotated interactions response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionsByTraceDataAttributesResponse" + id: + description: Opaque identifier for the response object. + example: "trace-query" + type: string + type: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionsByTraceType" + required: + - id + - type + - attributes + type: object + LLMObsAnnotatedInteractionsByTraceResponse: + description: Response containing annotated interactions across all queues for the requested content IDs. + properties: + data: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionsByTraceDataResponse" + required: + - data + type: object + LLMObsAnnotatedInteractionsByTraceType: + description: Resource type for cross-queue annotated interactions lookup. + enum: + - annotated_interactions_by_trace + example: annotated_interactions_by_trace + type: string + x-enum-varnames: + - ANNOTATED_INTERACTIONS_BY_TRACE LLMObsAnnotatedInteractionsDataAttributesResponse: description: Attributes containing the list of annotated interactions. properties: @@ -42105,6 +42203,20 @@ components: - ENABLED - DISABLED - ADAPTIVE + LLMObsAnyInteractionType: + description: Type of an annotated interaction. + enum: + - trace + - experiment_trace + - session + - display_block + example: trace + type: string + x-enum-varnames: + - TRACE + - EXPERIMENT_TRACE + - SESSION + - DISPLAY_BLOCK LLMObsAzureOpenAIMetadata: description: Azure OpenAI-specific metadata for an integration account or inference request. properties: @@ -45121,6 +45233,90 @@ components: - AUTO - CONCISE - DETAILED + LLMObsOrgConfigDataAttributesResponse: + description: Attributes of the LLM Observability org configuration. + properties: + trace_idle_timer_s: + description: |- + Idle timer for LLM traces in seconds. When a trace has no new spans + for this duration it is considered complete. Must be between 1 and 600. + example: 30 + format: int32 + maximum: 600 + type: integer + required: + - trace_idle_timer_s + type: object + LLMObsOrgConfigDataResponse: + description: Data object for the LLM Observability org configuration. + properties: + attributes: + $ref: "#/components/schemas/LLMObsOrgConfigDataAttributesResponse" + id: + description: The organization ID. + example: "12345" + type: string + type: + $ref: "#/components/schemas/LLMObsOrgConfigType" + required: + - id + - type + - attributes + type: object + LLMObsOrgConfigResponse: + description: Response containing the LLM Observability org configuration. + properties: + data: + $ref: "#/components/schemas/LLMObsOrgConfigDataResponse" + required: + - data + type: object + LLMObsOrgConfigType: + description: Resource type for LLM Observability org configuration. + enum: + - org_config + example: org_config + type: string + x-enum-varnames: + - ORG_CONFIG + LLMObsOrgConfigUpdateData: + description: Data object for updating the LLM Observability org configuration. + properties: + attributes: + $ref: "#/components/schemas/LLMObsOrgConfigUpdateDataAttributes" + id: + description: The organization ID. + example: "12345" + type: string + type: + $ref: "#/components/schemas/LLMObsOrgConfigType" + required: + - type + - attributes + type: object + LLMObsOrgConfigUpdateDataAttributes: + description: Attributes for updating the LLM Observability org configuration. + properties: + trace_idle_timer_s: + description: |- + Idle timer for LLM traces in seconds. When a trace has no new spans + for this duration it is considered complete. Must be between 1 and 600. + example: 30 + format: int32 + maximum: 600 + minimum: 1 + type: integer + required: + - trace_idle_timer_s + type: object + LLMObsOrgConfigUpdateRequest: + description: Request to update the LLM Observability org configuration. + properties: + data: + $ref: "#/components/schemas/LLMObsOrgConfigUpdateData" + required: + - data + type: object LLMObsProjectDataAttributesRequest: description: Attributes for creating an LLM Observability project. properties: @@ -121428,6 +121624,209 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/org/config: + get: + description: Retrieve the LLM Observability configuration for the authenticated organization. + operationId: GetLLMObsOrgConfig + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + trace_idle_timer_s: 30 + id: "12345" + type: org_config + schema: + $ref: "#/components/schemas/LLMObsOrgConfigResponse" + 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" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get LLM Observability org configuration + 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/). + put: + description: |- + Update the LLM Observability configuration for the authenticated organization. + The `trace_idle_timer_s` value must be between 1 and 600 seconds. + operationId: UpdateLLMObsOrgConfig + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + trace_idle_timer_s: 30 + type: org_config + schema: + $ref: "#/components/schemas/LLMObsOrgConfigUpdateRequest" + description: Org configuration update 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" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update LLM Observability org configuration + 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/annotated-interactions: + get: + description: Returns annotated interactions across all annotation queues for the given content IDs. Results include queue metadata (ID and name) for each interaction. + operationId: GetLLMObsAnnotatedInteractionsByTraceIDs + parameters: + - description: One or more content IDs to retrieve annotated interactions for. At least one is required. + in: query + name: contentIds + required: true + schema: + items: + type: string + type: array + - description: Pagination offset. Must be >= 0. Defaults to 0. + in: query + name: offset + schema: + default: 0 + format: int32 + maximum: 2147483647 + minimum: 0 + type: integer + - description: Maximum number of results to return. Must be > 0. Defaults to 100. + in: query + name: limit + schema: + default: 100 + format: int32 + maximum: 2147483647 + minimum: 1 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + annotated_interactions: + - annotations: + - created_at: "0001-01-01T00:00:00Z" + created_by: "00000000-0000-0000-0000-000000000002" + id: annotation-789 + interaction_id: interaction-456 + label_values: + quality: good + modified_at: "0001-01-01T00:00:00Z" + modified_by: "00000000-0000-0000-0000-000000000002" + content_id: trace-abc-123 + created_at: "2025-06-01T12:00:00Z" + id: interaction-456 + modified_at: "2025-06-01T12:00:00Z" + queue_id: queue-uuid-001 + queue_name: My Annotation Queue + type: trace + total_count: 1 + id: trace-query + type: annotated_interactions_by_trace + schema: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionsByTraceResponse" + 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: Get annotated interactions by content IDs + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/llm-obs/v1/annotation-queues: get: description: |- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 09ac4c9e7e..3aa2260d8d 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -18204,6 +18204,13 @@ datadog\_api\_client.v2.model.list\_vulnerable\_assets\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.llm\_obs\_annotated\_interaction\_by\_trace\_item module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_annotated_interaction_by_trace_item + :members: + :show-inheritance: + datadog\_api\_client.v2.model.llm\_obs\_annotated\_interaction\_item module --------------------------------------------------------------------------- @@ -18211,6 +18218,34 @@ datadog\_api\_client.v2.model.llm\_obs\_annotated\_interaction\_item module :members: :show-inheritance: +datadog\_api\_client.v2.model.llm\_obs\_annotated\_interactions\_by\_trace\_data\_attributes\_response module +------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_data_attributes_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_annotated\_interactions\_by\_trace\_data\_response module +------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_data_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_annotated\_interactions\_by\_trace\_response module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_annotated\_interactions\_by\_trace\_type module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.llm\_obs\_annotated\_interactions\_data\_attributes\_response module -------------------------------------------------------------------------------------------------- @@ -18463,6 +18498,13 @@ datadog\_api\_client.v2.model.llm\_obs\_anthropic\_thinking\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.llm\_obs\_any\_interaction\_type module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_any_interaction_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.llm\_obs\_azure\_open\_ai\_metadata module ------------------------------------------------------------------------ @@ -19632,6 +19674,55 @@ datadog\_api\_client.v2.model.llm\_obs\_open\_ai\_reasoning\_summary module :members: :show-inheritance: +datadog\_api\_client.v2.model.llm\_obs\_org\_config\_data\_attributes\_response module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_org_config_data_attributes_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_org\_config\_data\_response module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_org_config_data_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_org\_config\_response module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_org_config_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_org\_config\_type module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_org_config_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_org\_config\_update\_data module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.llm_obs_org_config_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_org\_config\_update\_data\_attributes module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.llm_obs_org_config_update_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_org\_config\_update\_request module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_org_config_update_request + :members: + :show-inheritance: + datadog\_api\_client.v2.model.llm\_obs\_project\_data\_attributes\_request module --------------------------------------------------------------------------------- diff --git a/examples/v2/llm-observability/GetLLMObsAnnotatedInteractionsByTraceIDs.py b/examples/v2/llm-observability/GetLLMObsAnnotatedInteractionsByTraceIDs.py new file mode 100644 index 0000000000..3334199cec --- /dev/null +++ b/examples/v2/llm-observability/GetLLMObsAnnotatedInteractionsByTraceIDs.py @@ -0,0 +1,16 @@ +""" +Get annotated interactions by content IDs returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.llm_observability_api import LLMObservabilityApi + +configuration = Configuration() +configuration.unstable_operations["get_llm_obs_annotated_interactions_by_trace_i_ds"] = True +with ApiClient(configuration) as api_client: + api_instance = LLMObservabilityApi(api_client) + response = api_instance.get_llm_obs_annotated_interactions_by_trace_i_ds( + content_ids=[], + ) + + print(response) diff --git a/examples/v2/llm-observability/GetLLMObsOrgConfig.py b/examples/v2/llm-observability/GetLLMObsOrgConfig.py new file mode 100644 index 0000000000..51a4bb784c --- /dev/null +++ b/examples/v2/llm-observability/GetLLMObsOrgConfig.py @@ -0,0 +1,14 @@ +""" +Get LLM Observability org configuration returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.llm_observability_api import LLMObservabilityApi + +configuration = Configuration() +configuration.unstable_operations["get_llm_obs_org_config"] = True +with ApiClient(configuration) as api_client: + api_instance = LLMObservabilityApi(api_client) + response = api_instance.get_llm_obs_org_config() + + print(response) diff --git a/examples/v2/llm-observability/UpdateLLMObsOrgConfig.py b/examples/v2/llm-observability/UpdateLLMObsOrgConfig.py new file mode 100644 index 0000000000..07bc78ce6b --- /dev/null +++ b/examples/v2/llm-observability/UpdateLLMObsOrgConfig.py @@ -0,0 +1,26 @@ +""" +Update LLM Observability org configuration returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.llm_observability_api import LLMObservabilityApi +from datadog_api_client.v2.model.llm_obs_org_config_type import LLMObsOrgConfigType +from datadog_api_client.v2.model.llm_obs_org_config_update_data import LLMObsOrgConfigUpdateData +from datadog_api_client.v2.model.llm_obs_org_config_update_data_attributes import LLMObsOrgConfigUpdateDataAttributes +from datadog_api_client.v2.model.llm_obs_org_config_update_request import LLMObsOrgConfigUpdateRequest + +body = LLMObsOrgConfigUpdateRequest( + data=LLMObsOrgConfigUpdateData( + attributes=LLMObsOrgConfigUpdateDataAttributes( + trace_idle_timer_s=30, + ), + id="12345", + type=LLMObsOrgConfigType.ORG_CONFIG, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_llm_obs_org_config"] = True +with ApiClient(configuration) as api_client: + api_instance = LLMObservabilityApi(api_client) + api_instance.update_llm_obs_org_config(body=body) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 9aafd042c7..a9ba2265c6 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -283,8 +283,10 @@ def __init__( "v2.delete_llm_obs_experiments": False, "v2.delete_llm_obs_projects": False, "v2.get_llm_obs_annotated_interactions": False, + "v2.get_llm_obs_annotated_interactions_by_trace_i_ds": False, "v2.get_llm_obs_annotation_queue_label_schema": False, "v2.get_llm_obs_custom_eval_config": False, + "v2.get_llm_obs_org_config": False, "v2.list_llm_obs_annotation_queues": False, "v2.list_llm_obs_dataset_records": False, "v2.list_llm_obs_datasets": False, @@ -303,6 +305,7 @@ def __init__( "v2.update_llm_obs_dataset": False, "v2.update_llm_obs_dataset_records": False, "v2.update_llm_obs_experiment": False, + "v2.update_llm_obs_org_config": False, "v2.update_llm_obs_project": False, "v2.anonymize_users": False, "v2.validate": False, diff --git a/src/datadog_api_client/v2/api/llm_observability_api.py b/src/datadog_api_client/v2/api/llm_observability_api.py index 2f47f441a9..74d4e131a3 100644 --- a/src/datadog_api_client/v2/api/llm_observability_api.py +++ b/src/datadog_api_client/v2/api/llm_observability_api.py @@ -15,6 +15,11 @@ from datadog_api_client.v2.model.llm_obs_custom_eval_config_update_request import LLMObsCustomEvalConfigUpdateRequest from datadog_api_client.v2.model.llm_obs_data_deletion_response import LLMObsDataDeletionResponse from datadog_api_client.v2.model.llm_obs_data_deletion_request import LLMObsDataDeletionRequest +from datadog_api_client.v2.model.llm_obs_org_config_response import LLMObsOrgConfigResponse +from datadog_api_client.v2.model.llm_obs_org_config_update_request import LLMObsOrgConfigUpdateRequest +from datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_response import ( + LLMObsAnnotatedInteractionsByTraceResponse, +) from datadog_api_client.v2.model.llm_obs_annotation_queues_response import LLMObsAnnotationQueuesResponse from datadog_api_client.v2.model.llm_obs_annotation_queue_response import LLMObsAnnotationQueueResponse from datadog_api_client.v2.model.llm_obs_annotation_queue_request import LLMObsAnnotationQueueRequest @@ -523,6 +528,48 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_llm_obs_annotated_interactions_by_trace_i_ds_endpoint = _Endpoint( + settings={ + "response_type": (LLMObsAnnotatedInteractionsByTraceResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/llm-obs/v1/annotated-interactions", + "operation_id": "get_llm_obs_annotated_interactions_by_trace_i_ds", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "content_ids": { + "required": True, + "openapi_types": ([str],), + "attribute": "contentIds", + "location": "query", + "collection_format": "multi", + }, + "offset": { + "validation": { + "inclusive_maximum": 2147483647, + "inclusive_minimum": 0, + }, + "openapi_types": (int,), + "attribute": "offset", + "location": "query", + }, + "limit": { + "validation": { + "inclusive_maximum": 2147483647, + "inclusive_minimum": 1, + }, + "openapi_types": (int,), + "attribute": "limit", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_llm_obs_annotation_queue_label_schema_endpoint = _Endpoint( settings={ "response_type": (LLMObsAnnotationQueueLabelSchemaResponse,), @@ -569,6 +616,22 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_llm_obs_org_config_endpoint = _Endpoint( + settings={ + "response_type": (LLMObsOrgConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/llm-obs/org/config", + "operation_id": "get_llm_obs_org_config", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_llm_obs_annotation_queues_endpoint = _Endpoint( settings={ "response_type": (LLMObsAnnotationQueuesResponse,), @@ -1153,6 +1216,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_llm_obs_org_config_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/llm-obs/org/config", + "operation_id": "update_llm_obs_org_config", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (LLMObsOrgConfigUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._update_llm_obs_project_endpoint = _Endpoint( settings={ "response_type": (LLMObsProjectResponse,), @@ -1555,6 +1638,36 @@ def get_llm_obs_annotated_interactions( return self._get_llm_obs_annotated_interactions_endpoint.call_with_http_info(**kwargs) + def get_llm_obs_annotated_interactions_by_trace_i_ds( + self, + content_ids: List[str], + *, + offset: Union[int, UnsetType] = unset, + limit: Union[int, UnsetType] = unset, + ) -> LLMObsAnnotatedInteractionsByTraceResponse: + """Get annotated interactions by content IDs. + + Returns annotated interactions across all annotation queues for the given content IDs. Results include queue metadata (ID and name) for each interaction. + + :param content_ids: One or more content IDs to retrieve annotated interactions for. At least one is required. + :type content_ids: [str] + :param offset: Pagination offset. Must be >= 0. Defaults to 0. + :type offset: int, optional + :param limit: Maximum number of results to return. Must be > 0. Defaults to 100. + :type limit: int, optional + :rtype: LLMObsAnnotatedInteractionsByTraceResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["content_ids"] = content_ids + + if offset is not unset: + kwargs["offset"] = offset + + if limit is not unset: + kwargs["limit"] = limit + + return self._get_llm_obs_annotated_interactions_by_trace_i_ds_endpoint.call_with_http_info(**kwargs) + def get_llm_obs_annotation_queue_label_schema( self, queue_id: str, @@ -1589,6 +1702,18 @@ def get_llm_obs_custom_eval_config( return self._get_llm_obs_custom_eval_config_endpoint.call_with_http_info(**kwargs) + def get_llm_obs_org_config( + self, + ) -> LLMObsOrgConfigResponse: + """Get LLM Observability org configuration. + + Retrieve the LLM Observability configuration for the authenticated organization. + + :rtype: LLMObsOrgConfigResponse + """ + kwargs: Dict[str, Any] = {} + return self._get_llm_obs_org_config_endpoint.call_with_http_info(**kwargs) + def list_llm_obs_annotation_queues( self, *, @@ -2135,6 +2260,24 @@ def update_llm_obs_experiment( return self._update_llm_obs_experiment_endpoint.call_with_http_info(**kwargs) + def update_llm_obs_org_config( + self, + body: LLMObsOrgConfigUpdateRequest, + ) -> None: + """Update LLM Observability org configuration. + + Update the LLM Observability configuration for the authenticated organization. + The ``trace_idle_timer_s`` value must be between 1 and 600 seconds. + + :param body: Org configuration update payload. + :type body: LLMObsOrgConfigUpdateRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._update_llm_obs_org_config_endpoint.call_with_http_info(**kwargs) + def update_llm_obs_project( self, project_id: str, diff --git a/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_by_trace_item.py b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_by_trace_item.py new file mode 100644 index 0000000000..82e0179718 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_by_trace_item.py @@ -0,0 +1,115 @@ +# 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, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.llm_obs_annotation_item import LLMObsAnnotationItem + from datadog_api_client.v2.model.llm_obs_content_block import LLMObsContentBlock + from datadog_api_client.v2.model.llm_obs_any_interaction_type import LLMObsAnyInteractionType + + +class LLMObsAnnotatedInteractionByTraceItem(ModelNormal): + validations = { + "display_block": { + "min_items": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_annotation_item import LLMObsAnnotationItem + from datadog_api_client.v2.model.llm_obs_content_block import LLMObsContentBlock + from datadog_api_client.v2.model.llm_obs_any_interaction_type import LLMObsAnyInteractionType + + return { + "annotations": ([LLMObsAnnotationItem],), + "content_id": (str,), + "created_at": (datetime,), + "display_block": ([LLMObsContentBlock],), + "id": (str,), + "modified_at": (datetime,), + "queue_id": (str,), + "queue_name": (str,), + "type": (LLMObsAnyInteractionType,), + } + + attribute_map = { + "annotations": "annotations", + "content_id": "content_id", + "created_at": "created_at", + "display_block": "display_block", + "id": "id", + "modified_at": "modified_at", + "queue_id": "queue_id", + "queue_name": "queue_name", + "type": "type", + } + + def __init__( + self_, + annotations: List[LLMObsAnnotationItem], + content_id: str, + created_at: datetime, + id: str, + modified_at: datetime, + queue_id: str, + queue_name: str, + type: LLMObsAnyInteractionType, + display_block: Union[List[LLMObsContentBlock], UnsetType] = unset, + **kwargs, + ): + """ + An annotated interaction returned by the cross-queue lookup, including the source queue metadata. + + :param annotations: List of annotations for this interaction. + :type annotations: [LLMObsAnnotationItem] + + :param content_id: Upstream entity identifier (trace ID, session ID, or deterministic display_block ID). + :type content_id: str + + :param created_at: Timestamp when the interaction was added to the queue. + :type created_at: datetime + + :param display_block: List of content blocks that make up a ``display_block`` interaction. + Must contain at least one block. + :type display_block: [LLMObsContentBlock], optional + + :param id: Unique identifier of the interaction. + :type id: str + + :param modified_at: Timestamp when the interaction was last updated. + :type modified_at: datetime + + :param queue_id: Identifier of the annotation queue this interaction belongs to. + :type queue_id: str + + :param queue_name: Name of the annotation queue this interaction belongs to. + :type queue_name: str + + :param type: Type of an annotated interaction. + :type type: LLMObsAnyInteractionType + """ + if display_block is not unset: + kwargs["display_block"] = display_block + super().__init__(kwargs) + + self_.annotations = annotations + self_.content_id = content_id + self_.created_at = created_at + self_.id = id + self_.modified_at = modified_at + self_.queue_id = queue_id + self_.queue_name = queue_name + self_.type = type diff --git a/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_by_trace_data_attributes_response.py b/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_by_trace_data_attributes_response.py new file mode 100644 index 0000000000..e8613a01c0 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_by_trace_data_attributes_response.py @@ -0,0 +1,58 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.llm_obs_annotated_interaction_by_trace_item import ( + LLMObsAnnotatedInteractionByTraceItem, + ) + + +class LLMObsAnnotatedInteractionsByTraceDataAttributesResponse(ModelNormal): + validations = { + "total_count": { + "inclusive_maximum": 2147483647, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_annotated_interaction_by_trace_item import ( + LLMObsAnnotatedInteractionByTraceItem, + ) + + return { + "annotated_interactions": ([LLMObsAnnotatedInteractionByTraceItem],), + "total_count": (int,), + } + + attribute_map = { + "annotated_interactions": "annotated_interactions", + "total_count": "total_count", + } + + def __init__( + self_, annotated_interactions: List[LLMObsAnnotatedInteractionByTraceItem], total_count: int, **kwargs + ): + """ + Attributes of the cross-queue annotated interactions response. + + :param annotated_interactions: List of annotated interactions across all queues for the requested content IDs. + :type annotated_interactions: [LLMObsAnnotatedInteractionByTraceItem] + + :param total_count: Total number of annotated interactions matching the query. + :type total_count: int + """ + super().__init__(kwargs) + + self_.annotated_interactions = annotated_interactions + self_.total_count = total_count diff --git a/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_by_trace_data_response.py b/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_by_trace_data_response.py new file mode 100644 index 0000000000..0fea25480c --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_by_trace_data_response.py @@ -0,0 +1,68 @@ +# 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_annotated_interactions_by_trace_data_attributes_response import ( + LLMObsAnnotatedInteractionsByTraceDataAttributesResponse, + ) + from datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_type import ( + LLMObsAnnotatedInteractionsByTraceType, + ) + + +class LLMObsAnnotatedInteractionsByTraceDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_data_attributes_response import ( + LLMObsAnnotatedInteractionsByTraceDataAttributesResponse, + ) + from datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_type import ( + LLMObsAnnotatedInteractionsByTraceType, + ) + + return { + "attributes": (LLMObsAnnotatedInteractionsByTraceDataAttributesResponse,), + "id": (str,), + "type": (LLMObsAnnotatedInteractionsByTraceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: LLMObsAnnotatedInteractionsByTraceDataAttributesResponse, + id: str, + type: LLMObsAnnotatedInteractionsByTraceType, + **kwargs, + ): + """ + Data object for the cross-queue annotated interactions response. + + :param attributes: Attributes of the cross-queue annotated interactions response. + :type attributes: LLMObsAnnotatedInteractionsByTraceDataAttributesResponse + + :param id: Opaque identifier for the response object. + :type id: str + + :param type: Resource type for cross-queue annotated interactions lookup. + :type type: LLMObsAnnotatedInteractionsByTraceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_by_trace_response.py b/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_by_trace_response.py new file mode 100644 index 0000000000..bce75cedca --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_by_trace_response.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_annotated_interactions_by_trace_data_response import ( + LLMObsAnnotatedInteractionsByTraceDataResponse, + ) + + +class LLMObsAnnotatedInteractionsByTraceResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_data_response import ( + LLMObsAnnotatedInteractionsByTraceDataResponse, + ) + + return { + "data": (LLMObsAnnotatedInteractionsByTraceDataResponse,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: LLMObsAnnotatedInteractionsByTraceDataResponse, **kwargs): + """ + Response containing annotated interactions across all queues for the requested content IDs. + + :param data: Data object for the cross-queue annotated interactions response. + :type data: LLMObsAnnotatedInteractionsByTraceDataResponse + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_by_trace_type.py b/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_by_trace_type.py new file mode 100644 index 0000000000..a4781ea52e --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_by_trace_type.py @@ -0,0 +1,37 @@ +# 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 ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class LLMObsAnnotatedInteractionsByTraceType(ModelSimple): + """ + Resource type for cross-queue annotated interactions lookup. + + :param value: If omitted defaults to "annotated_interactions_by_trace". Must be one of ["annotated_interactions_by_trace"]. + :type value: str + """ + + allowed_values = { + "annotated_interactions_by_trace", + } + ANNOTATED_INTERACTIONS_BY_TRACE: ClassVar["LLMObsAnnotatedInteractionsByTraceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +LLMObsAnnotatedInteractionsByTraceType.ANNOTATED_INTERACTIONS_BY_TRACE = LLMObsAnnotatedInteractionsByTraceType( + "annotated_interactions_by_trace" +) diff --git a/src/datadog_api_client/v2/model/llm_obs_any_interaction_type.py b/src/datadog_api_client/v2/model/llm_obs_any_interaction_type.py new file mode 100644 index 0000000000..12f010a070 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_any_interaction_type.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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class LLMObsAnyInteractionType(ModelSimple): + """ + Type of an annotated interaction. + + :param value: Must be one of ["trace", "experiment_trace", "session", "display_block"]. + :type value: str + """ + + allowed_values = { + "trace", + "experiment_trace", + "session", + "display_block", + } + TRACE: ClassVar["LLMObsAnyInteractionType"] + EXPERIMENT_TRACE: ClassVar["LLMObsAnyInteractionType"] + SESSION: ClassVar["LLMObsAnyInteractionType"] + DISPLAY_BLOCK: ClassVar["LLMObsAnyInteractionType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +LLMObsAnyInteractionType.TRACE = LLMObsAnyInteractionType("trace") +LLMObsAnyInteractionType.EXPERIMENT_TRACE = LLMObsAnyInteractionType("experiment_trace") +LLMObsAnyInteractionType.SESSION = LLMObsAnyInteractionType("session") +LLMObsAnyInteractionType.DISPLAY_BLOCK = LLMObsAnyInteractionType("display_block") diff --git a/src/datadog_api_client/v2/model/llm_obs_org_config_data_attributes_response.py b/src/datadog_api_client/v2/model/llm_obs_org_config_data_attributes_response.py new file mode 100644 index 0000000000..b87cd76ce4 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_org_config_data_attributes_response.py @@ -0,0 +1,40 @@ +# 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 ( + ModelNormal, + cached_property, +) + + +class LLMObsOrgConfigDataAttributesResponse(ModelNormal): + validations = { + "trace_idle_timer_s": { + "inclusive_maximum": 600, + }, + } + + @cached_property + def openapi_types(_): + return { + "trace_idle_timer_s": (int,), + } + + attribute_map = { + "trace_idle_timer_s": "trace_idle_timer_s", + } + + def __init__(self_, trace_idle_timer_s: int, **kwargs): + """ + Attributes of the LLM Observability org configuration. + + :param trace_idle_timer_s: Idle timer for LLM traces in seconds. When a trace has no new spans + for this duration it is considered complete. Must be between 1 and 600. + :type trace_idle_timer_s: int + """ + super().__init__(kwargs) + + self_.trace_idle_timer_s = trace_idle_timer_s diff --git a/src/datadog_api_client/v2/model/llm_obs_org_config_data_response.py b/src/datadog_api_client/v2/model/llm_obs_org_config_data_response.py new file mode 100644 index 0000000000..1f3eca4a33 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_org_config_data_response.py @@ -0,0 +1,60 @@ +# 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_org_config_data_attributes_response import ( + LLMObsOrgConfigDataAttributesResponse, + ) + from datadog_api_client.v2.model.llm_obs_org_config_type import LLMObsOrgConfigType + + +class LLMObsOrgConfigDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_org_config_data_attributes_response import ( + LLMObsOrgConfigDataAttributesResponse, + ) + from datadog_api_client.v2.model.llm_obs_org_config_type import LLMObsOrgConfigType + + return { + "attributes": (LLMObsOrgConfigDataAttributesResponse,), + "id": (str,), + "type": (LLMObsOrgConfigType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: LLMObsOrgConfigDataAttributesResponse, id: str, type: LLMObsOrgConfigType, **kwargs + ): + """ + Data object for the LLM Observability org configuration. + + :param attributes: Attributes of the LLM Observability org configuration. + :type attributes: LLMObsOrgConfigDataAttributesResponse + + :param id: The organization ID. + :type id: str + + :param type: Resource type for LLM Observability org configuration. + :type type: LLMObsOrgConfigType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/llm_obs_org_config_response.py b/src/datadog_api_client/v2/model/llm_obs_org_config_response.py new file mode 100644 index 0000000000..1806c0a223 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_org_config_response.py @@ -0,0 +1,40 @@ +# 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_org_config_data_response import LLMObsOrgConfigDataResponse + + +class LLMObsOrgConfigResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_org_config_data_response import LLMObsOrgConfigDataResponse + + return { + "data": (LLMObsOrgConfigDataResponse,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: LLMObsOrgConfigDataResponse, **kwargs): + """ + Response containing the LLM Observability org configuration. + + :param data: Data object for the LLM Observability org configuration. + :type data: LLMObsOrgConfigDataResponse + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/llm_obs_org_config_type.py b/src/datadog_api_client/v2/model/llm_obs_org_config_type.py new file mode 100644 index 0000000000..e920c6e15c --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_org_config_type.py @@ -0,0 +1,35 @@ +# 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 ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class LLMObsOrgConfigType(ModelSimple): + """ + Resource type for LLM Observability org configuration. + + :param value: If omitted defaults to "org_config". Must be one of ["org_config"]. + :type value: str + """ + + allowed_values = { + "org_config", + } + ORG_CONFIG: ClassVar["LLMObsOrgConfigType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +LLMObsOrgConfigType.ORG_CONFIG = LLMObsOrgConfigType("org_config") diff --git a/src/datadog_api_client/v2/model/llm_obs_org_config_update_data.py b/src/datadog_api_client/v2/model/llm_obs_org_config_update_data.py new file mode 100644 index 0000000000..ffe8e52e4e --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_org_config_update_data.py @@ -0,0 +1,67 @@ +# 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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.llm_obs_org_config_update_data_attributes import ( + LLMObsOrgConfigUpdateDataAttributes, + ) + from datadog_api_client.v2.model.llm_obs_org_config_type import LLMObsOrgConfigType + + +class LLMObsOrgConfigUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_org_config_update_data_attributes import ( + LLMObsOrgConfigUpdateDataAttributes, + ) + from datadog_api_client.v2.model.llm_obs_org_config_type import LLMObsOrgConfigType + + return { + "attributes": (LLMObsOrgConfigUpdateDataAttributes,), + "id": (str,), + "type": (LLMObsOrgConfigType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: LLMObsOrgConfigUpdateDataAttributes, + type: LLMObsOrgConfigType, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Data object for updating the LLM Observability org configuration. + + :param attributes: Attributes for updating the LLM Observability org configuration. + :type attributes: LLMObsOrgConfigUpdateDataAttributes + + :param id: The organization ID. + :type id: str, optional + + :param type: Resource type for LLM Observability org configuration. + :type type: LLMObsOrgConfigType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/llm_obs_org_config_update_data_attributes.py b/src/datadog_api_client/v2/model/llm_obs_org_config_update_data_attributes.py new file mode 100644 index 0000000000..0af33f2fee --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_org_config_update_data_attributes.py @@ -0,0 +1,41 @@ +# 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 ( + ModelNormal, + cached_property, +) + + +class LLMObsOrgConfigUpdateDataAttributes(ModelNormal): + validations = { + "trace_idle_timer_s": { + "inclusive_maximum": 600, + "inclusive_minimum": 1, + }, + } + + @cached_property + def openapi_types(_): + return { + "trace_idle_timer_s": (int,), + } + + attribute_map = { + "trace_idle_timer_s": "trace_idle_timer_s", + } + + def __init__(self_, trace_idle_timer_s: int, **kwargs): + """ + Attributes for updating the LLM Observability org configuration. + + :param trace_idle_timer_s: Idle timer for LLM traces in seconds. When a trace has no new spans + for this duration it is considered complete. Must be between 1 and 600. + :type trace_idle_timer_s: int + """ + super().__init__(kwargs) + + self_.trace_idle_timer_s = trace_idle_timer_s diff --git a/src/datadog_api_client/v2/model/llm_obs_org_config_update_request.py b/src/datadog_api_client/v2/model/llm_obs_org_config_update_request.py new file mode 100644 index 0000000000..dabf7d23df --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_org_config_update_request.py @@ -0,0 +1,40 @@ +# 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_org_config_update_data import LLMObsOrgConfigUpdateData + + +class LLMObsOrgConfigUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_org_config_update_data import LLMObsOrgConfigUpdateData + + return { + "data": (LLMObsOrgConfigUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: LLMObsOrgConfigUpdateData, **kwargs): + """ + Request to update the LLM Observability org configuration. + + :param data: Data object for updating the LLM Observability org configuration. + :type data: LLMObsOrgConfigUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 4f93c7501d..88c590df96 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -3270,7 +3270,22 @@ from datadog_api_client.v2.model.kind_metadata import KindMetadata from datadog_api_client.v2.model.kind_obj import KindObj from datadog_api_client.v2.model.kind_response_meta import KindResponseMeta +from datadog_api_client.v2.model.llm_obs_annotated_interaction_by_trace_item import ( + LLMObsAnnotatedInteractionByTraceItem, +) from datadog_api_client.v2.model.llm_obs_annotated_interaction_item import LLMObsAnnotatedInteractionItem +from datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_data_attributes_response import ( + LLMObsAnnotatedInteractionsByTraceDataAttributesResponse, +) +from datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_data_response import ( + LLMObsAnnotatedInteractionsByTraceDataResponse, +) +from datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_response import ( + LLMObsAnnotatedInteractionsByTraceResponse, +) +from datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_type import ( + LLMObsAnnotatedInteractionsByTraceType, +) from datadog_api_client.v2.model.llm_obs_annotated_interactions_data_attributes_response import ( LLMObsAnnotatedInteractionsDataAttributesResponse, ) @@ -3343,6 +3358,7 @@ from datadog_api_client.v2.model.llm_obs_anthropic_metadata import LLMObsAnthropicMetadata from datadog_api_client.v2.model.llm_obs_anthropic_thinking_config import LLMObsAnthropicThinkingConfig from datadog_api_client.v2.model.llm_obs_anthropic_thinking_type import LLMObsAnthropicThinkingType +from datadog_api_client.v2.model.llm_obs_any_interaction_type import LLMObsAnyInteractionType from datadog_api_client.v2.model.llm_obs_azure_open_ai_metadata import LLMObsAzureOpenAIMetadata from datadog_api_client.v2.model.llm_obs_bedrock_metadata import LLMObsBedrockMetadata from datadog_api_client.v2.model.llm_obs_content_block import LLMObsContentBlock @@ -3598,6 +3614,15 @@ from datadog_api_client.v2.model.llm_obs_open_ai_metadata import LLMObsOpenAIMetadata from datadog_api_client.v2.model.llm_obs_open_ai_reasoning_effort import LLMObsOpenAIReasoningEffort from datadog_api_client.v2.model.llm_obs_open_ai_reasoning_summary import LLMObsOpenAIReasoningSummary +from datadog_api_client.v2.model.llm_obs_org_config_data_attributes_response import ( + LLMObsOrgConfigDataAttributesResponse, +) +from datadog_api_client.v2.model.llm_obs_org_config_data_response import LLMObsOrgConfigDataResponse +from datadog_api_client.v2.model.llm_obs_org_config_response import LLMObsOrgConfigResponse +from datadog_api_client.v2.model.llm_obs_org_config_type import LLMObsOrgConfigType +from datadog_api_client.v2.model.llm_obs_org_config_update_data import LLMObsOrgConfigUpdateData +from datadog_api_client.v2.model.llm_obs_org_config_update_data_attributes import LLMObsOrgConfigUpdateDataAttributes +from datadog_api_client.v2.model.llm_obs_org_config_update_request import LLMObsOrgConfigUpdateRequest from datadog_api_client.v2.model.llm_obs_project_data_attributes_request import LLMObsProjectDataAttributesRequest from datadog_api_client.v2.model.llm_obs_project_data_attributes_response import LLMObsProjectDataAttributesResponse from datadog_api_client.v2.model.llm_obs_project_data_request import LLMObsProjectDataRequest @@ -10532,7 +10557,12 @@ "KindMetadata", "KindObj", "KindResponseMeta", + "LLMObsAnnotatedInteractionByTraceItem", "LLMObsAnnotatedInteractionItem", + "LLMObsAnnotatedInteractionsByTraceDataAttributesResponse", + "LLMObsAnnotatedInteractionsByTraceDataResponse", + "LLMObsAnnotatedInteractionsByTraceResponse", + "LLMObsAnnotatedInteractionsByTraceType", "LLMObsAnnotatedInteractionsDataAttributesResponse", "LLMObsAnnotatedInteractionsDataResponse", "LLMObsAnnotatedInteractionsResponse", @@ -10569,6 +10599,7 @@ "LLMObsAnthropicMetadata", "LLMObsAnthropicThinkingConfig", "LLMObsAnthropicThinkingType", + "LLMObsAnyInteractionType", "LLMObsAzureOpenAIMetadata", "LLMObsBedrockMetadata", "LLMObsContentBlock", @@ -10736,6 +10767,13 @@ "LLMObsOpenAIMetadata", "LLMObsOpenAIReasoningEffort", "LLMObsOpenAIReasoningSummary", + "LLMObsOrgConfigDataAttributesResponse", + "LLMObsOrgConfigDataResponse", + "LLMObsOrgConfigResponse", + "LLMObsOrgConfigType", + "LLMObsOrgConfigUpdateData", + "LLMObsOrgConfigUpdateDataAttributes", + "LLMObsOrgConfigUpdateRequest", "LLMObsProjectDataAttributesRequest", "LLMObsProjectDataAttributesResponse", "LLMObsProjectDataRequest", diff --git a/tests/v2/features/llm_observability.feature b/tests/v2/features/llm_observability.feature index 0e1a7e984f..d72da68517 100644 --- a/tests/v2/features/llm_observability.feature +++ b/tests/v2/features/llm_observability.feature @@ -417,6 +417,13 @@ Feature: LLM Observability When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability + Scenario: Get LLM Observability org configuration returns "OK" response + Given operation "GetLLMObsOrgConfig" enabled + And new "GetLLMObsOrgConfig" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Get a custom evaluator configuration returns "Bad Request" response Given operation "GetLLMObsCustomEvalConfig" enabled @@ -441,6 +448,22 @@ Feature: LLM Observability 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 + And new "GetLLMObsAnnotatedInteractionsByTraceIDs" request + And request contains "contentIds" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Get annotated interactions by content IDs returns "OK" response + Given operation "GetLLMObsAnnotatedInteractionsByTraceIDs" enabled + And new "GetLLMObsAnnotatedInteractionsByTraceIDs" request + And request contains "contentIds" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Get annotated queue interactions returns "Bad Request" response Given operation "GetLLMObsAnnotatedInteractions" enabled @@ -779,6 +802,22 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Update LLM Observability org configuration returns "Bad Request" response + Given operation "UpdateLLMObsOrgConfig" enabled + And new "UpdateLLMObsOrgConfig" request + And body with value {"data": {"attributes": {"trace_idle_timer_s": 30}, "id": "12345", "type": "org_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Update LLM Observability org configuration returns "No Content" response + Given operation "UpdateLLMObsOrgConfig" enabled + And new "UpdateLLMObsOrgConfig" request + And body with value {"data": {"attributes": {"trace_idle_timer_s": 30}, "id": "12345", "type": "org_config"}} + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/ml-observability Scenario: Update an LLM Observability annotation queue returns "Bad Request" response Given operation "UpdateLLMObsAnnotationQueue" enabled diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index e676facc99..f8240feb33 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -3704,6 +3704,24 @@ "type": "unsafe" } }, + "GetLLMObsOrgConfig": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "UpdateLLMObsOrgConfig": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, + "GetLLMObsAnnotatedInteractionsByTraceIDs": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, "ListLLMObsAnnotationQueues": { "tag": "LLM Observability", "undo": {