From a44f89d6e4b457ba1db3bb428a1b2ad8d1862cc6 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 21 May 2026 13:26:13 +0000 Subject: [PATCH] Regenerate client from commit a213e9c of spec repo --- .generator/schemas/v2/openapi.yaml | 870 ++++++++++++++++++ .../CreateLLMObsIntegrationInference.rb | 105 +++ .../ListLLMObsIntegrationAccounts.rb | 8 + .../ListLLMObsIntegrationModels.rb | 8 + features/scenarios_model_mapping.rb | 12 + features/v2/llm_observability.feature | 54 ++ features/v2/undo.json | 18 + lib/datadog_api_client/configuration.rb | 3 + lib/datadog_api_client/inflector.rb | 26 + .../v2/api/llm_observability_api.rb | 245 +++++ .../v2/models/llm_obs_anthropic_effort.rb | 29 + .../v2/models/llm_obs_anthropic_metadata.rb | 123 +++ .../llm_obs_anthropic_thinking_config.rb | 141 +++ .../models/llm_obs_anthropic_thinking_type.rb | 28 + .../models/llm_obs_azure_open_ai_metadata.rb | 125 +++ .../v2/models/llm_obs_bedrock_metadata.rb | 105 +++ .../v2/models/llm_obs_inference_code.rb | 165 ++++ .../v2/models/llm_obs_inference_content.rb | 144 +++ .../models/llm_obs_inference_content_value.rb | 125 +++ .../llm_obs_inference_error_response.rb | 144 +++ .../v2/models/llm_obs_inference_function.rb | 154 ++++ .../v2/models/llm_obs_inference_message.rb | 161 ++++ .../v2/models/llm_obs_inference_run_result.rb | 302 ++++++ .../v2/models/llm_obs_inference_tool.rb | 144 +++ .../v2/models/llm_obs_inference_tool_call.rb | 135 +++ .../models/llm_obs_inference_tool_result.rb | 135 +++ .../v2/models/llm_obs_integration_account.rb | 216 +++++ .../llm_obs_integration_inference_request.rb | 303 ++++++ .../llm_obs_integration_inference_response.rb | 334 +++++++ .../v2/models/llm_obs_integration_model.rb | 301 ++++++ .../v2/models/llm_obs_integration_name.rb | 31 + .../v2/models/llm_obs_internal_reasoning.rb | 141 +++ .../v2/models/llm_obs_open_ai_metadata.rb | 124 +++ .../llm_obs_open_ai_reasoning_effort.rb | 30 + .../llm_obs_open_ai_reasoning_summary.rb | 28 + .../v2/models/llm_obs_vertex_ai_metadata.rb | 127 +++ 36 files changed, 5144 insertions(+) create mode 100644 examples/v2/llm-observability/CreateLLMObsIntegrationInference.rb create mode 100644 examples/v2/llm-observability/ListLLMObsIntegrationAccounts.rb create mode 100644 examples/v2/llm-observability/ListLLMObsIntegrationModels.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_anthropic_effort.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_anthropic_metadata.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_config.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_type.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_azure_open_ai_metadata.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_bedrock_metadata.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_code.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_content.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_content_value.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_error_response.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_function.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_message.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_run_result.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_tool.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_tool_call.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_tool_result.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_integration_account.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_integration_inference_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_integration_inference_response.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_integration_model.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_integration_name.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_internal_reasoning.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_open_ai_metadata.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_effort.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_summary.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_vertex_ai_metadata.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 25ad70c2815c..01e78f5f35d8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -813,6 +813,14 @@ components: schema: example: "my-job" type: string + LLMObsAccountIDPathParameter: + description: The ID of the integration account. + example: "account-abc123" + in: path + name: account_id + required: true + schema: + type: string LLMObsAnnotationQueueIDPathParameter: description: The ID of the LLM Observability annotation queue. example: "00000000-0000-0000-0000-000000000001" @@ -845,6 +853,14 @@ components: required: true schema: type: string + LLMObsIntegrationPathParameter: + description: The name of the LLM integration. + example: openai + in: path + name: integration + required: true + schema: + $ref: "#/components/schemas/LLMObsIntegrationName" LLMObsProjectIDPathParameter: description: The ID of the LLM Observability project. example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" @@ -41879,6 +41895,80 @@ components: required: - label_schemas type: object + LLMObsAnthropicEffort: + description: The effort level for Anthropic inference. + enum: + - low + - medium + - high + - max + example: medium + nullable: true + type: string + x-enum-varnames: + - LOW + - MEDIUM + - HIGH + - MAX + LLMObsAnthropicMetadata: + description: Anthropic-specific metadata for an inference request. + properties: + effort: + $ref: "#/components/schemas/LLMObsAnthropicEffort" + thinking: + $ref: "#/components/schemas/LLMObsAnthropicThinkingConfig" + nullable: true + type: object + LLMObsAnthropicThinkingConfig: + description: Configuration for Anthropic extended thinking feature. + properties: + budget_tokens: + description: Maximum token budget for extended thinking. Required when type is `enabled`. + example: 1024 + format: int64 + nullable: true + type: integer + type: + $ref: "#/components/schemas/LLMObsAnthropicThinkingType" + required: + - type + type: object + LLMObsAnthropicThinkingType: + description: The thinking mode for Anthropic extended thinking. + enum: + - enabled + - disabled + - adaptive + example: enabled + type: string + x-enum-varnames: + - ENABLED + - DISABLED + - ADAPTIVE + LLMObsAzureOpenAIMetadata: + description: Azure OpenAI-specific metadata for an integration account or inference request. + properties: + deployment_id: + description: The Azure OpenAI deployment ID. + example: "my-gpt4-deployment" + type: string + model_version: + description: The model version deployed in Azure. + example: "0613" + type: string + resource_name: + description: The Azure OpenAI resource name. + example: "my-azure-resource" + type: string + type: object + LLMObsBedrockMetadata: + description: Amazon Bedrock-specific metadata for an inference request. + properties: + region: + description: The AWS region for the Bedrock request. + example: "us-east-1" + type: string + type: object LLMObsContentBlock: description: |- A single content block rendered inside a `display_block` interaction. @@ -44204,6 +44294,536 @@ components: required: - data type: object + LLMObsInferenceCode: + description: A generated code snippet for running an inference request programmatically. + properties: + code: + description: The generated code content. + example: "import openai\nclient = openai.OpenAI()\n..." + type: string + id: + description: Unique identifier for the code snippet. + example: "code-python-001" + type: string + type: + description: The programming language or SDK type of the code snippet. + example: "python" + type: string + required: + - id + - type + - code + type: object + LLMObsInferenceContent: + description: A structured content block within a message. + properties: + type: + description: The content block type. + example: "text" + type: string + value: + $ref: "#/components/schemas/LLMObsInferenceContentValue" + required: + - type + - value + type: object + LLMObsInferenceContentList: + description: List of structured content blocks in a message. + items: + $ref: "#/components/schemas/LLMObsInferenceContent" + type: array + LLMObsInferenceContentValue: + description: The typed value of a message content block. + properties: + text: + description: Plain text content. + example: "Hello, how can I help you?" + type: string + tool_call: + $ref: "#/components/schemas/LLMObsInferenceToolCall" + tool_call_result: + $ref: "#/components/schemas/LLMObsInferenceToolResult" + type: object + LLMObsInferenceErrorResponse: + description: Error details returned when an inference provider returns an error. + properties: + message: + description: A human-readable description of the error. + example: "The model does not exist." + type: string + type: + description: The provider-specific error type. + example: "invalid_request_error" + type: string + required: + - type + - message + type: object + LLMObsInferenceFunction: + description: A function definition for a tool available to the model. + properties: + description: + description: A description of what the function does. + example: "Get the current weather for a location." + type: string + name: + description: The name of the function. + example: "get_weather" + type: string + parameters: + additionalProperties: {} + description: JSON schema describing the function parameters. + example: + properties: + location: + type: string + type: object + type: object + required: + - name + - parameters + type: object + LLMObsInferenceMessage: + description: A single message in an LLM inference conversation. + properties: + content: + description: Plain text content of the message. + example: "What is the capital of France?" + type: string + contents: + $ref: "#/components/schemas/LLMObsInferenceContentList" + id: + description: Unique identifier for the message. + example: "msg_001" + type: string + role: + description: The role of the message author. + example: "user" + type: string + tool_calls: + $ref: "#/components/schemas/LLMObsInferenceToolCallsList" + tool_results: + $ref: "#/components/schemas/LLMObsInferenceToolResultsList" + type: object + LLMObsInferenceMessagesList: + description: List of messages in an inference conversation. + items: + $ref: "#/components/schemas/LLMObsInferenceMessage" + type: array + LLMObsInferenceRunResult: + description: The output of a completed LLM inference call. + properties: + assessment: + description: An optional assessment of the inference output quality. + example: "pass" + nullable: true + type: string + content: + description: The text content of the model response. + example: "The capital of France is Paris." + type: string + finish_reason: + description: The reason the model stopped generating tokens. + example: "stop" + type: string + inference_codes: + $ref: "#/components/schemas/LLMObsIntegrationInferenceCodesResponse" + input_tokens: + description: Number of input tokens consumed. + example: 15 + format: int64 + type: integer + internal_reasoning: + $ref: "#/components/schemas/LLMObsInternalReasoning" + nullable: true + latency: + description: Request latency in milliseconds. + example: 843 + format: int64 + type: integer + output_tokens: + description: Number of output tokens generated. + example: 10 + format: int64 + type: integer + tools: + $ref: "#/components/schemas/LLMObsInferenceToolsList" + total_tokens: + description: Total tokens used (input plus output). + example: 25 + format: int64 + type: integer + required: + - content + - input_tokens + - output_tokens + - total_tokens + - latency + - finish_reason + - inference_codes + - tools + - assessment + type: object + LLMObsInferenceTool: + description: A tool definition available to the model during inference. + properties: + function: + $ref: "#/components/schemas/LLMObsInferenceFunction" + type: + description: The type of tool. + example: "function" + type: string + required: + - type + - function + type: object + LLMObsInferenceToolCall: + description: A tool call made during LLM inference. + properties: + arguments: + additionalProperties: {} + description: The arguments passed to the tool. + example: + location: "San Francisco" + type: object + name: + description: The name of the tool being called. + example: "get_weather" + type: string + tool_id: + description: Unique identifier for the tool call. + example: "call_abc123" + type: string + type: + description: The type of tool call. + example: "function" + type: string + type: object + LLMObsInferenceToolCallsList: + description: List of tool calls in a message. + items: + $ref: "#/components/schemas/LLMObsInferenceToolCall" + type: array + LLMObsInferenceToolResult: + description: The result returned by a tool call during LLM inference. + properties: + name: + description: The name of the tool that produced this result. + example: "get_weather" + type: string + result: + description: The result content returned by the tool. + example: "The weather in San Francisco is 68°F and sunny." + type: string + tool_id: + description: Identifier matching the corresponding tool call. + example: "call_abc123" + type: string + type: + description: The type of tool result. + example: "function" + type: string + type: object + LLMObsInferenceToolResultsList: + description: List of tool results in a message. + items: + $ref: "#/components/schemas/LLMObsInferenceToolResult" + type: array + LLMObsInferenceToolsList: + description: List of tools available to the model. + items: + $ref: "#/components/schemas/LLMObsInferenceTool" + type: array + LLMObsIntegrationAccount: + description: A configured account for an LLM provider integration. + properties: + account_id: + description: Provider-specific account identifier. + example: "org-XYZ123" + type: string + account_name: + description: Human-readable name for the integration account. + example: "Production OpenAI" + type: string + account_region: + description: Provider region associated with the account, if applicable. + example: "us-east-1" + type: string + azure_openai_metadata: + $ref: "#/components/schemas/LLMObsAzureOpenAIMetadata" + id: + description: Unique identifier for the integration account. + example: "account-abc123" + type: string + integration: + description: The name of the LLM provider integration. + example: openai + type: string + vertex_ai_metadata: + $ref: "#/components/schemas/LLMObsVertexAIMetadata" + required: + - id + - account_id + - account_name + - integration + type: object + LLMObsIntegrationInferenceCodesResponse: + description: List of generated code snippets for the inference configuration. + items: + $ref: "#/components/schemas/LLMObsInferenceCode" + type: array + LLMObsIntegrationInferenceRequest: + description: Parameters for an LLM inference request. + properties: + anthropic_metadata: + $ref: "#/components/schemas/LLMObsAnthropicMetadata" + nullable: true + azure_openai_metadata: + $ref: "#/components/schemas/LLMObsAzureOpenAIMetadata" + nullable: true + bedrock_metadata: + $ref: "#/components/schemas/LLMObsBedrockMetadata" + nullable: true + frequency_penalty: + description: Penalty for token frequency to reduce repetition. + example: 0.0 + format: double + nullable: true + type: number + json_schema: + description: JSON schema for structured output, if supported by the model. + example: '{"type":"object","properties":{"answer":{"type":"string"}}}' + nullable: true + type: string + max_completion_tokens: + description: Maximum number of completion tokens to generate (alternative to max_tokens for some providers). + example: 1024 + format: int64 + nullable: true + type: integer + max_tokens: + description: Maximum number of tokens to generate. + example: 1024 + format: int64 + nullable: true + type: integer + messages: + $ref: "#/components/schemas/LLMObsInferenceMessagesList" + model_id: + description: The model identifier to use for inference. + example: "gpt-4o" + type: string + openai_metadata: + $ref: "#/components/schemas/LLMObsOpenAIMetadata" + nullable: true + presence_penalty: + description: Penalty for token presence to encourage topic diversity. + example: 0.0 + format: double + nullable: true + type: number + temperature: + description: Sampling temperature between 0 and 2. Higher values produce more random output. + example: 0.7 + format: double + nullable: true + type: number + tools: + $ref: "#/components/schemas/LLMObsInferenceToolsList" + top_k: + description: Top-K sampling parameter. + example: 50 + format: int64 + nullable: true + type: integer + top_p: + description: Nucleus sampling probability mass. + example: 1.0 + format: double + nullable: true + type: number + vertex_ai_metadata: + $ref: "#/components/schemas/LLMObsVertexAIMetadata" + nullable: true + required: + - model_id + - messages + type: object + LLMObsIntegrationInferenceResponse: + description: The result of an LLM inference request, including input parameters and the model response. + properties: + anthropic_metadata: + $ref: "#/components/schemas/LLMObsAnthropicMetadata" + nullable: true + azure_openai_metadata: + $ref: "#/components/schemas/LLMObsAzureOpenAIMetadata" + nullable: true + bedrock_metadata: + $ref: "#/components/schemas/LLMObsBedrockMetadata" + nullable: true + error_response: + $ref: "#/components/schemas/LLMObsInferenceErrorResponse" + frequency_penalty: + description: Frequency penalty that was applied. + example: 0.0 + format: double + nullable: true + type: number + json_schema: + description: JSON schema that was applied for structured output. + example: '{"type":"object","properties":{"answer":{"type":"string"}}}' + nullable: true + type: string + max_completion_tokens: + description: Maximum number of completion tokens that were configured. + example: 1024 + format: int64 + nullable: true + type: integer + max_tokens: + description: Maximum number of tokens that were configured. + example: 1024 + format: int64 + nullable: true + type: integer + messages: + $ref: "#/components/schemas/LLMObsInferenceMessagesList" + model_id: + description: The model identifier used for inference. + example: "gpt-4o" + type: string + openai_metadata: + $ref: "#/components/schemas/LLMObsOpenAIMetadata" + nullable: true + presence_penalty: + description: Presence penalty that was applied. + example: 0.0 + format: double + nullable: true + type: number + response: + $ref: "#/components/schemas/LLMObsInferenceRunResult" + temperature: + description: Sampling temperature that was used. + example: 0.7 + format: double + nullable: true + type: number + tools: + $ref: "#/components/schemas/LLMObsInferenceToolsList" + top_k: + description: Top-K sampling parameter that was used. + example: 50 + format: int64 + nullable: true + type: integer + top_p: + description: Nucleus sampling parameter that was used. + example: 1.0 + format: double + nullable: true + type: number + vertex_ai_metadata: + $ref: "#/components/schemas/LLMObsVertexAIMetadata" + nullable: true + required: + - model_id + - messages + - response + type: object + LLMObsIntegrationModel: + description: A model available for a given LLM provider integration and account. + properties: + has_access: + description: Whether the account has access to this model. + example: true + type: boolean + id: + description: Unique identifier for the model entry. + example: "gpt-4o" + type: string + integration: + description: The name of the LLM provider integration. + example: "openai" + type: string + integration_display_name: + description: Human-readable name of the LLM provider integration. + example: "OpenAI" + type: string + json_schema: + description: Whether the model supports structured output via JSON schema. + example: true + type: boolean + model_display_name: + description: Human-readable model name. + example: "GPT-4o" + type: string + model_id: + description: Provider-specific model identifier used in inference calls. + example: "gpt-4o" + type: string + provider: + description: The underlying model provider. + example: "openai" + type: string + provider_display_name: + description: Human-readable name of the underlying model provider. + example: "OpenAI" + type: string + region_prefix_overrides: + $ref: "#/components/schemas/LLMObsIntegrationModelRegionPrefixOverrides" + required: + - id + - model_id + - model_display_name + - integration + - integration_display_name + - provider + - provider_display_name + - json_schema + - has_access + type: object + LLMObsIntegrationModelRegionPrefixOverrides: + additionalProperties: + type: string + description: Map of region-specific model ID prefix overrides. + example: + us-east-1: "us." + type: object + LLMObsIntegrationName: + description: The name of a supported LLM provider integration. + enum: + - openai + - amazon_bedrock + - anthropic + - azure_openai + - vertex_ai + - llmproxy + example: openai + type: string + x-enum-varnames: + - OPENAI + - AMAZON_BEDROCK + - ANTHROPIC + - AZURE_OPENAI + - VERTEX_AI + - LLMPROXY + LLMObsInternalReasoning: + description: The model's internal reasoning or thinking output, if available. + properties: + reasoning_tokens: + description: Number of tokens used for internal reasoning. + example: 256 + format: int64 + nullable: true + type: integer + text: + description: The reasoning text produced by the model. + example: "Let me think about this step by step..." + type: string + required: + - text + type: object LLMObsLabelSchema: description: Schema definition for a single label in an annotation queue. properties: @@ -44303,6 +44923,44 @@ components: - CATEGORICAL - BOOLEAN - JSON + LLMObsOpenAIMetadata: + description: OpenAI-specific metadata for an inference request. + properties: + reasoning_effort: + $ref: "#/components/schemas/LLMObsOpenAIReasoningEffort" + reasoning_summary: + $ref: "#/components/schemas/LLMObsOpenAIReasoningSummary" + type: object + LLMObsOpenAIReasoningEffort: + description: The reasoning effort level for OpenAI models that support it. + enum: + - none + - low + - medium + - high + - xhigh + example: medium + nullable: true + type: string + x-enum-varnames: + - NONE + - LOW + - MEDIUM + - HIGH + - XHIGH + LLMObsOpenAIReasoningSummary: + description: The verbosity of the reasoning summary. + enum: + - auto + - concise + - detailed + example: auto + nullable: true + type: string + x-enum-varnames: + - AUTO + - CONCISE + - DETAILED LLMObsProjectDataAttributesRequest: description: Attributes for creating an LLM Observability project. properties: @@ -44930,6 +45588,25 @@ components: - TRACE - EXPERIMENT_TRACE - SESSION + LLMObsVertexAIMetadata: + description: Vertex AI-specific metadata for an integration account or inference request. + properties: + location: + description: The Vertex AI region. + example: "us-central1" + type: string + project: + description: The Google Cloud project ID. + example: "my-gcp-project" + type: string + project_ids: + description: List of Google Cloud project IDs available to the service account. + example: + - "my-gcp-project" + items: + type: string + type: array + type: object Language: description: Programming language enum: @@ -121444,6 +122121,199 @@ 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/v1/integrations/{integration}/accounts: + get: + description: Retrieve the list of configured accounts for the specified LLM provider integration. + operationId: ListLLMObsIntegrationAccounts + parameters: + - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + - account_id: "org-XYZ123" + account_name: "Production OpenAI" + account_region: "" + id: "account-abc123" + integration: "openai" + schema: + items: + $ref: "#/components/schemas/LLMObsIntegrationAccount" + type: array + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List LLM integration accounts + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/integrations/{integration}/{account_id}/inference: + post: + description: Run an LLM inference request through the specified integration and account, returning the model response and token usage. + operationId: CreateLLMObsIntegrationInference + parameters: + - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" + - $ref: "#/components/parameters/LLMObsAccountIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + max_tokens: 256 + messages: + - content: "What is the capital of France?" + role: "user" + model_id: "gpt-4o" + temperature: 0.7 + schema: + $ref: "#/components/schemas/LLMObsIntegrationInferenceRequest" + description: Inference request parameters. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + max_tokens: 256 + messages: + - content: "What is the capital of France?" + role: "user" + model_id: "gpt-4o" + response: + assessment: "pass" + content: "The capital of France is Paris." + finish_reason: "stop" + inference_codes: [] + input_tokens: 15 + latency: 843 + output_tokens: 9 + tools: [] + total_tokens: 24 + temperature: 0.7 + schema: + $ref: "#/components/schemas/LLMObsIntegrationInferenceResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Run an LLM inference + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/integrations/{integration}/{account_id}/models: + get: + description: Retrieve the list of models available for the specified LLM provider integration and account. + operationId: ListLLMObsIntegrationModels + parameters: + - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" + - $ref: "#/components/parameters/LLMObsAccountIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + - has_access: true + id: "gpt-4o" + integration: "openai" + integration_display_name: "OpenAI" + json_schema: true + model_display_name: "GPT-4o" + model_id: "gpt-4o" + provider: "openai" + provider_display_name: "OpenAI" + schema: + items: + $ref: "#/components/schemas/LLMObsIntegrationModel" + type: array + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List LLM integration models + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/llm-obs/v1/projects: get: description: List all LLM Observability projects sorted by creation date, newest first. diff --git a/examples/v2/llm-observability/CreateLLMObsIntegrationInference.rb b/examples/v2/llm-observability/CreateLLMObsIntegrationInference.rb new file mode 100644 index 000000000000..7a85d0c223e5 --- /dev/null +++ b/examples/v2/llm-observability/CreateLLMObsIntegrationInference.rb @@ -0,0 +1,105 @@ +# Run an LLM inference returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_llm_obs_integration_inference".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +body = DatadogAPIClient::V2::LLMObsIntegrationInferenceRequest.new({ + anthropic_metadata: DatadogAPIClient::V2::LLMObsAnthropicMetadata.new({ + effort: DatadogAPIClient::V2::LLMObsAnthropicEffort::MEDIUM, + thinking: DatadogAPIClient::V2::LLMObsAnthropicThinkingConfig.new({ + budget_tokens: 1024, + type: DatadogAPIClient::V2::LLMObsAnthropicThinkingType::ENABLED, + }), + }), + azure_openai_metadata: DatadogAPIClient::V2::LLMObsAzureOpenAIMetadata.new({ + deployment_id: "my-gpt4-deployment", + model_version: "0613", + resource_name: "my-azure-resource", + }), + bedrock_metadata: DatadogAPIClient::V2::LLMObsBedrockMetadata.new({ + region: "us-east-1", + }), + frequency_penalty: 0.0, + json_schema: '{"type":"object","properties":{"answer":{"type":"string"}}}', + max_completion_tokens: 1024, + max_tokens: 1024, + messages: [ + DatadogAPIClient::V2::LLMObsInferenceMessage.new({ + content: "What is the capital of France?", + contents: [ + DatadogAPIClient::V2::LLMObsInferenceContent.new({ + type: "text", + value: DatadogAPIClient::V2::LLMObsInferenceContentValue.new({ + text: "Hello, how can I help you?", + tool_call: DatadogAPIClient::V2::LLMObsInferenceToolCall.new({ + arguments: { + "location": "San Francisco", + }, + name: "get_weather", + tool_id: "call_abc123", + type: "function", + }), + tool_call_result: DatadogAPIClient::V2::LLMObsInferenceToolResult.new({ + name: "get_weather", + result: "The weather in San Francisco is 68°F and sunny.", + tool_id: "call_abc123", + type: "function", + }), + }), + }), + ], + id: "msg_001", + role: "user", + tool_calls: [ + DatadogAPIClient::V2::LLMObsInferenceToolCall.new({ + arguments: { + "location": "San Francisco", + }, + name: "get_weather", + tool_id: "call_abc123", + type: "function", + }), + ], + tool_results: [ + DatadogAPIClient::V2::LLMObsInferenceToolResult.new({ + name: "get_weather", + result: "The weather in San Francisco is 68°F and sunny.", + tool_id: "call_abc123", + type: "function", + }), + ], + }), + ], + model_id: "gpt-4o", + openai_metadata: DatadogAPIClient::V2::LLMObsOpenAIMetadata.new({ + reasoning_effort: DatadogAPIClient::V2::LLMObsOpenAIReasoningEffort::MEDIUM, + reasoning_summary: DatadogAPIClient::V2::LLMObsOpenAIReasoningSummary::AUTO, + }), + presence_penalty: 0.0, + temperature: 0.7, + tools: [ + DatadogAPIClient::V2::LLMObsInferenceTool.new({ + function: DatadogAPIClient::V2::LLMObsInferenceFunction.new({ + description: "Get the current weather for a location.", + name: "get_weather", + parameters: { + "properties": "{'location': {'type': 'string'}}", "type": "object", + }, + }), + type: "function", + }), + ], + top_k: 50, + top_p: 1.0, + vertex_ai_metadata: DatadogAPIClient::V2::LLMObsVertexAIMetadata.new({ + location: "us-central1", + project: "my-gcp-project", + project_ids: [ + "my-gcp-project", + ], + }), +}) +p api_instance.create_llm_obs_integration_inference(LLMObsIntegrationName::OPENAI, "account_id", body) diff --git a/examples/v2/llm-observability/ListLLMObsIntegrationAccounts.rb b/examples/v2/llm-observability/ListLLMObsIntegrationAccounts.rb new file mode 100644 index 000000000000..25ac7de60822 --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsIntegrationAccounts.rb @@ -0,0 +1,8 @@ +# List LLM integration accounts returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_llm_obs_integration_accounts".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.list_llm_obs_integration_accounts(LLMObsIntegrationName::OPENAI) diff --git a/examples/v2/llm-observability/ListLLMObsIntegrationModels.rb b/examples/v2/llm-observability/ListLLMObsIntegrationModels.rb new file mode 100644 index 000000000000..bd25b614f861 --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsIntegrationModels.rb @@ -0,0 +1,8 @@ +# List LLM integration models returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_llm_obs_integration_models".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.list_llm_obs_integration_models(LLMObsIntegrationName::OPENAI, "account_id") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 9246b6c3a9d0..7612f595f75d 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -984,6 +984,18 @@ "experiment_id" => "String", "body" => "LLMObsExperimentEventsRequest", }, + "v2.ListLLMObsIntegrationAccounts" => { + "integration" => "LLMObsIntegrationName", + }, + "v2.CreateLLMObsIntegrationInference" => { + "integration" => "LLMObsIntegrationName", + "account_id" => "String", + "body" => "LLMObsIntegrationInferenceRequest", + }, + "v2.ListLLMObsIntegrationModels" => { + "integration" => "LLMObsIntegrationName", + "account_id" => "String", + }, "v2.ListLLMObsProjects" => { "filter_id" => "String", "filter_name" => "String", diff --git a/features/v2/llm_observability.feature b/features/v2/llm_observability.feature index ec671390145d..0e1a7e984fa0 100644 --- a/features/v2/llm_observability.feature +++ b/features/v2/llm_observability.feature @@ -588,6 +588,40 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM integration accounts returns "Bad Request" response + Given operation "ListLLMObsIntegrationAccounts" enabled + And new "ListLLMObsIntegrationAccounts" request + And request contains "integration" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM integration accounts returns "OK" response + Given operation "ListLLMObsIntegrationAccounts" enabled + And new "ListLLMObsIntegrationAccounts" request + And request contains "integration" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM integration models returns "Bad Request" response + Given operation "ListLLMObsIntegrationModels" enabled + And new "ListLLMObsIntegrationModels" request + And request contains "integration" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM integration models returns "OK" response + Given operation "ListLLMObsIntegrationModels" enabled + And new "ListLLMObsIntegrationModels" request + And request contains "integration" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: List events for an LLM Observability experiment returns "Bad Request" response Given operation "ListLLMObsExperimentEvents" enabled @@ -639,6 +673,26 @@ Feature: LLM Observability When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability + Scenario: Run an LLM inference returns "Bad Request" response + Given operation "CreateLLMObsIntegrationInference" enabled + And new "CreateLLMObsIntegrationInference" request + And request contains "integration" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"anthropic_metadata": {"effort": "medium", "thinking": {"budget_tokens": 1024, "type": "enabled"}}, "azure_openai_metadata": {"deployment_id": "my-gpt4-deployment", "model_version": "0613", "resource_name": "my-azure-resource"}, "bedrock_metadata": {"region": "us-east-1"}, "frequency_penalty": 0.0, "json_schema": "{\"type\":\"object\",\"properties\":{\"answer\":{\"type\":\"string\"}}}", "max_completion_tokens": 1024, "max_tokens": 1024, "messages": [{"content": "What is the capital of France?", "contents": [{"type": "text", "value": {"text": "Hello, how can I help you?", "tool_call": {"arguments": {"location": "San Francisco"}, "name": "get_weather", "tool_id": "call_abc123", "type": "function"}, "tool_call_result": {"name": "get_weather", "result": "The weather in San Francisco is 68\u00b0F and sunny.", "tool_id": "call_abc123", "type": "function"}}}], "id": "msg_001", "role": "user", "tool_calls": [{"arguments": {"location": "San Francisco"}, "name": "get_weather", "tool_id": "call_abc123", "type": "function"}], "tool_results": [{"name": "get_weather", "result": "The weather in San Francisco is 68\u00b0F and sunny.", "tool_id": "call_abc123", "type": "function"}]}], "model_id": "gpt-4o", "openai_metadata": {"reasoning_effort": "medium", "reasoning_summary": "auto"}, "presence_penalty": 0.0, "temperature": 0.7, "tools": [{"function": {"description": "Get the current weather for a location.", "name": "get_weather", "parameters": {"properties": {"location": {"type": "string"}}, "type": "object"}}, "type": "function"}], "top_k": 50, "top_p": 1.0, "vertex_ai_metadata": {"location": "us-central1", "project": "my-gcp-project", "project_ids": ["my-gcp-project"]}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Run an LLM inference returns "OK" response + Given operation "CreateLLMObsIntegrationInference" enabled + And new "CreateLLMObsIntegrationInference" request + And request contains "integration" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"anthropic_metadata": {"effort": "medium", "thinking": {"budget_tokens": 1024, "type": "enabled"}}, "azure_openai_metadata": {"deployment_id": "my-gpt4-deployment", "model_version": "0613", "resource_name": "my-azure-resource"}, "bedrock_metadata": {"region": "us-east-1"}, "frequency_penalty": 0.0, "json_schema": "{\"type\":\"object\",\"properties\":{\"answer\":{\"type\":\"string\"}}}", "max_completion_tokens": 1024, "max_tokens": 1024, "messages": [{"content": "What is the capital of France?", "contents": [{"type": "text", "value": {"text": "Hello, how can I help you?", "tool_call": {"arguments": {"location": "San Francisco"}, "name": "get_weather", "tool_id": "call_abc123", "type": "function"}, "tool_call_result": {"name": "get_weather", "result": "The weather in San Francisco is 68\u00b0F and sunny.", "tool_id": "call_abc123", "type": "function"}}}], "id": "msg_001", "role": "user", "tool_calls": [{"arguments": {"location": "San Francisco"}, "name": "get_weather", "tool_id": "call_abc123", "type": "function"}], "tool_results": [{"name": "get_weather", "result": "The weather in San Francisco is 68\u00b0F and sunny.", "tool_id": "call_abc123", "type": "function"}]}], "model_id": "gpt-4o", "openai_metadata": {"reasoning_effort": "medium", "reasoning_summary": "auto"}, "presence_penalty": 0.0, "temperature": 0.7, "tools": [{"function": {"description": "Get the current weather for a location.", "name": "get_weather", "parameters": {"properties": {"location": {"type": "string"}}, "type": "object"}}, "type": "function"}], "top_k": 50, "top_p": 1.0, "vertex_ai_metadata": {"location": "us-central1", "project": "my-gcp-project", "project_ids": ["my-gcp-project"]}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Search LLM Observability experimentation entities returns "Bad Request" response Given operation "SearchLLMObsExperimentation" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 02753f1a80a7..9c1afc7d96bb 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3797,6 +3797,24 @@ "type": "unsafe" } }, + "ListLLMObsIntegrationAccounts": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "CreateLLMObsIntegrationInference": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "ListLLMObsIntegrationModels": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, "ListLLMObsProjects": { "tag": "LLM Observability", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 0cac7943cea0..b3d8d620f33f 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -214,6 +214,7 @@ def initialize "v2.create_llm_obs_dataset_records": false, "v2.create_llm_obs_experiment": false, "v2.create_llm_obs_experiment_events": false, + "v2.create_llm_obs_integration_inference": false, "v2.create_llm_obs_project": false, "v2.delete_llm_obs_annotation_queue": false, "v2.delete_llm_obs_annotation_queue_interactions": false, @@ -231,6 +232,8 @@ def initialize "v2.list_llm_obs_datasets": false, "v2.list_llm_obs_experiment_events": false, "v2.list_llm_obs_experiments": false, + "v2.list_llm_obs_integration_accounts": false, + "v2.list_llm_obs_integration_models": false, "v2.list_llm_obs_projects": false, "v2.list_llm_obs_spans": false, "v2.search_llm_obs_experimentation": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 9e8451285fa8..8863cfe1432d 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3719,6 +3719,12 @@ def overrides "v2.llm_obs_annotation_queue_update_data_request" => "LLMObsAnnotationQueueUpdateDataRequest", "v2.llm_obs_annotation_queue_update_request" => "LLMObsAnnotationQueueUpdateRequest", "v2.llm_obs_annotation_schema" => "LLMObsAnnotationSchema", + "v2.llm_obs_anthropic_effort" => "LLMObsAnthropicEffort", + "v2.llm_obs_anthropic_metadata" => "LLMObsAnthropicMetadata", + "v2.llm_obs_anthropic_thinking_config" => "LLMObsAnthropicThinkingConfig", + "v2.llm_obs_anthropic_thinking_type" => "LLMObsAnthropicThinkingType", + "v2.llm_obs_azure_open_ai_metadata" => "LLMObsAzureOpenAIMetadata", + "v2.llm_obs_bedrock_metadata" => "LLMObsBedrockMetadata", "v2.llm_obs_content_block" => "LLMObsContentBlock", "v2.llm_obs_content_block_header_level" => "LLMObsContentBlockHeaderLevel", "v2.llm_obs_content_block_llm_obs_trace_interaction_type" => "LLMObsContentBlockLLMObsTraceInteractionType", @@ -3860,10 +3866,29 @@ def overrides "v2.llm_obs_experiment_update_data_attributes_request" => "LLMObsExperimentUpdateDataAttributesRequest", "v2.llm_obs_experiment_update_data_request" => "LLMObsExperimentUpdateDataRequest", "v2.llm_obs_experiment_update_request" => "LLMObsExperimentUpdateRequest", + "v2.llm_obs_inference_code" => "LLMObsInferenceCode", + "v2.llm_obs_inference_content" => "LLMObsInferenceContent", + "v2.llm_obs_inference_content_value" => "LLMObsInferenceContentValue", + "v2.llm_obs_inference_error_response" => "LLMObsInferenceErrorResponse", + "v2.llm_obs_inference_function" => "LLMObsInferenceFunction", + "v2.llm_obs_inference_message" => "LLMObsInferenceMessage", + "v2.llm_obs_inference_run_result" => "LLMObsInferenceRunResult", + "v2.llm_obs_inference_tool" => "LLMObsInferenceTool", + "v2.llm_obs_inference_tool_call" => "LLMObsInferenceToolCall", + "v2.llm_obs_inference_tool_result" => "LLMObsInferenceToolResult", + "v2.llm_obs_integration_account" => "LLMObsIntegrationAccount", + "v2.llm_obs_integration_inference_request" => "LLMObsIntegrationInferenceRequest", + "v2.llm_obs_integration_inference_response" => "LLMObsIntegrationInferenceResponse", + "v2.llm_obs_integration_model" => "LLMObsIntegrationModel", + "v2.llm_obs_integration_name" => "LLMObsIntegrationName", + "v2.llm_obs_internal_reasoning" => "LLMObsInternalReasoning", "v2.llm_obs_label_schema" => "LLMObsLabelSchema", "v2.llm_obs_label_schema_type" => "LLMObsLabelSchemaType", "v2.llm_obs_metric_assessment" => "LLMObsMetricAssessment", "v2.llm_obs_metric_score_type" => "LLMObsMetricScoreType", + "v2.llm_obs_open_ai_metadata" => "LLMObsOpenAIMetadata", + "v2.llm_obs_open_ai_reasoning_effort" => "LLMObsOpenAIReasoningEffort", + "v2.llm_obs_open_ai_reasoning_summary" => "LLMObsOpenAIReasoningSummary", "v2.llm_obs_project_data_attributes_request" => "LLMObsProjectDataAttributesRequest", "v2.llm_obs_project_data_attributes_response" => "LLMObsProjectDataAttributesResponse", "v2.llm_obs_project_data_request" => "LLMObsProjectDataRequest", @@ -3900,6 +3925,7 @@ def overrides "v2.llm_obs_trace_interaction_item" => "LLMObsTraceInteractionItem", "v2.llm_obs_trace_interaction_response_item" => "LLMObsTraceInteractionResponseItem", "v2.llm_obs_trace_interaction_type" => "LLMObsTraceInteractionType", + "v2.llm_obs_vertex_ai_metadata" => "LLMObsVertexAIMetadata", "v2.log" => "Log", "v2.log_attributes" => "LogAttributes", "v2.logs_aggregate_bucket" => "LogsAggregateBucket", diff --git a/lib/datadog_api_client/v2/api/llm_observability_api.rb b/lib/datadog_api_client/v2/api/llm_observability_api.rb index 7eb5a93af50e..4c2039ada331 100644 --- a/lib/datadog_api_client/v2/api/llm_observability_api.rb +++ b/lib/datadog_api_client/v2/api/llm_observability_api.rb @@ -574,6 +574,94 @@ def create_llm_obs_experiment_events_with_http_info(experiment_id, body, opts = return data, status_code, headers end + # Run an LLM inference. + # + # @see #create_llm_obs_integration_inference_with_http_info + def create_llm_obs_integration_inference(integration, account_id, body, opts = {}) + data, _status_code, _headers = create_llm_obs_integration_inference_with_http_info(integration, account_id, body, opts) + data + end + + # Run an LLM inference. + # + # Run an LLM inference request through the specified integration and account, returning the model response and token usage. + # + # @param integration [LLMObsIntegrationName] The name of the LLM integration. + # @param account_id [String] The ID of the integration account. + # @param body [LLMObsIntegrationInferenceRequest] Inference request parameters. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsIntegrationInferenceResponse, Integer, Hash)>] LLMObsIntegrationInferenceResponse data, response status code and response headers + def create_llm_obs_integration_inference_with_http_info(integration, account_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_llm_obs_integration_inference".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_llm_obs_integration_inference") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_llm_obs_integration_inference")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.create_llm_obs_integration_inference ...' + end + # verify the required parameter 'integration' is set + if @api_client.config.client_side_validation && integration.nil? + fail ArgumentError, "Missing the required parameter 'integration' when calling LLMObservabilityAPI.create_llm_obs_integration_inference" + end + # verify enum value + allowable_values = ['openai', 'amazon_bedrock', 'anthropic', 'azure_openai', 'vertex_ai', 'llmproxy'] + if @api_client.config.client_side_validation && !allowable_values.include?(integration) + fail ArgumentError, "invalid value for \"integration\", must be one of #{allowable_values}" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling LLMObservabilityAPI.create_llm_obs_integration_inference" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LLMObservabilityAPI.create_llm_obs_integration_inference" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/integrations/{integration}/{account_id}/inference'.sub('{integration}', CGI.escape(integration.to_s).gsub('%2F', '/')).sub('{account_id}', CGI.escape(account_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsIntegrationInferenceResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_llm_obs_integration_inference, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#create_llm_obs_integration_inference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create an LLM Observability project. # # @see #create_llm_obs_project_with_http_info @@ -1844,6 +1932,163 @@ def list_llm_obs_experiments_with_http_info(opts = {}) return data, status_code, headers end + # List LLM integration accounts. + # + # @see #list_llm_obs_integration_accounts_with_http_info + def list_llm_obs_integration_accounts(integration, opts = {}) + data, _status_code, _headers = list_llm_obs_integration_accounts_with_http_info(integration, opts) + data + end + + # List LLM integration accounts. + # + # Retrieve the list of configured accounts for the specified LLM provider integration. + # + # @param integration [LLMObsIntegrationName] The name of the LLM integration. + # @param opts [Hash] the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_llm_obs_integration_accounts_with_http_info(integration, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_llm_obs_integration_accounts".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_llm_obs_integration_accounts") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_llm_obs_integration_accounts")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.list_llm_obs_integration_accounts ...' + end + # verify the required parameter 'integration' is set + if @api_client.config.client_side_validation && integration.nil? + fail ArgumentError, "Missing the required parameter 'integration' when calling LLMObservabilityAPI.list_llm_obs_integration_accounts" + end + # verify enum value + allowable_values = ['openai', 'amazon_bedrock', 'anthropic', 'azure_openai', 'vertex_ai', 'llmproxy'] + if @api_client.config.client_side_validation && !allowable_values.include?(integration) + fail ArgumentError, "invalid value for \"integration\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/integrations/{integration}/accounts'.sub('{integration}', CGI.escape(integration.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_llm_obs_integration_accounts, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#list_llm_obs_integration_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List LLM integration models. + # + # @see #list_llm_obs_integration_models_with_http_info + def list_llm_obs_integration_models(integration, account_id, opts = {}) + data, _status_code, _headers = list_llm_obs_integration_models_with_http_info(integration, account_id, opts) + data + end + + # List LLM integration models. + # + # Retrieve the list of models available for the specified LLM provider integration and account. + # + # @param integration [LLMObsIntegrationName] The name of the LLM integration. + # @param account_id [String] The ID of the integration account. + # @param opts [Hash] the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_llm_obs_integration_models_with_http_info(integration, account_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_llm_obs_integration_models".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_llm_obs_integration_models") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_llm_obs_integration_models")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.list_llm_obs_integration_models ...' + end + # verify the required parameter 'integration' is set + if @api_client.config.client_side_validation && integration.nil? + fail ArgumentError, "Missing the required parameter 'integration' when calling LLMObservabilityAPI.list_llm_obs_integration_models" + end + # verify enum value + allowable_values = ['openai', 'amazon_bedrock', 'anthropic', 'azure_openai', 'vertex_ai', 'llmproxy'] + if @api_client.config.client_side_validation && !allowable_values.include?(integration) + fail ArgumentError, "invalid value for \"integration\", must be one of #{allowable_values}" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling LLMObservabilityAPI.list_llm_obs_integration_models" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/integrations/{integration}/{account_id}/models'.sub('{integration}', CGI.escape(integration.to_s).gsub('%2F', '/')).sub('{account_id}', CGI.escape(account_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_llm_obs_integration_models, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#list_llm_obs_integration_models\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List LLM Observability projects. # # @see #list_llm_obs_projects_with_http_info diff --git a/lib/datadog_api_client/v2/models/llm_obs_anthropic_effort.rb b/lib/datadog_api_client/v2/models/llm_obs_anthropic_effort.rb new file mode 100644 index 000000000000..81f0cf669668 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_anthropic_effort.rb @@ -0,0 +1,29 @@ +=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 + # The effort level for Anthropic inference. + class LLMObsAnthropicEffort + include BaseEnumModel + + LOW = "low".freeze + MEDIUM = "medium".freeze + HIGH = "high".freeze + MAX = "max".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_anthropic_metadata.rb b/lib/datadog_api_client/v2/models/llm_obs_anthropic_metadata.rb new file mode 100644 index 000000000000..a9fde770592b --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_anthropic_metadata.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Anthropic-specific metadata for an inference request. + class LLMObsAnthropicMetadata + include BaseGenericModel + + # The effort level for Anthropic inference. + attr_accessor :effort + + # Configuration for Anthropic extended thinking feature. + attr_accessor :thinking + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'effort' => :'effort', + :'thinking' => :'thinking' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'effort' => :'LLMObsAnthropicEffort', + :'thinking' => :'LLMObsAnthropicThinkingConfig' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'effort', + ]) + 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::LLMObsAnthropicMetadata` 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?(:'effort') + self.effort = attributes[:'effort'] + end + + if attributes.key?(:'thinking') + self.thinking = attributes[:'thinking'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + effort == o.effort && + thinking == o.thinking && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [effort, thinking, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_config.rb b/lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_config.rb new file mode 100644 index 000000000000..aefba0fb730c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_config.rb @@ -0,0 +1,141 @@ +=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 + # Configuration for Anthropic extended thinking feature. + class LLMObsAnthropicThinkingConfig + include BaseGenericModel + + # Maximum token budget for extended thinking. Required when type is `enabled`. + attr_accessor :budget_tokens + + # The thinking mode for Anthropic extended thinking. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'budget_tokens' => :'budget_tokens', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'budget_tokens' => :'Integer', + :'type' => :'LLMObsAnthropicThinkingType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'budget_tokens', + ]) + 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::LLMObsAnthropicThinkingConfig` 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?(:'budget_tokens') + self.budget_tokens = attributes[:'budget_tokens'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + budget_tokens == o.budget_tokens && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [budget_tokens, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_type.rb b/lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_type.rb new file mode 100644 index 000000000000..d75996f9108c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_type.rb @@ -0,0 +1,28 @@ +=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 + # The thinking mode for Anthropic extended thinking. + class LLMObsAnthropicThinkingType + include BaseEnumModel + + ENABLED = "enabled".freeze + DISABLED = "disabled".freeze + ADAPTIVE = "adaptive".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_azure_open_ai_metadata.rb b/lib/datadog_api_client/v2/models/llm_obs_azure_open_ai_metadata.rb new file mode 100644 index 000000000000..c71a0d8f7372 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_azure_open_ai_metadata.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Azure OpenAI-specific metadata for an integration account or inference request. + class LLMObsAzureOpenAIMetadata + include BaseGenericModel + + # The Azure OpenAI deployment ID. + attr_accessor :deployment_id + + # The model version deployed in Azure. + attr_accessor :model_version + + # The Azure OpenAI resource name. + attr_accessor :resource_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'deployment_id' => :'deployment_id', + :'model_version' => :'model_version', + :'resource_name' => :'resource_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'deployment_id' => :'String', + :'model_version' => :'String', + :'resource_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsAzureOpenAIMetadata` 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?(:'deployment_id') + self.deployment_id = attributes[:'deployment_id'] + end + + if attributes.key?(:'model_version') + self.model_version = attributes[:'model_version'] + end + + if attributes.key?(:'resource_name') + self.resource_name = attributes[:'resource_name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + deployment_id == o.deployment_id && + model_version == o.model_version && + resource_name == o.resource_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [deployment_id, model_version, resource_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_bedrock_metadata.rb b/lib/datadog_api_client/v2/models/llm_obs_bedrock_metadata.rb new file mode 100644 index 000000000000..1a3ba0cbdd7c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_bedrock_metadata.rb @@ -0,0 +1,105 @@ +=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 + # Amazon Bedrock-specific metadata for an inference request. + class LLMObsBedrockMetadata + include BaseGenericModel + + # The AWS region for the Bedrock request. + attr_accessor :region + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'region' => :'region' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'region' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsBedrockMetadata` 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?(:'region') + self.region = attributes[:'region'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + region == o.region && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [region, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_code.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_code.rb new file mode 100644 index 000000000000..75f99056c6c0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_code.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A generated code snippet for running an inference request programmatically. + class LLMObsInferenceCode + include BaseGenericModel + + # The generated code content. + attr_reader :code + + # Unique identifier for the code snippet. + attr_reader :id + + # The programming language or SDK type of the code snippet. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'code' => :'code', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'code' => :'String', + :'id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceCode` 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?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @code.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param code [Object] Object to be assigned + # @!visibility private + def code=(code) + if code.nil? + fail ArgumentError, 'invalid value for "code", code cannot be nil.' + end + @code = code + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [code, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_content.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_content.rb new file mode 100644 index 000000000000..ff1498050857 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_content.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A structured content block within a message. + class LLMObsInferenceContent + include BaseGenericModel + + # The content block type. + attr_reader :type + + # The typed value of a message content block. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'type' => :'String', + :'value' => :'LLMObsInferenceContentValue' + } + 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::LLMObsInferenceContent` 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?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + 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 @type.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + 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 && + type == o.type && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [type, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_content_value.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_content_value.rb new file mode 100644 index 000000000000..bad61d48ca4a --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_content_value.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The typed value of a message content block. + class LLMObsInferenceContentValue + include BaseGenericModel + + # Plain text content. + attr_accessor :text + + # A tool call made during LLM inference. + attr_accessor :tool_call + + # The result returned by a tool call during LLM inference. + attr_accessor :tool_call_result + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'text' => :'text', + :'tool_call' => :'tool_call', + :'tool_call_result' => :'tool_call_result' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'text' => :'String', + :'tool_call' => :'LLMObsInferenceToolCall', + :'tool_call_result' => :'LLMObsInferenceToolResult' + } + 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::LLMObsInferenceContentValue` 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?(:'text') + self.text = attributes[:'text'] + end + + if attributes.key?(:'tool_call') + self.tool_call = attributes[:'tool_call'] + end + + if attributes.key?(:'tool_call_result') + self.tool_call_result = attributes[:'tool_call_result'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + text == o.text && + tool_call == o.tool_call && + tool_call_result == o.tool_call_result && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [text, tool_call, tool_call_result, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_error_response.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_error_response.rb new file mode 100644 index 000000000000..f0d158843928 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_error_response.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Error details returned when an inference provider returns an error. + class LLMObsInferenceErrorResponse + include BaseGenericModel + + # A human-readable description of the error. + attr_reader :message + + # The provider-specific error type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'message' => :'message', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'message' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceErrorResponse` 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?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @message.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param message [Object] Object to be assigned + # @!visibility private + def message=(message) + if message.nil? + fail ArgumentError, 'invalid value for "message", message cannot be nil.' + end + @message = message + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [message, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_function.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_function.rb new file mode 100644 index 000000000000..7769f1eb88c0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_function.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 + # A function definition for a tool available to the model. + class LLMObsInferenceFunction + include BaseGenericModel + + # A description of what the function does. + attr_accessor :description + + # The name of the function. + attr_reader :name + + # JSON schema describing the function parameters. + attr_reader :parameters + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name', + :'parameters' => :'parameters' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String', + :'parameters' => :'Hash' + } + 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::LLMObsInferenceFunction` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + 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 @name.nil? + return false if @parameters.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param parameters [Object] Object to be assigned + # @!visibility private + def parameters=(parameters) + if parameters.nil? + fail ArgumentError, 'invalid value for "parameters", parameters cannot be nil.' + end + @parameters = parameters + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + parameters == o.parameters && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, parameters, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_message.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_message.rb new file mode 100644 index 000000000000..74b938e55fbf --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_message.rb @@ -0,0 +1,161 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single message in an LLM inference conversation. + class LLMObsInferenceMessage + include BaseGenericModel + + # Plain text content of the message. + attr_accessor :content + + # List of structured content blocks in a message. + attr_accessor :contents + + # Unique identifier for the message. + attr_accessor :id + + # The role of the message author. + attr_accessor :role + + # List of tool calls in a message. + attr_accessor :tool_calls + + # List of tool results in a message. + attr_accessor :tool_results + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'content' => :'content', + :'contents' => :'contents', + :'id' => :'id', + :'role' => :'role', + :'tool_calls' => :'tool_calls', + :'tool_results' => :'tool_results' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'content' => :'String', + :'contents' => :'Array', + :'id' => :'String', + :'role' => :'String', + :'tool_calls' => :'Array', + :'tool_results' => :'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::LLMObsInferenceMessage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'contents') + if (value = attributes[:'contents']).is_a?(Array) + self.contents = value + end + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'role') + self.role = attributes[:'role'] + end + + if attributes.key?(:'tool_calls') + if (value = attributes[:'tool_calls']).is_a?(Array) + self.tool_calls = value + end + end + + if attributes.key?(:'tool_results') + if (value = attributes[:'tool_results']).is_a?(Array) + self.tool_results = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + content == o.content && + contents == o.contents && + id == o.id && + role == o.role && + tool_calls == o.tool_calls && + tool_results == o.tool_results && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [content, contents, id, role, tool_calls, tool_results, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_run_result.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_run_result.rb new file mode 100644 index 000000000000..8261ca9fbc36 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_run_result.rb @@ -0,0 +1,302 @@ +=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 + # The output of a completed LLM inference call. + class LLMObsInferenceRunResult + include BaseGenericModel + + # An optional assessment of the inference output quality. + attr_accessor :assessment + + # The text content of the model response. + attr_reader :content + + # The reason the model stopped generating tokens. + attr_reader :finish_reason + + # List of generated code snippets for the inference configuration. + attr_reader :inference_codes + + # Number of input tokens consumed. + attr_reader :input_tokens + + # The model's internal reasoning or thinking output, if available. + attr_accessor :internal_reasoning + + # Request latency in milliseconds. + attr_reader :latency + + # Number of output tokens generated. + attr_reader :output_tokens + + # List of tools available to the model. + attr_reader :tools + + # Total tokens used (input plus output). + attr_reader :total_tokens + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assessment' => :'assessment', + :'content' => :'content', + :'finish_reason' => :'finish_reason', + :'inference_codes' => :'inference_codes', + :'input_tokens' => :'input_tokens', + :'internal_reasoning' => :'internal_reasoning', + :'latency' => :'latency', + :'output_tokens' => :'output_tokens', + :'tools' => :'tools', + :'total_tokens' => :'total_tokens' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assessment' => :'String', + :'content' => :'String', + :'finish_reason' => :'String', + :'inference_codes' => :'Array', + :'input_tokens' => :'Integer', + :'internal_reasoning' => :'LLMObsInternalReasoning', + :'latency' => :'Integer', + :'output_tokens' => :'Integer', + :'tools' => :'Array', + :'total_tokens' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'assessment', + ]) + 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::LLMObsInferenceRunResult` 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?(:'assessment') + self.assessment = attributes[:'assessment'] + end + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'finish_reason') + self.finish_reason = attributes[:'finish_reason'] + end + + if attributes.key?(:'inference_codes') + if (value = attributes[:'inference_codes']).is_a?(Array) + self.inference_codes = value + end + end + + if attributes.key?(:'input_tokens') + self.input_tokens = attributes[:'input_tokens'] + end + + if attributes.key?(:'internal_reasoning') + self.internal_reasoning = attributes[:'internal_reasoning'] + end + + if attributes.key?(:'latency') + self.latency = attributes[:'latency'] + end + + if attributes.key?(:'output_tokens') + self.output_tokens = attributes[:'output_tokens'] + end + + if attributes.key?(:'tools') + if (value = attributes[:'tools']).is_a?(Array) + self.tools = value + end + end + + if attributes.key?(:'total_tokens') + self.total_tokens = attributes[:'total_tokens'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @content.nil? + return false if @finish_reason.nil? + return false if @inference_codes.nil? + return false if @input_tokens.nil? + return false if @latency.nil? + return false if @output_tokens.nil? + return false if @tools.nil? + return false if @total_tokens.nil? + true + end + + # Custom attribute writer method with validation + # @param content [Object] Object to be assigned + # @!visibility private + def content=(content) + if content.nil? + fail ArgumentError, 'invalid value for "content", content cannot be nil.' + end + @content = content + end + + # Custom attribute writer method with validation + # @param finish_reason [Object] Object to be assigned + # @!visibility private + def finish_reason=(finish_reason) + if finish_reason.nil? + fail ArgumentError, 'invalid value for "finish_reason", finish_reason cannot be nil.' + end + @finish_reason = finish_reason + end + + # Custom attribute writer method with validation + # @param inference_codes [Object] Object to be assigned + # @!visibility private + def inference_codes=(inference_codes) + if inference_codes.nil? + fail ArgumentError, 'invalid value for "inference_codes", inference_codes cannot be nil.' + end + @inference_codes = inference_codes + end + + # Custom attribute writer method with validation + # @param input_tokens [Object] Object to be assigned + # @!visibility private + def input_tokens=(input_tokens) + if input_tokens.nil? + fail ArgumentError, 'invalid value for "input_tokens", input_tokens cannot be nil.' + end + @input_tokens = input_tokens + end + + # Custom attribute writer method with validation + # @param latency [Object] Object to be assigned + # @!visibility private + def latency=(latency) + if latency.nil? + fail ArgumentError, 'invalid value for "latency", latency cannot be nil.' + end + @latency = latency + end + + # Custom attribute writer method with validation + # @param output_tokens [Object] Object to be assigned + # @!visibility private + def output_tokens=(output_tokens) + if output_tokens.nil? + fail ArgumentError, 'invalid value for "output_tokens", output_tokens cannot be nil.' + end + @output_tokens = output_tokens + end + + # Custom attribute writer method with validation + # @param tools [Object] Object to be assigned + # @!visibility private + def tools=(tools) + if tools.nil? + fail ArgumentError, 'invalid value for "tools", tools cannot be nil.' + end + @tools = tools + end + + # Custom attribute writer method with validation + # @param total_tokens [Object] Object to be assigned + # @!visibility private + def total_tokens=(total_tokens) + if total_tokens.nil? + fail ArgumentError, 'invalid value for "total_tokens", total_tokens cannot be nil.' + end + @total_tokens = total_tokens + 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 && + assessment == o.assessment && + content == o.content && + finish_reason == o.finish_reason && + inference_codes == o.inference_codes && + input_tokens == o.input_tokens && + internal_reasoning == o.internal_reasoning && + latency == o.latency && + output_tokens == o.output_tokens && + tools == o.tools && + total_tokens == o.total_tokens && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assessment, content, finish_reason, inference_codes, input_tokens, internal_reasoning, latency, output_tokens, tools, total_tokens, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_tool.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_tool.rb new file mode 100644 index 000000000000..557247f44708 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_tool.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A tool definition available to the model during inference. + class LLMObsInferenceTool + include BaseGenericModel + + # A function definition for a tool available to the model. + attr_reader :function + + # The type of tool. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'function' => :'function', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'function' => :'LLMObsInferenceFunction', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceTool` 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?(:'function') + self.function = attributes[:'function'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @function.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param function [Object] Object to be assigned + # @!visibility private + def function=(function) + if function.nil? + fail ArgumentError, 'invalid value for "function", function cannot be nil.' + end + @function = function + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + function == o.function && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [function, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_tool_call.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_tool_call.rb new file mode 100644 index 000000000000..9d4c47933d57 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_tool_call.rb @@ -0,0 +1,135 @@ +=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 tool call made during LLM inference. + class LLMObsInferenceToolCall + include BaseGenericModel + + # The arguments passed to the tool. + attr_accessor :arguments + + # The name of the tool being called. + attr_accessor :name + + # Unique identifier for the tool call. + attr_accessor :tool_id + + # The type of tool call. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'arguments' => :'arguments', + :'name' => :'name', + :'tool_id' => :'tool_id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'arguments' => :'Hash', + :'name' => :'String', + :'tool_id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceToolCall` 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?(:'arguments') + self.arguments = attributes[:'arguments'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'tool_id') + self.tool_id = attributes[:'tool_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + arguments == o.arguments && + name == o.name && + tool_id == o.tool_id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [arguments, name, tool_id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_tool_result.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_tool_result.rb new file mode 100644 index 000000000000..2bbfeb6a4c21 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_tool_result.rb @@ -0,0 +1,135 @@ +=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 + # The result returned by a tool call during LLM inference. + class LLMObsInferenceToolResult + include BaseGenericModel + + # The name of the tool that produced this result. + attr_accessor :name + + # The result content returned by the tool. + attr_accessor :result + + # Identifier matching the corresponding tool call. + attr_accessor :tool_id + + # The type of tool result. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'result' => :'result', + :'tool_id' => :'tool_id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'result' => :'String', + :'tool_id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceToolResult` 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?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'result') + self.result = attributes[:'result'] + end + + if attributes.key?(:'tool_id') + self.tool_id = attributes[:'tool_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + result == o.result && + tool_id == o.tool_id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, result, tool_id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_integration_account.rb b/lib/datadog_api_client/v2/models/llm_obs_integration_account.rb new file mode 100644 index 000000000000..7748b6fec15f --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_integration_account.rb @@ -0,0 +1,216 @@ +=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 configured account for an LLM provider integration. + class LLMObsIntegrationAccount + include BaseGenericModel + + # Provider-specific account identifier. + attr_reader :account_id + + # Human-readable name for the integration account. + attr_reader :account_name + + # Provider region associated with the account, if applicable. + attr_accessor :account_region + + # Azure OpenAI-specific metadata for an integration account or inference request. + attr_accessor :azure_openai_metadata + + # Unique identifier for the integration account. + attr_reader :id + + # The name of the LLM provider integration. + attr_reader :integration + + # Vertex AI-specific metadata for an integration account or inference request. + attr_accessor :vertex_ai_metadata + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_id' => :'account_id', + :'account_name' => :'account_name', + :'account_region' => :'account_region', + :'azure_openai_metadata' => :'azure_openai_metadata', + :'id' => :'id', + :'integration' => :'integration', + :'vertex_ai_metadata' => :'vertex_ai_metadata' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_id' => :'String', + :'account_name' => :'String', + :'account_region' => :'String', + :'azure_openai_metadata' => :'LLMObsAzureOpenAIMetadata', + :'id' => :'String', + :'integration' => :'String', + :'vertex_ai_metadata' => :'LLMObsVertexAIMetadata' + } + 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::LLMObsIntegrationAccount` 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?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'account_name') + self.account_name = attributes[:'account_name'] + end + + if attributes.key?(:'account_region') + self.account_region = attributes[:'account_region'] + end + + if attributes.key?(:'azure_openai_metadata') + self.azure_openai_metadata = attributes[:'azure_openai_metadata'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'integration') + self.integration = attributes[:'integration'] + end + + if attributes.key?(:'vertex_ai_metadata') + self.vertex_ai_metadata = attributes[:'vertex_ai_metadata'] + 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 @account_id.nil? + return false if @account_name.nil? + return false if @id.nil? + return false if @integration.nil? + true + end + + # Custom attribute writer method with validation + # @param account_id [Object] Object to be assigned + # @!visibility private + def account_id=(account_id) + if account_id.nil? + fail ArgumentError, 'invalid value for "account_id", account_id cannot be nil.' + end + @account_id = account_id + end + + # Custom attribute writer method with validation + # @param account_name [Object] Object to be assigned + # @!visibility private + def account_name=(account_name) + if account_name.nil? + fail ArgumentError, 'invalid value for "account_name", account_name cannot be nil.' + end + @account_name = account_name + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param integration [Object] Object to be assigned + # @!visibility private + def integration=(integration) + if integration.nil? + fail ArgumentError, 'invalid value for "integration", integration cannot be nil.' + end + @integration = integration + 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 && + account_id == o.account_id && + account_name == o.account_name && + account_region == o.account_region && + azure_openai_metadata == o.azure_openai_metadata && + id == o.id && + integration == o.integration && + vertex_ai_metadata == o.vertex_ai_metadata && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_id, account_name, account_region, azure_openai_metadata, id, integration, vertex_ai_metadata, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_integration_inference_request.rb b/lib/datadog_api_client/v2/models/llm_obs_integration_inference_request.rb new file mode 100644 index 000000000000..10fa0a6914ef --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_integration_inference_request.rb @@ -0,0 +1,303 @@ +=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 + # Parameters for an LLM inference request. + class LLMObsIntegrationInferenceRequest + include BaseGenericModel + + # Anthropic-specific metadata for an inference request. + attr_accessor :anthropic_metadata + + # Azure OpenAI-specific metadata for an integration account or inference request. + attr_accessor :azure_openai_metadata + + # Amazon Bedrock-specific metadata for an inference request. + attr_accessor :bedrock_metadata + + # Penalty for token frequency to reduce repetition. + attr_accessor :frequency_penalty + + # JSON schema for structured output, if supported by the model. + attr_accessor :json_schema + + # Maximum number of completion tokens to generate (alternative to max_tokens for some providers). + attr_accessor :max_completion_tokens + + # Maximum number of tokens to generate. + attr_accessor :max_tokens + + # List of messages in an inference conversation. + attr_reader :messages + + # The model identifier to use for inference. + attr_reader :model_id + + # OpenAI-specific metadata for an inference request. + attr_accessor :openai_metadata + + # Penalty for token presence to encourage topic diversity. + attr_accessor :presence_penalty + + # Sampling temperature between 0 and 2. Higher values produce more random output. + attr_accessor :temperature + + # List of tools available to the model. + attr_accessor :tools + + # Top-K sampling parameter. + attr_accessor :top_k + + # Nucleus sampling probability mass. + attr_accessor :top_p + + # Vertex AI-specific metadata for an integration account or inference request. + attr_accessor :vertex_ai_metadata + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'anthropic_metadata' => :'anthropic_metadata', + :'azure_openai_metadata' => :'azure_openai_metadata', + :'bedrock_metadata' => :'bedrock_metadata', + :'frequency_penalty' => :'frequency_penalty', + :'json_schema' => :'json_schema', + :'max_completion_tokens' => :'max_completion_tokens', + :'max_tokens' => :'max_tokens', + :'messages' => :'messages', + :'model_id' => :'model_id', + :'openai_metadata' => :'openai_metadata', + :'presence_penalty' => :'presence_penalty', + :'temperature' => :'temperature', + :'tools' => :'tools', + :'top_k' => :'top_k', + :'top_p' => :'top_p', + :'vertex_ai_metadata' => :'vertex_ai_metadata' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'anthropic_metadata' => :'LLMObsAnthropicMetadata', + :'azure_openai_metadata' => :'LLMObsAzureOpenAIMetadata', + :'bedrock_metadata' => :'LLMObsBedrockMetadata', + :'frequency_penalty' => :'Float', + :'json_schema' => :'String', + :'max_completion_tokens' => :'Integer', + :'max_tokens' => :'Integer', + :'messages' => :'Array', + :'model_id' => :'String', + :'openai_metadata' => :'LLMObsOpenAIMetadata', + :'presence_penalty' => :'Float', + :'temperature' => :'Float', + :'tools' => :'Array', + :'top_k' => :'Integer', + :'top_p' => :'Float', + :'vertex_ai_metadata' => :'LLMObsVertexAIMetadata' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'frequency_penalty', + :'json_schema', + :'max_completion_tokens', + :'max_tokens', + :'presence_penalty', + :'temperature', + :'top_k', + :'top_p', + ]) + 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::LLMObsIntegrationInferenceRequest` 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?(:'anthropic_metadata') + self.anthropic_metadata = attributes[:'anthropic_metadata'] + end + + if attributes.key?(:'azure_openai_metadata') + self.azure_openai_metadata = attributes[:'azure_openai_metadata'] + end + + if attributes.key?(:'bedrock_metadata') + self.bedrock_metadata = attributes[:'bedrock_metadata'] + end + + if attributes.key?(:'frequency_penalty') + self.frequency_penalty = attributes[:'frequency_penalty'] + end + + if attributes.key?(:'json_schema') + self.json_schema = attributes[:'json_schema'] + end + + if attributes.key?(:'max_completion_tokens') + self.max_completion_tokens = attributes[:'max_completion_tokens'] + end + + if attributes.key?(:'max_tokens') + self.max_tokens = attributes[:'max_tokens'] + end + + if attributes.key?(:'messages') + if (value = attributes[:'messages']).is_a?(Array) + self.messages = value + end + end + + if attributes.key?(:'model_id') + self.model_id = attributes[:'model_id'] + end + + if attributes.key?(:'openai_metadata') + self.openai_metadata = attributes[:'openai_metadata'] + end + + if attributes.key?(:'presence_penalty') + self.presence_penalty = attributes[:'presence_penalty'] + end + + if attributes.key?(:'temperature') + self.temperature = attributes[:'temperature'] + end + + if attributes.key?(:'tools') + if (value = attributes[:'tools']).is_a?(Array) + self.tools = value + end + end + + if attributes.key?(:'top_k') + self.top_k = attributes[:'top_k'] + end + + if attributes.key?(:'top_p') + self.top_p = attributes[:'top_p'] + end + + if attributes.key?(:'vertex_ai_metadata') + self.vertex_ai_metadata = attributes[:'vertex_ai_metadata'] + 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 @model_id.nil? + 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 + @messages = messages + end + + # Custom attribute writer method with validation + # @param model_id [Object] Object to be assigned + # @!visibility private + def model_id=(model_id) + if model_id.nil? + fail ArgumentError, 'invalid value for "model_id", model_id cannot be nil.' + end + @model_id = model_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + anthropic_metadata == o.anthropic_metadata && + azure_openai_metadata == o.azure_openai_metadata && + bedrock_metadata == o.bedrock_metadata && + frequency_penalty == o.frequency_penalty && + json_schema == o.json_schema && + max_completion_tokens == o.max_completion_tokens && + max_tokens == o.max_tokens && + messages == o.messages && + model_id == o.model_id && + openai_metadata == o.openai_metadata && + presence_penalty == o.presence_penalty && + temperature == o.temperature && + tools == o.tools && + top_k == o.top_k && + top_p == o.top_p && + vertex_ai_metadata == o.vertex_ai_metadata && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [anthropic_metadata, azure_openai_metadata, bedrock_metadata, frequency_penalty, json_schema, max_completion_tokens, max_tokens, messages, model_id, openai_metadata, presence_penalty, temperature, tools, top_k, top_p, vertex_ai_metadata, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_integration_inference_response.rb b/lib/datadog_api_client/v2/models/llm_obs_integration_inference_response.rb new file mode 100644 index 000000000000..090e74675482 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_integration_inference_response.rb @@ -0,0 +1,334 @@ +=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 + # The result of an LLM inference request, including input parameters and the model response. + class LLMObsIntegrationInferenceResponse + include BaseGenericModel + + # Anthropic-specific metadata for an inference request. + attr_accessor :anthropic_metadata + + # Azure OpenAI-specific metadata for an integration account or inference request. + attr_accessor :azure_openai_metadata + + # Amazon Bedrock-specific metadata for an inference request. + attr_accessor :bedrock_metadata + + # Error details returned when an inference provider returns an error. + attr_accessor :error_response + + # Frequency penalty that was applied. + attr_accessor :frequency_penalty + + # JSON schema that was applied for structured output. + attr_accessor :json_schema + + # Maximum number of completion tokens that were configured. + attr_accessor :max_completion_tokens + + # Maximum number of tokens that were configured. + attr_accessor :max_tokens + + # List of messages in an inference conversation. + attr_reader :messages + + # The model identifier used for inference. + attr_reader :model_id + + # OpenAI-specific metadata for an inference request. + attr_accessor :openai_metadata + + # Presence penalty that was applied. + attr_accessor :presence_penalty + + # The output of a completed LLM inference call. + attr_reader :response + + # Sampling temperature that was used. + attr_accessor :temperature + + # List of tools available to the model. + attr_accessor :tools + + # Top-K sampling parameter that was used. + attr_accessor :top_k + + # Nucleus sampling parameter that was used. + attr_accessor :top_p + + # Vertex AI-specific metadata for an integration account or inference request. + attr_accessor :vertex_ai_metadata + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'anthropic_metadata' => :'anthropic_metadata', + :'azure_openai_metadata' => :'azure_openai_metadata', + :'bedrock_metadata' => :'bedrock_metadata', + :'error_response' => :'error_response', + :'frequency_penalty' => :'frequency_penalty', + :'json_schema' => :'json_schema', + :'max_completion_tokens' => :'max_completion_tokens', + :'max_tokens' => :'max_tokens', + :'messages' => :'messages', + :'model_id' => :'model_id', + :'openai_metadata' => :'openai_metadata', + :'presence_penalty' => :'presence_penalty', + :'response' => :'response', + :'temperature' => :'temperature', + :'tools' => :'tools', + :'top_k' => :'top_k', + :'top_p' => :'top_p', + :'vertex_ai_metadata' => :'vertex_ai_metadata' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'anthropic_metadata' => :'LLMObsAnthropicMetadata', + :'azure_openai_metadata' => :'LLMObsAzureOpenAIMetadata', + :'bedrock_metadata' => :'LLMObsBedrockMetadata', + :'error_response' => :'LLMObsInferenceErrorResponse', + :'frequency_penalty' => :'Float', + :'json_schema' => :'String', + :'max_completion_tokens' => :'Integer', + :'max_tokens' => :'Integer', + :'messages' => :'Array', + :'model_id' => :'String', + :'openai_metadata' => :'LLMObsOpenAIMetadata', + :'presence_penalty' => :'Float', + :'response' => :'LLMObsInferenceRunResult', + :'temperature' => :'Float', + :'tools' => :'Array', + :'top_k' => :'Integer', + :'top_p' => :'Float', + :'vertex_ai_metadata' => :'LLMObsVertexAIMetadata' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'frequency_penalty', + :'json_schema', + :'max_completion_tokens', + :'max_tokens', + :'presence_penalty', + :'temperature', + :'top_k', + :'top_p', + ]) + 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::LLMObsIntegrationInferenceResponse` 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?(:'anthropic_metadata') + self.anthropic_metadata = attributes[:'anthropic_metadata'] + end + + if attributes.key?(:'azure_openai_metadata') + self.azure_openai_metadata = attributes[:'azure_openai_metadata'] + end + + if attributes.key?(:'bedrock_metadata') + self.bedrock_metadata = attributes[:'bedrock_metadata'] + end + + if attributes.key?(:'error_response') + self.error_response = attributes[:'error_response'] + end + + if attributes.key?(:'frequency_penalty') + self.frequency_penalty = attributes[:'frequency_penalty'] + end + + if attributes.key?(:'json_schema') + self.json_schema = attributes[:'json_schema'] + end + + if attributes.key?(:'max_completion_tokens') + self.max_completion_tokens = attributes[:'max_completion_tokens'] + end + + if attributes.key?(:'max_tokens') + self.max_tokens = attributes[:'max_tokens'] + end + + if attributes.key?(:'messages') + if (value = attributes[:'messages']).is_a?(Array) + self.messages = value + end + end + + if attributes.key?(:'model_id') + self.model_id = attributes[:'model_id'] + end + + if attributes.key?(:'openai_metadata') + self.openai_metadata = attributes[:'openai_metadata'] + end + + if attributes.key?(:'presence_penalty') + self.presence_penalty = attributes[:'presence_penalty'] + end + + if attributes.key?(:'response') + self.response = attributes[:'response'] + end + + if attributes.key?(:'temperature') + self.temperature = attributes[:'temperature'] + end + + if attributes.key?(:'tools') + if (value = attributes[:'tools']).is_a?(Array) + self.tools = value + end + end + + if attributes.key?(:'top_k') + self.top_k = attributes[:'top_k'] + end + + if attributes.key?(:'top_p') + self.top_p = attributes[:'top_p'] + end + + if attributes.key?(:'vertex_ai_metadata') + self.vertex_ai_metadata = attributes[:'vertex_ai_metadata'] + 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 @model_id.nil? + return false if @response.nil? + 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 + @messages = messages + end + + # Custom attribute writer method with validation + # @param model_id [Object] Object to be assigned + # @!visibility private + def model_id=(model_id) + if model_id.nil? + fail ArgumentError, 'invalid value for "model_id", model_id cannot be nil.' + end + @model_id = model_id + end + + # Custom attribute writer method with validation + # @param response [Object] Object to be assigned + # @!visibility private + def response=(response) + if response.nil? + fail ArgumentError, 'invalid value for "response", response cannot be nil.' + end + @response = response + 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 && + anthropic_metadata == o.anthropic_metadata && + azure_openai_metadata == o.azure_openai_metadata && + bedrock_metadata == o.bedrock_metadata && + error_response == o.error_response && + frequency_penalty == o.frequency_penalty && + json_schema == o.json_schema && + max_completion_tokens == o.max_completion_tokens && + max_tokens == o.max_tokens && + messages == o.messages && + model_id == o.model_id && + openai_metadata == o.openai_metadata && + presence_penalty == o.presence_penalty && + response == o.response && + temperature == o.temperature && + tools == o.tools && + top_k == o.top_k && + top_p == o.top_p && + vertex_ai_metadata == o.vertex_ai_metadata && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [anthropic_metadata, azure_openai_metadata, bedrock_metadata, error_response, frequency_penalty, json_schema, max_completion_tokens, max_tokens, messages, model_id, openai_metadata, presence_penalty, response, temperature, tools, top_k, top_p, vertex_ai_metadata, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_integration_model.rb b/lib/datadog_api_client/v2/models/llm_obs_integration_model.rb new file mode 100644 index 000000000000..fbf442446a09 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_integration_model.rb @@ -0,0 +1,301 @@ +=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 model available for a given LLM provider integration and account. + class LLMObsIntegrationModel + include BaseGenericModel + + # Whether the account has access to this model. + attr_reader :has_access + + # Unique identifier for the model entry. + attr_reader :id + + # The name of the LLM provider integration. + attr_reader :integration + + # Human-readable name of the LLM provider integration. + attr_reader :integration_display_name + + # Whether the model supports structured output via JSON schema. + attr_reader :json_schema + + # Human-readable model name. + attr_reader :model_display_name + + # Provider-specific model identifier used in inference calls. + attr_reader :model_id + + # The underlying model provider. + attr_reader :provider + + # Human-readable name of the underlying model provider. + attr_reader :provider_display_name + + # Map of region-specific model ID prefix overrides. + attr_accessor :region_prefix_overrides + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'has_access' => :'has_access', + :'id' => :'id', + :'integration' => :'integration', + :'integration_display_name' => :'integration_display_name', + :'json_schema' => :'json_schema', + :'model_display_name' => :'model_display_name', + :'model_id' => :'model_id', + :'provider' => :'provider', + :'provider_display_name' => :'provider_display_name', + :'region_prefix_overrides' => :'region_prefix_overrides' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'has_access' => :'Boolean', + :'id' => :'String', + :'integration' => :'String', + :'integration_display_name' => :'String', + :'json_schema' => :'Boolean', + :'model_display_name' => :'String', + :'model_id' => :'String', + :'provider' => :'String', + :'provider_display_name' => :'String', + :'region_prefix_overrides' => :'Hash' + } + 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::LLMObsIntegrationModel` 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?(:'has_access') + self.has_access = attributes[:'has_access'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'integration') + self.integration = attributes[:'integration'] + end + + if attributes.key?(:'integration_display_name') + self.integration_display_name = attributes[:'integration_display_name'] + end + + if attributes.key?(:'json_schema') + self.json_schema = attributes[:'json_schema'] + end + + if attributes.key?(:'model_display_name') + self.model_display_name = attributes[:'model_display_name'] + end + + if attributes.key?(:'model_id') + self.model_id = attributes[:'model_id'] + end + + if attributes.key?(:'provider') + self.provider = attributes[:'provider'] + end + + if attributes.key?(:'provider_display_name') + self.provider_display_name = attributes[:'provider_display_name'] + end + + if attributes.key?(:'region_prefix_overrides') + self.region_prefix_overrides = attributes[:'region_prefix_overrides'] + 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 @has_access.nil? + return false if @id.nil? + return false if @integration.nil? + return false if @integration_display_name.nil? + return false if @json_schema.nil? + return false if @model_display_name.nil? + return false if @model_id.nil? + return false if @provider.nil? + return false if @provider_display_name.nil? + true + end + + # Custom attribute writer method with validation + # @param has_access [Object] Object to be assigned + # @!visibility private + def has_access=(has_access) + if has_access.nil? + fail ArgumentError, 'invalid value for "has_access", has_access cannot be nil.' + end + @has_access = has_access + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param integration [Object] Object to be assigned + # @!visibility private + def integration=(integration) + if integration.nil? + fail ArgumentError, 'invalid value for "integration", integration cannot be nil.' + end + @integration = integration + end + + # Custom attribute writer method with validation + # @param integration_display_name [Object] Object to be assigned + # @!visibility private + def integration_display_name=(integration_display_name) + if integration_display_name.nil? + fail ArgumentError, 'invalid value for "integration_display_name", integration_display_name cannot be nil.' + end + @integration_display_name = integration_display_name + end + + # Custom attribute writer method with validation + # @param json_schema [Object] Object to be assigned + # @!visibility private + def json_schema=(json_schema) + if json_schema.nil? + fail ArgumentError, 'invalid value for "json_schema", json_schema cannot be nil.' + end + @json_schema = json_schema + end + + # Custom attribute writer method with validation + # @param model_display_name [Object] Object to be assigned + # @!visibility private + def model_display_name=(model_display_name) + if model_display_name.nil? + fail ArgumentError, 'invalid value for "model_display_name", model_display_name cannot be nil.' + end + @model_display_name = model_display_name + end + + # Custom attribute writer method with validation + # @param model_id [Object] Object to be assigned + # @!visibility private + def model_id=(model_id) + if model_id.nil? + fail ArgumentError, 'invalid value for "model_id", model_id cannot be nil.' + end + @model_id = model_id + end + + # Custom attribute writer method with validation + # @param provider [Object] Object to be assigned + # @!visibility private + def provider=(provider) + if provider.nil? + fail ArgumentError, 'invalid value for "provider", provider cannot be nil.' + end + @provider = provider + end + + # Custom attribute writer method with validation + # @param provider_display_name [Object] Object to be assigned + # @!visibility private + def provider_display_name=(provider_display_name) + if provider_display_name.nil? + fail ArgumentError, 'invalid value for "provider_display_name", provider_display_name cannot be nil.' + end + @provider_display_name = provider_display_name + 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 && + has_access == o.has_access && + id == o.id && + integration == o.integration && + integration_display_name == o.integration_display_name && + json_schema == o.json_schema && + model_display_name == o.model_display_name && + model_id == o.model_id && + provider == o.provider && + provider_display_name == o.provider_display_name && + region_prefix_overrides == o.region_prefix_overrides && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [has_access, id, integration, integration_display_name, json_schema, model_display_name, model_id, provider, provider_display_name, region_prefix_overrides, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_integration_name.rb b/lib/datadog_api_client/v2/models/llm_obs_integration_name.rb new file mode 100644 index 000000000000..e46d7bac772e --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_integration_name.rb @@ -0,0 +1,31 @@ +=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 + # The name of a supported LLM provider integration. + class LLMObsIntegrationName + include BaseEnumModel + + OPENAI = "openai".freeze + AMAZON_BEDROCK = "amazon_bedrock".freeze + ANTHROPIC = "anthropic".freeze + AZURE_OPENAI = "azure_openai".freeze + VERTEX_AI = "vertex_ai".freeze + LLMPROXY = "llmproxy".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_internal_reasoning.rb b/lib/datadog_api_client/v2/models/llm_obs_internal_reasoning.rb new file mode 100644 index 000000000000..98592c4b0d54 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_internal_reasoning.rb @@ -0,0 +1,141 @@ +=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 + # The model's internal reasoning or thinking output, if available. + class LLMObsInternalReasoning + include BaseGenericModel + + # Number of tokens used for internal reasoning. + attr_accessor :reasoning_tokens + + # The reasoning text produced by the model. + attr_reader :text + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'reasoning_tokens' => :'reasoning_tokens', + :'text' => :'text' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'reasoning_tokens' => :'Integer', + :'text' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'reasoning_tokens', + ]) + 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::LLMObsInternalReasoning` 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?(:'reasoning_tokens') + self.reasoning_tokens = attributes[:'reasoning_tokens'] + end + + if attributes.key?(:'text') + self.text = attributes[:'text'] + 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 @text.nil? + true + end + + # Custom attribute writer method with validation + # @param text [Object] Object to be assigned + # @!visibility private + def text=(text) + if text.nil? + fail ArgumentError, 'invalid value for "text", text cannot be nil.' + end + @text = text + 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 && + reasoning_tokens == o.reasoning_tokens && + text == o.text && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [reasoning_tokens, text, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_open_ai_metadata.rb b/lib/datadog_api_client/v2/models/llm_obs_open_ai_metadata.rb new file mode 100644 index 000000000000..de5fe1e981d5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_open_ai_metadata.rb @@ -0,0 +1,124 @@ +=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 + # OpenAI-specific metadata for an inference request. + class LLMObsOpenAIMetadata + include BaseGenericModel + + # The reasoning effort level for OpenAI models that support it. + attr_accessor :reasoning_effort + + # The verbosity of the reasoning summary. + attr_accessor :reasoning_summary + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'reasoning_effort' => :'reasoning_effort', + :'reasoning_summary' => :'reasoning_summary' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'reasoning_effort' => :'LLMObsOpenAIReasoningEffort', + :'reasoning_summary' => :'LLMObsOpenAIReasoningSummary' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'reasoning_effort', + :'reasoning_summary', + ]) + 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::LLMObsOpenAIMetadata` 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?(:'reasoning_effort') + self.reasoning_effort = attributes[:'reasoning_effort'] + end + + if attributes.key?(:'reasoning_summary') + self.reasoning_summary = attributes[:'reasoning_summary'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + reasoning_effort == o.reasoning_effort && + reasoning_summary == o.reasoning_summary && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [reasoning_effort, reasoning_summary, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_effort.rb b/lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_effort.rb new file mode 100644 index 000000000000..4a63433c213f --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_effort.rb @@ -0,0 +1,30 @@ +=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 + # The reasoning effort level for OpenAI models that support it. + class LLMObsOpenAIReasoningEffort + include BaseEnumModel + + NONE = "none".freeze + LOW = "low".freeze + MEDIUM = "medium".freeze + HIGH = "high".freeze + XHIGH = "xhigh".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_summary.rb b/lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_summary.rb new file mode 100644 index 000000000000..8ed6a8a84e3f --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_summary.rb @@ -0,0 +1,28 @@ +=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 + # The verbosity of the reasoning summary. + class LLMObsOpenAIReasoningSummary + include BaseEnumModel + + AUTO = "auto".freeze + CONCISE = "concise".freeze + DETAILED = "detailed".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_vertex_ai_metadata.rb b/lib/datadog_api_client/v2/models/llm_obs_vertex_ai_metadata.rb new file mode 100644 index 000000000000..790418cee1f7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_vertex_ai_metadata.rb @@ -0,0 +1,127 @@ +=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 + # Vertex AI-specific metadata for an integration account or inference request. + class LLMObsVertexAIMetadata + include BaseGenericModel + + # The Vertex AI region. + attr_accessor :location + + # The Google Cloud project ID. + attr_accessor :project + + # List of Google Cloud project IDs available to the service account. + attr_accessor :project_ids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'location' => :'location', + :'project' => :'project', + :'project_ids' => :'project_ids' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'location' => :'String', + :'project' => :'String', + :'project_ids' => :'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::LLMObsVertexAIMetadata` 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?(:'location') + self.location = attributes[:'location'] + end + + if attributes.key?(:'project') + self.project = attributes[:'project'] + end + + if attributes.key?(:'project_ids') + if (value = attributes[:'project_ids']).is_a?(Array) + self.project_ids = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + location == o.location && + project == o.project && + project_ids == o.project_ids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [location, project, project_ids, additional_properties].hash + end + end +end