diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 25ad70c2815..01e78f5f35d 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.java b/examples/v2/llm-observability/CreateLLMObsIntegrationInference.java new file mode 100644 index 00000000000..5ded2ac5952 --- /dev/null +++ b/examples/v2/llm-observability/CreateLLMObsIntegrationInference.java @@ -0,0 +1,139 @@ +// Run an LLM inference returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LlmObservabilityApi; +import com.datadog.api.client.v2.model.LLMObsAnthropicEffort; +import com.datadog.api.client.v2.model.LLMObsAnthropicMetadata; +import com.datadog.api.client.v2.model.LLMObsAnthropicThinkingConfig; +import com.datadog.api.client.v2.model.LLMObsAnthropicThinkingType; +import com.datadog.api.client.v2.model.LLMObsAzureOpenAIMetadata; +import com.datadog.api.client.v2.model.LLMObsBedrockMetadata; +import com.datadog.api.client.v2.model.LLMObsInferenceContent; +import com.datadog.api.client.v2.model.LLMObsInferenceContentValue; +import com.datadog.api.client.v2.model.LLMObsInferenceFunction; +import com.datadog.api.client.v2.model.LLMObsInferenceMessage; +import com.datadog.api.client.v2.model.LLMObsInferenceTool; +import com.datadog.api.client.v2.model.LLMObsInferenceToolCall; +import com.datadog.api.client.v2.model.LLMObsInferenceToolResult; +import com.datadog.api.client.v2.model.LLMObsIntegrationInferenceRequest; +import com.datadog.api.client.v2.model.LLMObsIntegrationInferenceResponse; +import com.datadog.api.client.v2.model.LLMObsIntegrationName; +import com.datadog.api.client.v2.model.LLMObsOpenAIMetadata; +import com.datadog.api.client.v2.model.LLMObsOpenAIReasoningEffort; +import com.datadog.api.client.v2.model.LLMObsOpenAIReasoningSummary; +import com.datadog.api.client.v2.model.LLMObsVertexAIMetadata; +import java.util.Collections; +import java.util.Map; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createLLMObsIntegrationInference", true); + LlmObservabilityApi apiInstance = new LlmObservabilityApi(defaultClient); + + LLMObsIntegrationInferenceRequest body = + new LLMObsIntegrationInferenceRequest() + .anthropicMetadata( + new LLMObsAnthropicMetadata() + .effort(LLMObsAnthropicEffort.MEDIUM) + .thinking( + new LLMObsAnthropicThinkingConfig() + .budgetTokens(1024L) + .type(LLMObsAnthropicThinkingType.ENABLED))) + .azureOpenaiMetadata( + new LLMObsAzureOpenAIMetadata() + .deploymentId("my-gpt4-deployment") + .modelVersion("0613") + .resourceName("my-azure-resource")) + .bedrockMetadata(new LLMObsBedrockMetadata().region("us-east-1")) + .jsonSchema(""" +{"type":"object","properties":{"answer":{"type":"string"}}} +""") + .maxCompletionTokens(1024L) + .maxTokens(1024L) + .messages( + Collections.singletonList( + new LLMObsInferenceMessage() + .content("What is the capital of France?") + .contents( + Collections.singletonList( + new LLMObsInferenceContent() + .type("text") + .value( + new LLMObsInferenceContentValue() + .text("Hello, how can I help you?") + .toolCall( + new LLMObsInferenceToolCall() + .arguments( + Map.ofEntries( + Map.entry("location", "San Francisco"))) + .name("get_weather") + .toolId("call_abc123") + .type("function")) + .toolCallResult( + new LLMObsInferenceToolResult() + .name("get_weather") + .result( + "The weather in San Francisco is 68°F and" + + " sunny.") + .toolId("call_abc123") + .type("function"))))) + .id("msg_001") + .role("user") + .toolCalls( + Collections.singletonList( + new LLMObsInferenceToolCall() + .arguments( + Map.ofEntries(Map.entry("location", "San Francisco"))) + .name("get_weather") + .toolId("call_abc123") + .type("function"))) + .toolResults( + Collections.singletonList( + new LLMObsInferenceToolResult() + .name("get_weather") + .result("The weather in San Francisco is 68°F and sunny.") + .toolId("call_abc123") + .type("function"))))) + .modelId("gpt-4o") + .openaiMetadata( + new LLMObsOpenAIMetadata() + .reasoningEffort(LLMObsOpenAIReasoningEffort.MEDIUM) + .reasoningSummary(LLMObsOpenAIReasoningSummary.AUTO)) + .temperature(0.7) + .tools( + Collections.singletonList( + new LLMObsInferenceTool() + .function( + new LLMObsInferenceFunction() + .description("Get the current weather for a location.") + .name("get_weather") + .parameters( + Map.ofEntries( + Map.entry("properties", "{'location': {'type': 'string'}}"), + Map.entry("type", "object")))) + .type("function"))) + .topK(50L) + .topP(1.0) + .vertexAiMetadata( + new LLMObsVertexAIMetadata() + .location("us-central1") + .project("my-gcp-project") + .projectIds(Collections.singletonList("my-gcp-project"))); + + try { + LLMObsIntegrationInferenceResponse result = + apiInstance.createLLMObsIntegrationInference( + LLMObsIntegrationName.OPENAI, "account-abc123", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling LlmObservabilityApi#createLLMObsIntegrationInference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/llm-observability/ListLLMObsIntegrationAccounts.java b/examples/v2/llm-observability/ListLLMObsIntegrationAccounts.java new file mode 100644 index 00000000000..cb7fd43fc17 --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsIntegrationAccounts.java @@ -0,0 +1,29 @@ +// List LLM integration accounts returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LlmObservabilityApi; +import com.datadog.api.client.v2.model.LLMObsIntegrationAccount; +import com.datadog.api.client.v2.model.LLMObsIntegrationName; +import java.util.List; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listLLMObsIntegrationAccounts", true); + LlmObservabilityApi apiInstance = new LlmObservabilityApi(defaultClient); + + try { + List result = + apiInstance.listLLMObsIntegrationAccounts(LLMObsIntegrationName.OPENAI); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling LlmObservabilityApi#listLLMObsIntegrationAccounts"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/llm-observability/ListLLMObsIntegrationModels.java b/examples/v2/llm-observability/ListLLMObsIntegrationModels.java new file mode 100644 index 00000000000..0aceaacfdfb --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsIntegrationModels.java @@ -0,0 +1,28 @@ +// List LLM integration models returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LlmObservabilityApi; +import com.datadog.api.client.v2.model.LLMObsIntegrationModel; +import com.datadog.api.client.v2.model.LLMObsIntegrationName; +import java.util.List; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listLLMObsIntegrationModels", true); + LlmObservabilityApi apiInstance = new LlmObservabilityApi(defaultClient); + + try { + List result = + apiInstance.listLLMObsIntegrationModels(LLMObsIntegrationName.OPENAI, "account-abc123"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling LlmObservabilityApi#listLLMObsIntegrationModels"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 77739cd87d9..81fced2d4d7 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -780,6 +780,7 @@ public class ApiClient { put("v2.createLLMObsDatasetRecords", false); put("v2.createLLMObsExperiment", false); put("v2.createLLMObsExperimentEvents", false); + put("v2.createLLMObsIntegrationInference", false); put("v2.createLLMObsProject", false); put("v2.deleteLLMObsAnnotationQueue", false); put("v2.deleteLLMObsAnnotationQueueInteractions", false); @@ -797,6 +798,8 @@ public class ApiClient { put("v2.listLLMObsDatasets", false); put("v2.listLLMObsExperimentEvents", false); put("v2.listLLMObsExperiments", false); + put("v2.listLLMObsIntegrationAccounts", false); + put("v2.listLLMObsIntegrationModels", false); put("v2.listLLMObsProjects", false); put("v2.listLLMObsSpans", false); put("v2.searchLLMObsExperimentation", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/LlmObservabilityApi.java b/src/main/java/com/datadog/api/client/v2/api/LlmObservabilityApi.java index 0bbac206bcd..3640e8cf2bb 100644 --- a/src/main/java/com/datadog/api/client/v2/api/LlmObservabilityApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/LlmObservabilityApi.java @@ -42,6 +42,11 @@ import com.datadog.api.client.v2.model.LLMObsExperimentationSimpleSearchRequest; import com.datadog.api.client.v2.model.LLMObsExperimentationSimpleSearchResponse; import com.datadog.api.client.v2.model.LLMObsExperimentsResponse; +import com.datadog.api.client.v2.model.LLMObsIntegrationAccount; +import com.datadog.api.client.v2.model.LLMObsIntegrationInferenceRequest; +import com.datadog.api.client.v2.model.LLMObsIntegrationInferenceResponse; +import com.datadog.api.client.v2.model.LLMObsIntegrationModel; +import com.datadog.api.client.v2.model.LLMObsIntegrationName; import com.datadog.api.client.v2.model.LLMObsProjectRequest; import com.datadog.api.client.v2.model.LLMObsProjectResponse; import com.datadog.api.client.v2.model.LLMObsProjectUpdateRequest; @@ -1326,6 +1331,232 @@ public CompletableFuture> createLLMObsExperimentEventsWithHttp null); } + /** + * Run an LLM inference. + * + *

See {@link #createLLMObsIntegrationInferenceWithHttpInfo}. + * + * @param integration The name of the LLM integration. (required) + * @param accountId The ID of the integration account. (required) + * @param body Inference request parameters. (required) + * @return LLMObsIntegrationInferenceResponse + * @throws ApiException if fails to make API call + */ + public LLMObsIntegrationInferenceResponse createLLMObsIntegrationInference( + LLMObsIntegrationName integration, String accountId, LLMObsIntegrationInferenceRequest body) + throws ApiException { + return createLLMObsIntegrationInferenceWithHttpInfo(integration, accountId, body).getData(); + } + + /** + * Run an LLM inference. + * + *

See {@link #createLLMObsIntegrationInferenceWithHttpInfoAsync}. + * + * @param integration The name of the LLM integration. (required) + * @param accountId The ID of the integration account. (required) + * @param body Inference request parameters. (required) + * @return CompletableFuture<LLMObsIntegrationInferenceResponse> + */ + public CompletableFuture + createLLMObsIntegrationInferenceAsync( + LLMObsIntegrationName integration, + String accountId, + LLMObsIntegrationInferenceRequest body) { + return createLLMObsIntegrationInferenceWithHttpInfoAsync(integration, accountId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Run an LLM inference request through the specified integration and account, returning the model + * response and token usage. + * + * @param integration The name of the LLM integration. (required) + * @param accountId The ID of the integration account. (required) + * @param body Inference request parameters. (required) + * @return ApiResponse<LLMObsIntegrationInferenceResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse + createLLMObsIntegrationInferenceWithHttpInfo( + LLMObsIntegrationName integration, + String accountId, + LLMObsIntegrationInferenceRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "createLLMObsIntegrationInference"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'integration' is set + if (integration == null) { + throw new ApiException( + 400, + "Missing the required parameter 'integration' when calling" + + " createLLMObsIntegrationInference"); + } + + // verify the required parameter 'accountId' is set + if (accountId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'accountId' when calling" + + " createLLMObsIntegrationInference"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling createLLMObsIntegrationInference"); + } + // create path and map variables + String localVarPath = + "/api/v2/llm-obs/v1/integrations/{integration}/{account_id}/inference" + .replaceAll( + "\\{" + "integration" + "\\}", apiClient.escapeString(integration.toString())) + .replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LlmObservabilityApi.createLLMObsIntegrationInference", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Run an LLM inference. + * + *

See {@link #createLLMObsIntegrationInferenceWithHttpInfo}. + * + * @param integration The name of the LLM integration. (required) + * @param accountId The ID of the integration account. (required) + * @param body Inference request parameters. (required) + * @return CompletableFuture<ApiResponse<LLMObsIntegrationInferenceResponse>> + */ + public CompletableFuture> + createLLMObsIntegrationInferenceWithHttpInfoAsync( + LLMObsIntegrationName integration, + String accountId, + LLMObsIntegrationInferenceRequest body) { + // Check if unstable operation is enabled + String operationId = "createLLMObsIntegrationInference"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'integration' is set + if (integration == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'integration' when calling" + + " createLLMObsIntegrationInference")); + return result; + } + + // verify the required parameter 'accountId' is set + if (accountId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'accountId' when calling" + + " createLLMObsIntegrationInference")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " createLLMObsIntegrationInference")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/llm-obs/v1/integrations/{integration}/{account_id}/inference" + .replaceAll( + "\\{" + "integration" + "\\}", apiClient.escapeString(integration.toString())) + .replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LlmObservabilityApi.createLLMObsIntegrationInference", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Create an LLM Observability project. * @@ -4548,6 +4779,359 @@ public ApiResponse listLLMObsExperimentsWithHttpInfo( new GenericType() {}); } + /** + * List LLM integration accounts. + * + *

See {@link #listLLMObsIntegrationAccountsWithHttpInfo}. + * + * @param integration The name of the LLM integration. (required) + * @return List<LLMObsIntegrationAccount> + * @throws ApiException if fails to make API call + */ + public List listLLMObsIntegrationAccounts( + LLMObsIntegrationName integration) throws ApiException { + return listLLMObsIntegrationAccountsWithHttpInfo(integration).getData(); + } + + /** + * List LLM integration accounts. + * + *

See {@link #listLLMObsIntegrationAccountsWithHttpInfoAsync}. + * + * @param integration The name of the LLM integration. (required) + * @return CompletableFuture<List<LLMObsIntegrationAccount>> + */ + public CompletableFuture> listLLMObsIntegrationAccountsAsync( + LLMObsIntegrationName integration) { + return listLLMObsIntegrationAccountsWithHttpInfoAsync(integration) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve the list of configured accounts for the specified LLM provider integration. + * + * @param integration The name of the LLM integration. (required) + * @return ApiResponse<List<LLMObsIntegrationAccount>> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse> listLLMObsIntegrationAccountsWithHttpInfo( + LLMObsIntegrationName integration) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listLLMObsIntegrationAccounts"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'integration' is set + if (integration == null) { + throw new ApiException( + 400, + "Missing the required parameter 'integration' when calling" + + " listLLMObsIntegrationAccounts"); + } + // create path and map variables + String localVarPath = + "/api/v2/llm-obs/v1/integrations/{integration}/accounts" + .replaceAll( + "\\{" + "integration" + "\\}", apiClient.escapeString(integration.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LlmObservabilityApi.listLLMObsIntegrationAccounts", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType>() {}); + } + + /** + * List LLM integration accounts. + * + *

See {@link #listLLMObsIntegrationAccountsWithHttpInfo}. + * + * @param integration The name of the LLM integration. (required) + * @return CompletableFuture<ApiResponse<List<LLMObsIntegrationAccount>>> + */ + public CompletableFuture>> + listLLMObsIntegrationAccountsWithHttpInfoAsync(LLMObsIntegrationName integration) { + // Check if unstable operation is enabled + String operationId = "listLLMObsIntegrationAccounts"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture>> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'integration' is set + if (integration == null) { + CompletableFuture>> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'integration' when calling" + + " listLLMObsIntegrationAccounts")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/llm-obs/v1/integrations/{integration}/accounts" + .replaceAll( + "\\{" + "integration" + "\\}", apiClient.escapeString(integration.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LlmObservabilityApi.listLLMObsIntegrationAccounts", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture>> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType>() {}); + } + + /** + * List LLM integration models. + * + *

See {@link #listLLMObsIntegrationModelsWithHttpInfo}. + * + * @param integration The name of the LLM integration. (required) + * @param accountId The ID of the integration account. (required) + * @return List<LLMObsIntegrationModel> + * @throws ApiException if fails to make API call + */ + public List listLLMObsIntegrationModels( + LLMObsIntegrationName integration, String accountId) throws ApiException { + return listLLMObsIntegrationModelsWithHttpInfo(integration, accountId).getData(); + } + + /** + * List LLM integration models. + * + *

See {@link #listLLMObsIntegrationModelsWithHttpInfoAsync}. + * + * @param integration The name of the LLM integration. (required) + * @param accountId The ID of the integration account. (required) + * @return CompletableFuture<List<LLMObsIntegrationModel>> + */ + public CompletableFuture> listLLMObsIntegrationModelsAsync( + LLMObsIntegrationName integration, String accountId) { + return listLLMObsIntegrationModelsWithHttpInfoAsync(integration, accountId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve the list of models available for the specified LLM provider integration and account. + * + * @param integration The name of the LLM integration. (required) + * @param accountId The ID of the integration account. (required) + * @return ApiResponse<List<LLMObsIntegrationModel>> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse> listLLMObsIntegrationModelsWithHttpInfo( + LLMObsIntegrationName integration, String accountId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listLLMObsIntegrationModels"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'integration' is set + if (integration == null) { + throw new ApiException( + 400, + "Missing the required parameter 'integration' when calling listLLMObsIntegrationModels"); + } + + // verify the required parameter 'accountId' is set + if (accountId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'accountId' when calling listLLMObsIntegrationModels"); + } + // create path and map variables + String localVarPath = + "/api/v2/llm-obs/v1/integrations/{integration}/{account_id}/models" + .replaceAll( + "\\{" + "integration" + "\\}", apiClient.escapeString(integration.toString())) + .replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LlmObservabilityApi.listLLMObsIntegrationModels", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType>() {}); + } + + /** + * List LLM integration models. + * + *

See {@link #listLLMObsIntegrationModelsWithHttpInfo}. + * + * @param integration The name of the LLM integration. (required) + * @param accountId The ID of the integration account. (required) + * @return CompletableFuture<ApiResponse<List<LLMObsIntegrationModel>>> + */ + public CompletableFuture>> + listLLMObsIntegrationModelsWithHttpInfoAsync( + LLMObsIntegrationName integration, String accountId) { + // Check if unstable operation is enabled + String operationId = "listLLMObsIntegrationModels"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture>> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'integration' is set + if (integration == null) { + CompletableFuture>> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'integration' when calling" + + " listLLMObsIntegrationModels")); + return result; + } + + // verify the required parameter 'accountId' is set + if (accountId == null) { + CompletableFuture>> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'accountId' when calling" + + " listLLMObsIntegrationModels")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/llm-obs/v1/integrations/{integration}/{account_id}/models" + .replaceAll( + "\\{" + "integration" + "\\}", apiClient.escapeString(integration.toString())) + .replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LlmObservabilityApi.listLLMObsIntegrationModels", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture>> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType>() {}); + } + /** Manage optional parameters to listLLMObsProjects. */ public static class ListLLMObsProjectsOptionalParameters { private String filterId; diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnthropicEffort.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnthropicEffort.java new file mode 100644 index 00000000000..c655f108179 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnthropicEffort.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The effort level for Anthropic inference. */ +@JsonSerialize(using = LLMObsAnthropicEffort.LLMObsAnthropicEffortSerializer.class) +public class LLMObsAnthropicEffort extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("low", "medium", "high", "max")); + + public static final LLMObsAnthropicEffort LOW = new LLMObsAnthropicEffort("low"); + public static final LLMObsAnthropicEffort MEDIUM = new LLMObsAnthropicEffort("medium"); + public static final LLMObsAnthropicEffort HIGH = new LLMObsAnthropicEffort("high"); + public static final LLMObsAnthropicEffort MAX = new LLMObsAnthropicEffort("max"); + + LLMObsAnthropicEffort(String value) { + super(value, allowedValues); + } + + public static class LLMObsAnthropicEffortSerializer extends StdSerializer { + public LLMObsAnthropicEffortSerializer(Class t) { + super(t); + } + + public LLMObsAnthropicEffortSerializer() { + this(null); + } + + @Override + public void serialize( + LLMObsAnthropicEffort value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static LLMObsAnthropicEffort fromValue(String value) { + return new LLMObsAnthropicEffort(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnthropicMetadata.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnthropicMetadata.java new file mode 100644 index 00000000000..b92618c62c2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnthropicMetadata.java @@ -0,0 +1,180 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Anthropic-specific metadata for an inference request. */ +@JsonPropertyOrder({ + LLMObsAnthropicMetadata.JSON_PROPERTY_EFFORT, + LLMObsAnthropicMetadata.JSON_PROPERTY_THINKING +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsAnthropicMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EFFORT = "effort"; + private JsonNullable effort = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_THINKING = "thinking"; + private LLMObsAnthropicThinkingConfig thinking; + + public LLMObsAnthropicMetadata effort(LLMObsAnthropicEffort effort) { + this.effort = JsonNullable.of(effort); + return this; + } + + /** + * The effort level for Anthropic inference. + * + * @return effort + */ + @jakarta.annotation.Nullable + @JsonIgnore + public LLMObsAnthropicEffort getEffort() { + return effort.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_EFFORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getEffort_JsonNullable() { + return effort; + } + + @JsonProperty(JSON_PROPERTY_EFFORT) + public void setEffort_JsonNullable(JsonNullable effort) { + this.effort = effort; + } + + public void setEffort(LLMObsAnthropicEffort effort) { + if (!effort.isValid()) { + this.unparsed = true; + } + this.effort = JsonNullable.of(effort); + } + + public LLMObsAnthropicMetadata thinking(LLMObsAnthropicThinkingConfig thinking) { + this.thinking = thinking; + this.unparsed |= thinking.unparsed; + return this; + } + + /** + * Configuration for Anthropic extended thinking feature. + * + * @return thinking + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_THINKING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsAnthropicThinkingConfig getThinking() { + return thinking; + } + + public void setThinking(LLMObsAnthropicThinkingConfig thinking) { + this.thinking = thinking; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsAnthropicMetadata + */ + @JsonAnySetter + public LLMObsAnthropicMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsAnthropicMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsAnthropicMetadata llmObsAnthropicMetadata = (LLMObsAnthropicMetadata) o; + return Objects.equals(this.effort, llmObsAnthropicMetadata.effort) + && Objects.equals(this.thinking, llmObsAnthropicMetadata.thinking) + && Objects.equals(this.additionalProperties, llmObsAnthropicMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(effort, thinking, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsAnthropicMetadata {\n"); + sb.append(" effort: ").append(toIndentedString(effort)).append("\n"); + sb.append(" thinking: ").append(toIndentedString(thinking)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnthropicThinkingConfig.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnthropicThinkingConfig.java new file mode 100644 index 00000000000..881d10f29a3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnthropicThinkingConfig.java @@ -0,0 +1,189 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Configuration for Anthropic extended thinking feature. */ +@JsonPropertyOrder({ + LLMObsAnthropicThinkingConfig.JSON_PROPERTY_BUDGET_TOKENS, + LLMObsAnthropicThinkingConfig.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsAnthropicThinkingConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BUDGET_TOKENS = "budget_tokens"; + private JsonNullable budgetTokens = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TYPE = "type"; + private LLMObsAnthropicThinkingType type; + + public LLMObsAnthropicThinkingConfig() {} + + @JsonCreator + public LLMObsAnthropicThinkingConfig( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) LLMObsAnthropicThinkingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public LLMObsAnthropicThinkingConfig budgetTokens(Long budgetTokens) { + this.budgetTokens = JsonNullable.of(budgetTokens); + return this; + } + + /** + * Maximum token budget for extended thinking. Required when type is enabled. + * + * @return budgetTokens + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getBudgetTokens() { + return budgetTokens.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_BUDGET_TOKENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getBudgetTokens_JsonNullable() { + return budgetTokens; + } + + @JsonProperty(JSON_PROPERTY_BUDGET_TOKENS) + public void setBudgetTokens_JsonNullable(JsonNullable budgetTokens) { + this.budgetTokens = budgetTokens; + } + + public void setBudgetTokens(Long budgetTokens) { + this.budgetTokens = JsonNullable.of(budgetTokens); + } + + public LLMObsAnthropicThinkingConfig type(LLMObsAnthropicThinkingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The thinking mode for Anthropic extended thinking. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsAnthropicThinkingType getType() { + return type; + } + + public void setType(LLMObsAnthropicThinkingType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsAnthropicThinkingConfig + */ + @JsonAnySetter + public LLMObsAnthropicThinkingConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsAnthropicThinkingConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsAnthropicThinkingConfig llmObsAnthropicThinkingConfig = (LLMObsAnthropicThinkingConfig) o; + return Objects.equals(this.budgetTokens, llmObsAnthropicThinkingConfig.budgetTokens) + && Objects.equals(this.type, llmObsAnthropicThinkingConfig.type) + && Objects.equals( + this.additionalProperties, llmObsAnthropicThinkingConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(budgetTokens, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsAnthropicThinkingConfig {\n"); + sb.append(" budgetTokens: ").append(toIndentedString(budgetTokens)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnthropicThinkingType.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnthropicThinkingType.java new file mode 100644 index 00000000000..9587a15f410 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnthropicThinkingType.java @@ -0,0 +1,61 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The thinking mode for Anthropic extended thinking. */ +@JsonSerialize(using = LLMObsAnthropicThinkingType.LLMObsAnthropicThinkingTypeSerializer.class) +public class LLMObsAnthropicThinkingType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("enabled", "disabled", "adaptive")); + + public static final LLMObsAnthropicThinkingType ENABLED = + new LLMObsAnthropicThinkingType("enabled"); + public static final LLMObsAnthropicThinkingType DISABLED = + new LLMObsAnthropicThinkingType("disabled"); + public static final LLMObsAnthropicThinkingType ADAPTIVE = + new LLMObsAnthropicThinkingType("adaptive"); + + LLMObsAnthropicThinkingType(String value) { + super(value, allowedValues); + } + + public static class LLMObsAnthropicThinkingTypeSerializer + extends StdSerializer { + public LLMObsAnthropicThinkingTypeSerializer(Class t) { + super(t); + } + + public LLMObsAnthropicThinkingTypeSerializer() { + this(null); + } + + @Override + public void serialize( + LLMObsAnthropicThinkingType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static LLMObsAnthropicThinkingType fromValue(String value) { + return new LLMObsAnthropicThinkingType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAzureOpenAIMetadata.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAzureOpenAIMetadata.java new file mode 100644 index 00000000000..aabc56a12e3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAzureOpenAIMetadata.java @@ -0,0 +1,192 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Azure OpenAI-specific metadata for an integration account or inference request. */ +@JsonPropertyOrder({ + LLMObsAzureOpenAIMetadata.JSON_PROPERTY_DEPLOYMENT_ID, + LLMObsAzureOpenAIMetadata.JSON_PROPERTY_MODEL_VERSION, + LLMObsAzureOpenAIMetadata.JSON_PROPERTY_RESOURCE_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsAzureOpenAIMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DEPLOYMENT_ID = "deployment_id"; + private String deploymentId; + + public static final String JSON_PROPERTY_MODEL_VERSION = "model_version"; + private String modelVersion; + + public static final String JSON_PROPERTY_RESOURCE_NAME = "resource_name"; + private String resourceName; + + public LLMObsAzureOpenAIMetadata deploymentId(String deploymentId) { + this.deploymentId = deploymentId; + return this; + } + + /** + * The Azure OpenAI deployment ID. + * + * @return deploymentId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEPLOYMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeploymentId() { + return deploymentId; + } + + public void setDeploymentId(String deploymentId) { + this.deploymentId = deploymentId; + } + + public LLMObsAzureOpenAIMetadata modelVersion(String modelVersion) { + this.modelVersion = modelVersion; + return this; + } + + /** + * The model version deployed in Azure. + * + * @return modelVersion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODEL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public LLMObsAzureOpenAIMetadata resourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * The Azure OpenAI resource name. + * + * @return resourceName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESOURCE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getResourceName() { + return resourceName; + } + + public void setResourceName(String resourceName) { + this.resourceName = resourceName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsAzureOpenAIMetadata + */ + @JsonAnySetter + public LLMObsAzureOpenAIMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsAzureOpenAIMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsAzureOpenAIMetadata llmObsAzureOpenAiMetadata = (LLMObsAzureOpenAIMetadata) o; + return Objects.equals(this.deploymentId, llmObsAzureOpenAiMetadata.deploymentId) + && Objects.equals(this.modelVersion, llmObsAzureOpenAiMetadata.modelVersion) + && Objects.equals(this.resourceName, llmObsAzureOpenAiMetadata.resourceName) + && Objects.equals( + this.additionalProperties, llmObsAzureOpenAiMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(deploymentId, modelVersion, resourceName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsAzureOpenAIMetadata {\n"); + sb.append(" deploymentId: ").append(toIndentedString(deploymentId)).append("\n"); + sb.append(" modelVersion: ").append(toIndentedString(modelVersion)).append("\n"); + sb.append(" resourceName: ").append(toIndentedString(resourceName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsBedrockMetadata.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsBedrockMetadata.java new file mode 100644 index 00000000000..1c259648619 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsBedrockMetadata.java @@ -0,0 +1,135 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Amazon Bedrock-specific metadata for an inference request. */ +@JsonPropertyOrder({LLMObsBedrockMetadata.JSON_PROPERTY_REGION}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsBedrockMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_REGION = "region"; + private String region; + + public LLMObsBedrockMetadata region(String region) { + this.region = region; + return this; + } + + /** + * The AWS region for the Bedrock request. + * + * @return region + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REGION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsBedrockMetadata + */ + @JsonAnySetter + public LLMObsBedrockMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsBedrockMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsBedrockMetadata llmObsBedrockMetadata = (LLMObsBedrockMetadata) o; + return Objects.equals(this.region, llmObsBedrockMetadata.region) + && Objects.equals(this.additionalProperties, llmObsBedrockMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(region, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsBedrockMetadata {\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceCode.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceCode.java new file mode 100644 index 00000000000..f6805fc621c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceCode.java @@ -0,0 +1,201 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A generated code snippet for running an inference request programmatically. */ +@JsonPropertyOrder({ + LLMObsInferenceCode.JSON_PROPERTY_CODE, + LLMObsInferenceCode.JSON_PROPERTY_ID, + LLMObsInferenceCode.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsInferenceCode { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CODE = "code"; + private String code; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public LLMObsInferenceCode() {} + + @JsonCreator + public LLMObsInferenceCode( + @JsonProperty(required = true, value = JSON_PROPERTY_CODE) String code, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.code = code; + this.id = id; + this.type = type; + } + + public LLMObsInferenceCode code(String code) { + this.code = code; + return this; + } + + /** + * The generated code content. + * + * @return code + */ + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public LLMObsInferenceCode id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the code snippet. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public LLMObsInferenceCode type(String type) { + this.type = type; + return this; + } + + /** + * The programming language or SDK type of the code snippet. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsInferenceCode + */ + @JsonAnySetter + public LLMObsInferenceCode putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsInferenceCode object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsInferenceCode llmObsInferenceCode = (LLMObsInferenceCode) o; + return Objects.equals(this.code, llmObsInferenceCode.code) + && Objects.equals(this.id, llmObsInferenceCode.id) + && Objects.equals(this.type, llmObsInferenceCode.type) + && Objects.equals(this.additionalProperties, llmObsInferenceCode.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(code, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsInferenceCode {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceContent.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceContent.java new file mode 100644 index 00000000000..4cdfebb697f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceContent.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A structured content block within a message. */ +@JsonPropertyOrder({ + LLMObsInferenceContent.JSON_PROPERTY_TYPE, + LLMObsInferenceContent.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsInferenceContent { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_VALUE = "value"; + private LLMObsInferenceContentValue value; + + public LLMObsInferenceContent() {} + + @JsonCreator + public LLMObsInferenceContent( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) + LLMObsInferenceContentValue value) { + this.type = type; + this.value = value; + this.unparsed |= value.unparsed; + } + + public LLMObsInferenceContent type(String type) { + this.type = type; + return this; + } + + /** + * The content block type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public LLMObsInferenceContent value(LLMObsInferenceContentValue value) { + this.value = value; + this.unparsed |= value.unparsed; + return this; + } + + /** + * The typed value of a message content block. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsInferenceContentValue getValue() { + return value; + } + + public void setValue(LLMObsInferenceContentValue value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsInferenceContent + */ + @JsonAnySetter + public LLMObsInferenceContent putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsInferenceContent object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsInferenceContent llmObsInferenceContent = (LLMObsInferenceContent) o; + return Objects.equals(this.type, llmObsInferenceContent.type) + && Objects.equals(this.value, llmObsInferenceContent.value) + && Objects.equals(this.additionalProperties, llmObsInferenceContent.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsInferenceContent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceContentValue.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceContentValue.java new file mode 100644 index 00000000000..ce0946105b3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceContentValue.java @@ -0,0 +1,194 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The typed value of a message content block. */ +@JsonPropertyOrder({ + LLMObsInferenceContentValue.JSON_PROPERTY_TEXT, + LLMObsInferenceContentValue.JSON_PROPERTY_TOOL_CALL, + LLMObsInferenceContentValue.JSON_PROPERTY_TOOL_CALL_RESULT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsInferenceContentValue { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public static final String JSON_PROPERTY_TOOL_CALL = "tool_call"; + private LLMObsInferenceToolCall toolCall; + + public static final String JSON_PROPERTY_TOOL_CALL_RESULT = "tool_call_result"; + private LLMObsInferenceToolResult toolCallResult; + + public LLMObsInferenceContentValue text(String text) { + this.text = text; + return this; + } + + /** + * Plain text content. + * + * @return text + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public LLMObsInferenceContentValue toolCall(LLMObsInferenceToolCall toolCall) { + this.toolCall = toolCall; + this.unparsed |= toolCall.unparsed; + return this; + } + + /** + * A tool call made during LLM inference. + * + * @return toolCall + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOOL_CALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsInferenceToolCall getToolCall() { + return toolCall; + } + + public void setToolCall(LLMObsInferenceToolCall toolCall) { + this.toolCall = toolCall; + } + + public LLMObsInferenceContentValue toolCallResult(LLMObsInferenceToolResult toolCallResult) { + this.toolCallResult = toolCallResult; + this.unparsed |= toolCallResult.unparsed; + return this; + } + + /** + * The result returned by a tool call during LLM inference. + * + * @return toolCallResult + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOOL_CALL_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsInferenceToolResult getToolCallResult() { + return toolCallResult; + } + + public void setToolCallResult(LLMObsInferenceToolResult toolCallResult) { + this.toolCallResult = toolCallResult; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsInferenceContentValue + */ + @JsonAnySetter + public LLMObsInferenceContentValue putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsInferenceContentValue object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsInferenceContentValue llmObsInferenceContentValue = (LLMObsInferenceContentValue) o; + return Objects.equals(this.text, llmObsInferenceContentValue.text) + && Objects.equals(this.toolCall, llmObsInferenceContentValue.toolCall) + && Objects.equals(this.toolCallResult, llmObsInferenceContentValue.toolCallResult) + && Objects.equals( + this.additionalProperties, llmObsInferenceContentValue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(text, toolCall, toolCallResult, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsInferenceContentValue {\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" toolCall: ").append(toIndentedString(toolCall)).append("\n"); + sb.append(" toolCallResult: ").append(toIndentedString(toolCallResult)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceErrorResponse.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceErrorResponse.java new file mode 100644 index 00000000000..7541a7888c2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceErrorResponse.java @@ -0,0 +1,174 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Error details returned when an inference provider returns an error. */ +@JsonPropertyOrder({ + LLMObsInferenceErrorResponse.JSON_PROPERTY_MESSAGE, + LLMObsInferenceErrorResponse.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsInferenceErrorResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public LLMObsInferenceErrorResponse() {} + + @JsonCreator + public LLMObsInferenceErrorResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_MESSAGE) String message, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.message = message; + this.type = type; + } + + public LLMObsInferenceErrorResponse message(String message) { + this.message = message; + return this; + } + + /** + * A human-readable description of the error. + * + * @return message + */ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public LLMObsInferenceErrorResponse type(String type) { + this.type = type; + return this; + } + + /** + * The provider-specific error type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsInferenceErrorResponse + */ + @JsonAnySetter + public LLMObsInferenceErrorResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsInferenceErrorResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsInferenceErrorResponse llmObsInferenceErrorResponse = (LLMObsInferenceErrorResponse) o; + return Objects.equals(this.message, llmObsInferenceErrorResponse.message) + && Objects.equals(this.type, llmObsInferenceErrorResponse.type) + && Objects.equals( + this.additionalProperties, llmObsInferenceErrorResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(message, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsInferenceErrorResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceFunction.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceFunction.java new file mode 100644 index 00000000000..89f36bfef9f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceFunction.java @@ -0,0 +1,206 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A function definition for a tool available to the model. */ +@JsonPropertyOrder({ + LLMObsInferenceFunction.JSON_PROPERTY_DESCRIPTION, + LLMObsInferenceFunction.JSON_PROPERTY_NAME, + LLMObsInferenceFunction.JSON_PROPERTY_PARAMETERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsInferenceFunction { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PARAMETERS = "parameters"; + private Map parameters = new HashMap(); + + public LLMObsInferenceFunction() {} + + @JsonCreator + public LLMObsInferenceFunction( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_PARAMETERS) + Map parameters) { + this.name = name; + this.parameters = parameters; + } + + public LLMObsInferenceFunction description(String description) { + this.description = description; + return this; + } + + /** + * A description of what the function does. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public LLMObsInferenceFunction name(String name) { + this.name = name; + return this; + } + + /** + * The name of the function. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public LLMObsInferenceFunction parameters(Map parameters) { + this.parameters = parameters; + return this; + } + + public LLMObsInferenceFunction putParametersItem(String key, Object parametersItem) { + this.parameters.put(key, parametersItem); + return this; + } + + /** + * JSON schema describing the function parameters. + * + * @return parameters + */ + @JsonProperty(JSON_PROPERTY_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map getParameters() { + return parameters; + } + + public void setParameters(Map parameters) { + this.parameters = parameters; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsInferenceFunction + */ + @JsonAnySetter + public LLMObsInferenceFunction putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsInferenceFunction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsInferenceFunction llmObsInferenceFunction = (LLMObsInferenceFunction) o; + return Objects.equals(this.description, llmObsInferenceFunction.description) + && Objects.equals(this.name, llmObsInferenceFunction.name) + && Objects.equals(this.parameters, llmObsInferenceFunction.parameters) + && Objects.equals(this.additionalProperties, llmObsInferenceFunction.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, name, parameters, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsInferenceFunction {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceMessage.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceMessage.java new file mode 100644 index 00000000000..ca85ad3d0e3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceMessage.java @@ -0,0 +1,310 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A single message in an LLM inference conversation. */ +@JsonPropertyOrder({ + LLMObsInferenceMessage.JSON_PROPERTY_CONTENT, + LLMObsInferenceMessage.JSON_PROPERTY_CONTENTS, + LLMObsInferenceMessage.JSON_PROPERTY_ID, + LLMObsInferenceMessage.JSON_PROPERTY_ROLE, + LLMObsInferenceMessage.JSON_PROPERTY_TOOL_CALLS, + LLMObsInferenceMessage.JSON_PROPERTY_TOOL_RESULTS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsInferenceMessage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public static final String JSON_PROPERTY_CONTENTS = "contents"; + private List contents = null; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_ROLE = "role"; + private String role; + + public static final String JSON_PROPERTY_TOOL_CALLS = "tool_calls"; + private List toolCalls = null; + + public static final String JSON_PROPERTY_TOOL_RESULTS = "tool_results"; + private List toolResults = null; + + public LLMObsInferenceMessage content(String content) { + this.content = content; + return this; + } + + /** + * Plain text content of the message. + * + * @return content + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public LLMObsInferenceMessage contents(List contents) { + this.contents = contents; + for (LLMObsInferenceContent item : contents) { + this.unparsed |= item.unparsed; + } + return this; + } + + public LLMObsInferenceMessage addContentsItem(LLMObsInferenceContent contentsItem) { + if (this.contents == null) { + this.contents = new ArrayList<>(); + } + this.contents.add(contentsItem); + this.unparsed |= contentsItem.unparsed; + return this; + } + + /** + * List of structured content blocks in a message. + * + * @return contents + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContents() { + return contents; + } + + public void setContents(List contents) { + this.contents = contents; + } + + public LLMObsInferenceMessage id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the message. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public LLMObsInferenceMessage role(String role) { + this.role = role; + return this; + } + + /** + * The role of the message author. + * + * @return role + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public LLMObsInferenceMessage toolCalls(List toolCalls) { + this.toolCalls = toolCalls; + for (LLMObsInferenceToolCall item : toolCalls) { + this.unparsed |= item.unparsed; + } + return this; + } + + public LLMObsInferenceMessage addToolCallsItem(LLMObsInferenceToolCall toolCallsItem) { + if (this.toolCalls == null) { + this.toolCalls = new ArrayList<>(); + } + this.toolCalls.add(toolCallsItem); + this.unparsed |= toolCallsItem.unparsed; + return this; + } + + /** + * List of tool calls in a message. + * + * @return toolCalls + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOOL_CALLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getToolCalls() { + return toolCalls; + } + + public void setToolCalls(List toolCalls) { + this.toolCalls = toolCalls; + } + + public LLMObsInferenceMessage toolResults(List toolResults) { + this.toolResults = toolResults; + for (LLMObsInferenceToolResult item : toolResults) { + this.unparsed |= item.unparsed; + } + return this; + } + + public LLMObsInferenceMessage addToolResultsItem(LLMObsInferenceToolResult toolResultsItem) { + if (this.toolResults == null) { + this.toolResults = new ArrayList<>(); + } + this.toolResults.add(toolResultsItem); + this.unparsed |= toolResultsItem.unparsed; + return this; + } + + /** + * List of tool results in a message. + * + * @return toolResults + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOOL_RESULTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getToolResults() { + return toolResults; + } + + public void setToolResults(List toolResults) { + this.toolResults = toolResults; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsInferenceMessage + */ + @JsonAnySetter + public LLMObsInferenceMessage putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsInferenceMessage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsInferenceMessage llmObsInferenceMessage = (LLMObsInferenceMessage) o; + return Objects.equals(this.content, llmObsInferenceMessage.content) + && Objects.equals(this.contents, llmObsInferenceMessage.contents) + && Objects.equals(this.id, llmObsInferenceMessage.id) + && Objects.equals(this.role, llmObsInferenceMessage.role) + && Objects.equals(this.toolCalls, llmObsInferenceMessage.toolCalls) + && Objects.equals(this.toolResults, llmObsInferenceMessage.toolResults) + && Objects.equals(this.additionalProperties, llmObsInferenceMessage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(content, contents, id, role, toolCalls, toolResults, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsInferenceMessage {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" contents: ").append(toIndentedString(contents)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" toolCalls: ").append(toIndentedString(toolCalls)).append("\n"); + sb.append(" toolResults: ").append(toIndentedString(toolResults)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceRunResult.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceRunResult.java new file mode 100644 index 00000000000..b3f8ba372bb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceRunResult.java @@ -0,0 +1,432 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The output of a completed LLM inference call. */ +@JsonPropertyOrder({ + LLMObsInferenceRunResult.JSON_PROPERTY_ASSESSMENT, + LLMObsInferenceRunResult.JSON_PROPERTY_CONTENT, + LLMObsInferenceRunResult.JSON_PROPERTY_FINISH_REASON, + LLMObsInferenceRunResult.JSON_PROPERTY_INFERENCE_CODES, + LLMObsInferenceRunResult.JSON_PROPERTY_INPUT_TOKENS, + LLMObsInferenceRunResult.JSON_PROPERTY_INTERNAL_REASONING, + LLMObsInferenceRunResult.JSON_PROPERTY_LATENCY, + LLMObsInferenceRunResult.JSON_PROPERTY_OUTPUT_TOKENS, + LLMObsInferenceRunResult.JSON_PROPERTY_TOOLS, + LLMObsInferenceRunResult.JSON_PROPERTY_TOTAL_TOKENS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsInferenceRunResult { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSESSMENT = "assessment"; + private String assessment; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public static final String JSON_PROPERTY_FINISH_REASON = "finish_reason"; + private String finishReason; + + public static final String JSON_PROPERTY_INFERENCE_CODES = "inference_codes"; + private List inferenceCodes = new ArrayList<>(); + + public static final String JSON_PROPERTY_INPUT_TOKENS = "input_tokens"; + private Long inputTokens; + + public static final String JSON_PROPERTY_INTERNAL_REASONING = "internal_reasoning"; + private LLMObsInternalReasoning internalReasoning; + + public static final String JSON_PROPERTY_LATENCY = "latency"; + private Long latency; + + public static final String JSON_PROPERTY_OUTPUT_TOKENS = "output_tokens"; + private Long outputTokens; + + public static final String JSON_PROPERTY_TOOLS = "tools"; + private List tools = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_TOKENS = "total_tokens"; + private Long totalTokens; + + public LLMObsInferenceRunResult() {} + + @JsonCreator + public LLMObsInferenceRunResult( + @JsonProperty(required = true, value = JSON_PROPERTY_ASSESSMENT) String assessment, + @JsonProperty(required = true, value = JSON_PROPERTY_CONTENT) String content, + @JsonProperty(required = true, value = JSON_PROPERTY_FINISH_REASON) String finishReason, + @JsonProperty(required = true, value = JSON_PROPERTY_INFERENCE_CODES) + List inferenceCodes, + @JsonProperty(required = true, value = JSON_PROPERTY_INPUT_TOKENS) Long inputTokens, + @JsonProperty(required = true, value = JSON_PROPERTY_LATENCY) Long latency, + @JsonProperty(required = true, value = JSON_PROPERTY_OUTPUT_TOKENS) Long outputTokens, + @JsonProperty(required = true, value = JSON_PROPERTY_TOOLS) List tools, + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL_TOKENS) Long totalTokens) { + this.assessment = assessment; + if (assessment != null) {} + this.content = content; + this.finishReason = finishReason; + this.inferenceCodes = inferenceCodes; + this.inputTokens = inputTokens; + this.latency = latency; + this.outputTokens = outputTokens; + this.tools = tools; + this.totalTokens = totalTokens; + } + + public LLMObsInferenceRunResult assessment(String assessment) { + this.assessment = assessment; + if (assessment != null) {} + return this; + } + + /** + * An optional assessment of the inference output quality. + * + * @return assessment + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSESSMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAssessment() { + return assessment; + } + + public void setAssessment(String assessment) { + this.assessment = assessment; + } + + public LLMObsInferenceRunResult content(String content) { + this.content = content; + return this; + } + + /** + * The text content of the model response. + * + * @return content + */ + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public LLMObsInferenceRunResult finishReason(String finishReason) { + this.finishReason = finishReason; + return this; + } + + /** + * The reason the model stopped generating tokens. + * + * @return finishReason + */ + @JsonProperty(JSON_PROPERTY_FINISH_REASON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFinishReason() { + return finishReason; + } + + public void setFinishReason(String finishReason) { + this.finishReason = finishReason; + } + + public LLMObsInferenceRunResult inferenceCodes(List inferenceCodes) { + this.inferenceCodes = inferenceCodes; + for (LLMObsInferenceCode item : inferenceCodes) { + this.unparsed |= item.unparsed; + } + return this; + } + + public LLMObsInferenceRunResult addInferenceCodesItem(LLMObsInferenceCode inferenceCodesItem) { + this.inferenceCodes.add(inferenceCodesItem); + this.unparsed |= inferenceCodesItem.unparsed; + return this; + } + + /** + * List of generated code snippets for the inference configuration. + * + * @return inferenceCodes + */ + @JsonProperty(JSON_PROPERTY_INFERENCE_CODES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getInferenceCodes() { + return inferenceCodes; + } + + public void setInferenceCodes(List inferenceCodes) { + this.inferenceCodes = inferenceCodes; + } + + public LLMObsInferenceRunResult inputTokens(Long inputTokens) { + this.inputTokens = inputTokens; + return this; + } + + /** + * Number of input tokens consumed. + * + * @return inputTokens + */ + @JsonProperty(JSON_PROPERTY_INPUT_TOKENS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getInputTokens() { + return inputTokens; + } + + public void setInputTokens(Long inputTokens) { + this.inputTokens = inputTokens; + } + + public LLMObsInferenceRunResult internalReasoning(LLMObsInternalReasoning internalReasoning) { + this.internalReasoning = internalReasoning; + this.unparsed |= internalReasoning.unparsed; + return this; + } + + /** + * The model's internal reasoning or thinking output, if available. + * + * @return internalReasoning + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTERNAL_REASONING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsInternalReasoning getInternalReasoning() { + return internalReasoning; + } + + public void setInternalReasoning(LLMObsInternalReasoning internalReasoning) { + this.internalReasoning = internalReasoning; + } + + public LLMObsInferenceRunResult latency(Long latency) { + this.latency = latency; + return this; + } + + /** + * Request latency in milliseconds. + * + * @return latency + */ + @JsonProperty(JSON_PROPERTY_LATENCY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getLatency() { + return latency; + } + + public void setLatency(Long latency) { + this.latency = latency; + } + + public LLMObsInferenceRunResult outputTokens(Long outputTokens) { + this.outputTokens = outputTokens; + return this; + } + + /** + * Number of output tokens generated. + * + * @return outputTokens + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_TOKENS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getOutputTokens() { + return outputTokens; + } + + public void setOutputTokens(Long outputTokens) { + this.outputTokens = outputTokens; + } + + public LLMObsInferenceRunResult tools(List tools) { + this.tools = tools; + for (LLMObsInferenceTool item : tools) { + this.unparsed |= item.unparsed; + } + return this; + } + + public LLMObsInferenceRunResult addToolsItem(LLMObsInferenceTool toolsItem) { + this.tools.add(toolsItem); + this.unparsed |= toolsItem.unparsed; + return this; + } + + /** + * List of tools available to the model. + * + * @return tools + */ + @JsonProperty(JSON_PROPERTY_TOOLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTools() { + return tools; + } + + public void setTools(List tools) { + this.tools = tools; + } + + public LLMObsInferenceRunResult totalTokens(Long totalTokens) { + this.totalTokens = totalTokens; + return this; + } + + /** + * Total tokens used (input plus output). + * + * @return totalTokens + */ + @JsonProperty(JSON_PROPERTY_TOTAL_TOKENS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotalTokens() { + return totalTokens; + } + + public void setTotalTokens(Long totalTokens) { + this.totalTokens = totalTokens; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsInferenceRunResult + */ + @JsonAnySetter + public LLMObsInferenceRunResult putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsInferenceRunResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsInferenceRunResult llmObsInferenceRunResult = (LLMObsInferenceRunResult) o; + return Objects.equals(this.assessment, llmObsInferenceRunResult.assessment) + && Objects.equals(this.content, llmObsInferenceRunResult.content) + && Objects.equals(this.finishReason, llmObsInferenceRunResult.finishReason) + && Objects.equals(this.inferenceCodes, llmObsInferenceRunResult.inferenceCodes) + && Objects.equals(this.inputTokens, llmObsInferenceRunResult.inputTokens) + && Objects.equals(this.internalReasoning, llmObsInferenceRunResult.internalReasoning) + && Objects.equals(this.latency, llmObsInferenceRunResult.latency) + && Objects.equals(this.outputTokens, llmObsInferenceRunResult.outputTokens) + && Objects.equals(this.tools, llmObsInferenceRunResult.tools) + && Objects.equals(this.totalTokens, llmObsInferenceRunResult.totalTokens) + && Objects.equals(this.additionalProperties, llmObsInferenceRunResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + assessment, + content, + finishReason, + inferenceCodes, + inputTokens, + internalReasoning, + latency, + outputTokens, + tools, + totalTokens, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsInferenceRunResult {\n"); + sb.append(" assessment: ").append(toIndentedString(assessment)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" finishReason: ").append(toIndentedString(finishReason)).append("\n"); + sb.append(" inferenceCodes: ").append(toIndentedString(inferenceCodes)).append("\n"); + sb.append(" inputTokens: ").append(toIndentedString(inputTokens)).append("\n"); + sb.append(" internalReasoning: ").append(toIndentedString(internalReasoning)).append("\n"); + sb.append(" latency: ").append(toIndentedString(latency)).append("\n"); + sb.append(" outputTokens: ").append(toIndentedString(outputTokens)).append("\n"); + sb.append(" tools: ").append(toIndentedString(tools)).append("\n"); + sb.append(" totalTokens: ").append(toIndentedString(totalTokens)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceTool.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceTool.java new file mode 100644 index 00000000000..6782aa16af0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceTool.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A tool definition available to the model during inference. */ +@JsonPropertyOrder({ + LLMObsInferenceTool.JSON_PROPERTY_FUNCTION, + LLMObsInferenceTool.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsInferenceTool { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FUNCTION = "function"; + private LLMObsInferenceFunction function; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public LLMObsInferenceTool() {} + + @JsonCreator + public LLMObsInferenceTool( + @JsonProperty(required = true, value = JSON_PROPERTY_FUNCTION) + LLMObsInferenceFunction function, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.function = function; + this.unparsed |= function.unparsed; + this.type = type; + } + + public LLMObsInferenceTool function(LLMObsInferenceFunction function) { + this.function = function; + this.unparsed |= function.unparsed; + return this; + } + + /** + * A function definition for a tool available to the model. + * + * @return function + */ + @JsonProperty(JSON_PROPERTY_FUNCTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsInferenceFunction getFunction() { + return function; + } + + public void setFunction(LLMObsInferenceFunction function) { + this.function = function; + } + + public LLMObsInferenceTool type(String type) { + this.type = type; + return this; + } + + /** + * The type of tool. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsInferenceTool + */ + @JsonAnySetter + public LLMObsInferenceTool putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsInferenceTool object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsInferenceTool llmObsInferenceTool = (LLMObsInferenceTool) o; + return Objects.equals(this.function, llmObsInferenceTool.function) + && Objects.equals(this.type, llmObsInferenceTool.type) + && Objects.equals(this.additionalProperties, llmObsInferenceTool.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(function, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsInferenceTool {\n"); + sb.append(" function: ").append(toIndentedString(function)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceToolCall.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceToolCall.java new file mode 100644 index 00000000000..b7d4cc701b9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceToolCall.java @@ -0,0 +1,226 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A tool call made during LLM inference. */ +@JsonPropertyOrder({ + LLMObsInferenceToolCall.JSON_PROPERTY_ARGUMENTS, + LLMObsInferenceToolCall.JSON_PROPERTY_NAME, + LLMObsInferenceToolCall.JSON_PROPERTY_TOOL_ID, + LLMObsInferenceToolCall.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsInferenceToolCall { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ARGUMENTS = "arguments"; + private Map arguments = null; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TOOL_ID = "tool_id"; + private String toolId; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public LLMObsInferenceToolCall arguments(Map arguments) { + this.arguments = arguments; + return this; + } + + public LLMObsInferenceToolCall putArgumentsItem(String key, Object argumentsItem) { + if (this.arguments == null) { + this.arguments = new HashMap<>(); + } + this.arguments.put(key, argumentsItem); + return this; + } + + /** + * The arguments passed to the tool. + * + * @return arguments + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARGUMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getArguments() { + return arguments; + } + + public void setArguments(Map arguments) { + this.arguments = arguments; + } + + public LLMObsInferenceToolCall name(String name) { + this.name = name; + return this; + } + + /** + * The name of the tool being called. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public LLMObsInferenceToolCall toolId(String toolId) { + this.toolId = toolId; + return this; + } + + /** + * Unique identifier for the tool call. + * + * @return toolId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOOL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getToolId() { + return toolId; + } + + public void setToolId(String toolId) { + this.toolId = toolId; + } + + public LLMObsInferenceToolCall type(String type) { + this.type = type; + return this; + } + + /** + * The type of tool call. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsInferenceToolCall + */ + @JsonAnySetter + public LLMObsInferenceToolCall putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsInferenceToolCall object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsInferenceToolCall llmObsInferenceToolCall = (LLMObsInferenceToolCall) o; + return Objects.equals(this.arguments, llmObsInferenceToolCall.arguments) + && Objects.equals(this.name, llmObsInferenceToolCall.name) + && Objects.equals(this.toolId, llmObsInferenceToolCall.toolId) + && Objects.equals(this.type, llmObsInferenceToolCall.type) + && Objects.equals(this.additionalProperties, llmObsInferenceToolCall.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(arguments, name, toolId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsInferenceToolCall {\n"); + sb.append(" arguments: ").append(toIndentedString(arguments)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" toolId: ").append(toIndentedString(toolId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceToolResult.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceToolResult.java new file mode 100644 index 00000000000..63c151e0bce --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsInferenceToolResult.java @@ -0,0 +1,219 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The result returned by a tool call during LLM inference. */ +@JsonPropertyOrder({ + LLMObsInferenceToolResult.JSON_PROPERTY_NAME, + LLMObsInferenceToolResult.JSON_PROPERTY_RESULT, + LLMObsInferenceToolResult.JSON_PROPERTY_TOOL_ID, + LLMObsInferenceToolResult.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsInferenceToolResult { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RESULT = "result"; + private String result; + + public static final String JSON_PROPERTY_TOOL_ID = "tool_id"; + private String toolId; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public LLMObsInferenceToolResult name(String name) { + this.name = name; + return this; + } + + /** + * The name of the tool that produced this result. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public LLMObsInferenceToolResult result(String result) { + this.result = result; + return this; + } + + /** + * The result content returned by the tool. + * + * @return result + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result; + } + + public LLMObsInferenceToolResult toolId(String toolId) { + this.toolId = toolId; + return this; + } + + /** + * Identifier matching the corresponding tool call. + * + * @return toolId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOOL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getToolId() { + return toolId; + } + + public void setToolId(String toolId) { + this.toolId = toolId; + } + + public LLMObsInferenceToolResult type(String type) { + this.type = type; + return this; + } + + /** + * The type of tool result. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsInferenceToolResult + */ + @JsonAnySetter + public LLMObsInferenceToolResult putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsInferenceToolResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsInferenceToolResult llmObsInferenceToolResult = (LLMObsInferenceToolResult) o; + return Objects.equals(this.name, llmObsInferenceToolResult.name) + && Objects.equals(this.result, llmObsInferenceToolResult.result) + && Objects.equals(this.toolId, llmObsInferenceToolResult.toolId) + && Objects.equals(this.type, llmObsInferenceToolResult.type) + && Objects.equals( + this.additionalProperties, llmObsInferenceToolResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, result, toolId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsInferenceToolResult {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" toolId: ").append(toIndentedString(toolId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationAccount.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationAccount.java new file mode 100644 index 00000000000..c70d76f2a92 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationAccount.java @@ -0,0 +1,323 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A configured account for an LLM provider integration. */ +@JsonPropertyOrder({ + LLMObsIntegrationAccount.JSON_PROPERTY_ACCOUNT_ID, + LLMObsIntegrationAccount.JSON_PROPERTY_ACCOUNT_NAME, + LLMObsIntegrationAccount.JSON_PROPERTY_ACCOUNT_REGION, + LLMObsIntegrationAccount.JSON_PROPERTY_AZURE_OPENAI_METADATA, + LLMObsIntegrationAccount.JSON_PROPERTY_ID, + LLMObsIntegrationAccount.JSON_PROPERTY_INTEGRATION, + LLMObsIntegrationAccount.JSON_PROPERTY_VERTEX_AI_METADATA +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsIntegrationAccount { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public static final String JSON_PROPERTY_ACCOUNT_NAME = "account_name"; + private String accountName; + + public static final String JSON_PROPERTY_ACCOUNT_REGION = "account_region"; + private String accountRegion; + + public static final String JSON_PROPERTY_AZURE_OPENAI_METADATA = "azure_openai_metadata"; + private LLMObsAzureOpenAIMetadata azureOpenaiMetadata; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_INTEGRATION = "integration"; + private String integration; + + public static final String JSON_PROPERTY_VERTEX_AI_METADATA = "vertex_ai_metadata"; + private LLMObsVertexAIMetadata vertexAiMetadata; + + public LLMObsIntegrationAccount() {} + + @JsonCreator + public LLMObsIntegrationAccount( + @JsonProperty(required = true, value = JSON_PROPERTY_ACCOUNT_ID) String accountId, + @JsonProperty(required = true, value = JSON_PROPERTY_ACCOUNT_NAME) String accountName, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_INTEGRATION) String integration) { + this.accountId = accountId; + this.accountName = accountName; + this.id = id; + this.integration = integration; + } + + public LLMObsIntegrationAccount accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Provider-specific account identifier. + * + * @return accountId + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public LLMObsIntegrationAccount accountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Human-readable name for the integration account. + * + * @return accountName + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public LLMObsIntegrationAccount accountRegion(String accountRegion) { + this.accountRegion = accountRegion; + return this; + } + + /** + * Provider region associated with the account, if applicable. + * + * @return accountRegion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_REGION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountRegion() { + return accountRegion; + } + + public void setAccountRegion(String accountRegion) { + this.accountRegion = accountRegion; + } + + public LLMObsIntegrationAccount azureOpenaiMetadata( + LLMObsAzureOpenAIMetadata azureOpenaiMetadata) { + this.azureOpenaiMetadata = azureOpenaiMetadata; + this.unparsed |= azureOpenaiMetadata.unparsed; + return this; + } + + /** + * Azure OpenAI-specific metadata for an integration account or inference request. + * + * @return azureOpenaiMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_OPENAI_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsAzureOpenAIMetadata getAzureOpenaiMetadata() { + return azureOpenaiMetadata; + } + + public void setAzureOpenaiMetadata(LLMObsAzureOpenAIMetadata azureOpenaiMetadata) { + this.azureOpenaiMetadata = azureOpenaiMetadata; + } + + public LLMObsIntegrationAccount id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the integration account. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public LLMObsIntegrationAccount integration(String integration) { + this.integration = integration; + return this; + } + + /** + * The name of the LLM provider integration. + * + * @return integration + */ + @JsonProperty(JSON_PROPERTY_INTEGRATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIntegration() { + return integration; + } + + public void setIntegration(String integration) { + this.integration = integration; + } + + public LLMObsIntegrationAccount vertexAiMetadata(LLMObsVertexAIMetadata vertexAiMetadata) { + this.vertexAiMetadata = vertexAiMetadata; + this.unparsed |= vertexAiMetadata.unparsed; + return this; + } + + /** + * Vertex AI-specific metadata for an integration account or inference request. + * + * @return vertexAiMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERTEX_AI_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsVertexAIMetadata getVertexAiMetadata() { + return vertexAiMetadata; + } + + public void setVertexAiMetadata(LLMObsVertexAIMetadata vertexAiMetadata) { + this.vertexAiMetadata = vertexAiMetadata; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsIntegrationAccount + */ + @JsonAnySetter + public LLMObsIntegrationAccount putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsIntegrationAccount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsIntegrationAccount llmObsIntegrationAccount = (LLMObsIntegrationAccount) o; + return Objects.equals(this.accountId, llmObsIntegrationAccount.accountId) + && Objects.equals(this.accountName, llmObsIntegrationAccount.accountName) + && Objects.equals(this.accountRegion, llmObsIntegrationAccount.accountRegion) + && Objects.equals(this.azureOpenaiMetadata, llmObsIntegrationAccount.azureOpenaiMetadata) + && Objects.equals(this.id, llmObsIntegrationAccount.id) + && Objects.equals(this.integration, llmObsIntegrationAccount.integration) + && Objects.equals(this.vertexAiMetadata, llmObsIntegrationAccount.vertexAiMetadata) + && Objects.equals(this.additionalProperties, llmObsIntegrationAccount.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + accountId, + accountName, + accountRegion, + azureOpenaiMetadata, + id, + integration, + vertexAiMetadata, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsIntegrationAccount {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); + sb.append(" accountRegion: ").append(toIndentedString(accountRegion)).append("\n"); + sb.append(" azureOpenaiMetadata: ") + .append(toIndentedString(azureOpenaiMetadata)) + .append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" integration: ").append(toIndentedString(integration)).append("\n"); + sb.append(" vertexAiMetadata: ").append(toIndentedString(vertexAiMetadata)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationInferenceRequest.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationInferenceRequest.java new file mode 100644 index 00000000000..173ef1e0b4c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationInferenceRequest.java @@ -0,0 +1,690 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Parameters for an LLM inference request. */ +@JsonPropertyOrder({ + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_ANTHROPIC_METADATA, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_AZURE_OPENAI_METADATA, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_BEDROCK_METADATA, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_FREQUENCY_PENALTY, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_JSON_SCHEMA, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_MAX_COMPLETION_TOKENS, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_MAX_TOKENS, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_MESSAGES, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_MODEL_ID, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_OPENAI_METADATA, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_PRESENCE_PENALTY, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_TEMPERATURE, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_TOOLS, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_TOP_K, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_TOP_P, + LLMObsIntegrationInferenceRequest.JSON_PROPERTY_VERTEX_AI_METADATA +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsIntegrationInferenceRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANTHROPIC_METADATA = "anthropic_metadata"; + private LLMObsAnthropicMetadata anthropicMetadata; + + public static final String JSON_PROPERTY_AZURE_OPENAI_METADATA = "azure_openai_metadata"; + private LLMObsAzureOpenAIMetadata azureOpenaiMetadata; + + public static final String JSON_PROPERTY_BEDROCK_METADATA = "bedrock_metadata"; + private LLMObsBedrockMetadata bedrockMetadata; + + public static final String JSON_PROPERTY_FREQUENCY_PENALTY = "frequency_penalty"; + private JsonNullable frequencyPenalty = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_JSON_SCHEMA = "json_schema"; + private JsonNullable jsonSchema = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MAX_COMPLETION_TOKENS = "max_completion_tokens"; + private JsonNullable maxCompletionTokens = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MAX_TOKENS = "max_tokens"; + private JsonNullable maxTokens = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MESSAGES = "messages"; + private List messages = new ArrayList<>(); + + public static final String JSON_PROPERTY_MODEL_ID = "model_id"; + private String modelId; + + public static final String JSON_PROPERTY_OPENAI_METADATA = "openai_metadata"; + private LLMObsOpenAIMetadata openaiMetadata; + + public static final String JSON_PROPERTY_PRESENCE_PENALTY = "presence_penalty"; + private JsonNullable presencePenalty = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TEMPERATURE = "temperature"; + private JsonNullable temperature = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TOOLS = "tools"; + private List tools = null; + + public static final String JSON_PROPERTY_TOP_K = "top_k"; + private JsonNullable topK = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TOP_P = "top_p"; + private JsonNullable topP = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_VERTEX_AI_METADATA = "vertex_ai_metadata"; + private LLMObsVertexAIMetadata vertexAiMetadata; + + public LLMObsIntegrationInferenceRequest() {} + + @JsonCreator + public LLMObsIntegrationInferenceRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_MESSAGES) + List messages, + @JsonProperty(required = true, value = JSON_PROPERTY_MODEL_ID) String modelId) { + this.messages = messages; + this.modelId = modelId; + } + + public LLMObsIntegrationInferenceRequest anthropicMetadata( + LLMObsAnthropicMetadata anthropicMetadata) { + this.anthropicMetadata = anthropicMetadata; + this.unparsed |= anthropicMetadata.unparsed; + return this; + } + + /** + * Anthropic-specific metadata for an inference request. + * + * @return anthropicMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ANTHROPIC_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsAnthropicMetadata getAnthropicMetadata() { + return anthropicMetadata; + } + + public void setAnthropicMetadata(LLMObsAnthropicMetadata anthropicMetadata) { + this.anthropicMetadata = anthropicMetadata; + } + + public LLMObsIntegrationInferenceRequest azureOpenaiMetadata( + LLMObsAzureOpenAIMetadata azureOpenaiMetadata) { + this.azureOpenaiMetadata = azureOpenaiMetadata; + this.unparsed |= azureOpenaiMetadata.unparsed; + return this; + } + + /** + * Azure OpenAI-specific metadata for an integration account or inference request. + * + * @return azureOpenaiMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_OPENAI_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsAzureOpenAIMetadata getAzureOpenaiMetadata() { + return azureOpenaiMetadata; + } + + public void setAzureOpenaiMetadata(LLMObsAzureOpenAIMetadata azureOpenaiMetadata) { + this.azureOpenaiMetadata = azureOpenaiMetadata; + } + + public LLMObsIntegrationInferenceRequest bedrockMetadata(LLMObsBedrockMetadata bedrockMetadata) { + this.bedrockMetadata = bedrockMetadata; + this.unparsed |= bedrockMetadata.unparsed; + return this; + } + + /** + * Amazon Bedrock-specific metadata for an inference request. + * + * @return bedrockMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BEDROCK_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsBedrockMetadata getBedrockMetadata() { + return bedrockMetadata; + } + + public void setBedrockMetadata(LLMObsBedrockMetadata bedrockMetadata) { + this.bedrockMetadata = bedrockMetadata; + } + + public LLMObsIntegrationInferenceRequest frequencyPenalty(Double frequencyPenalty) { + this.frequencyPenalty = JsonNullable.of(frequencyPenalty); + return this; + } + + /** + * Penalty for token frequency to reduce repetition. + * + * @return frequencyPenalty + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getFrequencyPenalty() { + return frequencyPenalty.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_FREQUENCY_PENALTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getFrequencyPenalty_JsonNullable() { + return frequencyPenalty; + } + + @JsonProperty(JSON_PROPERTY_FREQUENCY_PENALTY) + public void setFrequencyPenalty_JsonNullable(JsonNullable frequencyPenalty) { + this.frequencyPenalty = frequencyPenalty; + } + + public void setFrequencyPenalty(Double frequencyPenalty) { + this.frequencyPenalty = JsonNullable.of(frequencyPenalty); + } + + public LLMObsIntegrationInferenceRequest jsonSchema(String jsonSchema) { + this.jsonSchema = JsonNullable.of(jsonSchema); + return this; + } + + /** + * JSON schema for structured output, if supported by the model. + * + * @return jsonSchema + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getJsonSchema() { + return jsonSchema.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_JSON_SCHEMA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getJsonSchema_JsonNullable() { + return jsonSchema; + } + + @JsonProperty(JSON_PROPERTY_JSON_SCHEMA) + public void setJsonSchema_JsonNullable(JsonNullable jsonSchema) { + this.jsonSchema = jsonSchema; + } + + public void setJsonSchema(String jsonSchema) { + this.jsonSchema = JsonNullable.of(jsonSchema); + } + + public LLMObsIntegrationInferenceRequest maxCompletionTokens(Long maxCompletionTokens) { + this.maxCompletionTokens = JsonNullable.of(maxCompletionTokens); + return this; + } + + /** + * Maximum number of completion tokens to generate (alternative to max_tokens for some providers). + * + * @return maxCompletionTokens + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getMaxCompletionTokens() { + return maxCompletionTokens.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MAX_COMPLETION_TOKENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getMaxCompletionTokens_JsonNullable() { + return maxCompletionTokens; + } + + @JsonProperty(JSON_PROPERTY_MAX_COMPLETION_TOKENS) + public void setMaxCompletionTokens_JsonNullable(JsonNullable maxCompletionTokens) { + this.maxCompletionTokens = maxCompletionTokens; + } + + public void setMaxCompletionTokens(Long maxCompletionTokens) { + this.maxCompletionTokens = JsonNullable.of(maxCompletionTokens); + } + + public LLMObsIntegrationInferenceRequest maxTokens(Long maxTokens) { + this.maxTokens = JsonNullable.of(maxTokens); + return this; + } + + /** + * Maximum number of tokens to generate. + * + * @return maxTokens + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getMaxTokens() { + return maxTokens.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MAX_TOKENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getMaxTokens_JsonNullable() { + return maxTokens; + } + + @JsonProperty(JSON_PROPERTY_MAX_TOKENS) + public void setMaxTokens_JsonNullable(JsonNullable maxTokens) { + this.maxTokens = maxTokens; + } + + public void setMaxTokens(Long maxTokens) { + this.maxTokens = JsonNullable.of(maxTokens); + } + + public LLMObsIntegrationInferenceRequest messages(List messages) { + this.messages = messages; + for (LLMObsInferenceMessage item : messages) { + this.unparsed |= item.unparsed; + } + return this; + } + + public LLMObsIntegrationInferenceRequest addMessagesItem(LLMObsInferenceMessage messagesItem) { + this.messages.add(messagesItem); + this.unparsed |= messagesItem.unparsed; + return this; + } + + /** + * List of messages in an inference conversation. + * + * @return messages + */ + @JsonProperty(JSON_PROPERTY_MESSAGES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getMessages() { + return messages; + } + + public void setMessages(List messages) { + this.messages = messages; + } + + public LLMObsIntegrationInferenceRequest modelId(String modelId) { + this.modelId = modelId; + return this; + } + + /** + * The model identifier to use for inference. + * + * @return modelId + */ + @JsonProperty(JSON_PROPERTY_MODEL_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getModelId() { + return modelId; + } + + public void setModelId(String modelId) { + this.modelId = modelId; + } + + public LLMObsIntegrationInferenceRequest openaiMetadata(LLMObsOpenAIMetadata openaiMetadata) { + this.openaiMetadata = openaiMetadata; + this.unparsed |= openaiMetadata.unparsed; + return this; + } + + /** + * OpenAI-specific metadata for an inference request. + * + * @return openaiMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPENAI_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsOpenAIMetadata getOpenaiMetadata() { + return openaiMetadata; + } + + public void setOpenaiMetadata(LLMObsOpenAIMetadata openaiMetadata) { + this.openaiMetadata = openaiMetadata; + } + + public LLMObsIntegrationInferenceRequest presencePenalty(Double presencePenalty) { + this.presencePenalty = JsonNullable.of(presencePenalty); + return this; + } + + /** + * Penalty for token presence to encourage topic diversity. + * + * @return presencePenalty + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getPresencePenalty() { + return presencePenalty.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PRESENCE_PENALTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPresencePenalty_JsonNullable() { + return presencePenalty; + } + + @JsonProperty(JSON_PROPERTY_PRESENCE_PENALTY) + public void setPresencePenalty_JsonNullable(JsonNullable presencePenalty) { + this.presencePenalty = presencePenalty; + } + + public void setPresencePenalty(Double presencePenalty) { + this.presencePenalty = JsonNullable.of(presencePenalty); + } + + public LLMObsIntegrationInferenceRequest temperature(Double temperature) { + this.temperature = JsonNullable.of(temperature); + return this; + } + + /** + * Sampling temperature between 0 and 2. Higher values produce more random output. + * + * @return temperature + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getTemperature() { + return temperature.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TEMPERATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getTemperature_JsonNullable() { + return temperature; + } + + @JsonProperty(JSON_PROPERTY_TEMPERATURE) + public void setTemperature_JsonNullable(JsonNullable temperature) { + this.temperature = temperature; + } + + public void setTemperature(Double temperature) { + this.temperature = JsonNullable.of(temperature); + } + + public LLMObsIntegrationInferenceRequest tools(List tools) { + this.tools = tools; + for (LLMObsInferenceTool item : tools) { + this.unparsed |= item.unparsed; + } + return this; + } + + public LLMObsIntegrationInferenceRequest addToolsItem(LLMObsInferenceTool toolsItem) { + if (this.tools == null) { + this.tools = new ArrayList<>(); + } + this.tools.add(toolsItem); + this.unparsed |= toolsItem.unparsed; + return this; + } + + /** + * List of tools available to the model. + * + * @return tools + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTools() { + return tools; + } + + public void setTools(List tools) { + this.tools = tools; + } + + public LLMObsIntegrationInferenceRequest topK(Long topK) { + this.topK = JsonNullable.of(topK); + return this; + } + + /** + * Top-K sampling parameter. + * + * @return topK + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getTopK() { + return topK.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TOP_K) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getTopK_JsonNullable() { + return topK; + } + + @JsonProperty(JSON_PROPERTY_TOP_K) + public void setTopK_JsonNullable(JsonNullable topK) { + this.topK = topK; + } + + public void setTopK(Long topK) { + this.topK = JsonNullable.of(topK); + } + + public LLMObsIntegrationInferenceRequest topP(Double topP) { + this.topP = JsonNullable.of(topP); + return this; + } + + /** + * Nucleus sampling probability mass. + * + * @return topP + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getTopP() { + return topP.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TOP_P) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getTopP_JsonNullable() { + return topP; + } + + @JsonProperty(JSON_PROPERTY_TOP_P) + public void setTopP_JsonNullable(JsonNullable topP) { + this.topP = topP; + } + + public void setTopP(Double topP) { + this.topP = JsonNullable.of(topP); + } + + public LLMObsIntegrationInferenceRequest vertexAiMetadata( + LLMObsVertexAIMetadata vertexAiMetadata) { + this.vertexAiMetadata = vertexAiMetadata; + this.unparsed |= vertexAiMetadata.unparsed; + return this; + } + + /** + * Vertex AI-specific metadata for an integration account or inference request. + * + * @return vertexAiMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERTEX_AI_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsVertexAIMetadata getVertexAiMetadata() { + return vertexAiMetadata; + } + + public void setVertexAiMetadata(LLMObsVertexAIMetadata vertexAiMetadata) { + this.vertexAiMetadata = vertexAiMetadata; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsIntegrationInferenceRequest + */ + @JsonAnySetter + public LLMObsIntegrationInferenceRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsIntegrationInferenceRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsIntegrationInferenceRequest llmObsIntegrationInferenceRequest = + (LLMObsIntegrationInferenceRequest) o; + return Objects.equals( + this.anthropicMetadata, llmObsIntegrationInferenceRequest.anthropicMetadata) + && Objects.equals( + this.azureOpenaiMetadata, llmObsIntegrationInferenceRequest.azureOpenaiMetadata) + && Objects.equals(this.bedrockMetadata, llmObsIntegrationInferenceRequest.bedrockMetadata) + && Objects.equals(this.frequencyPenalty, llmObsIntegrationInferenceRequest.frequencyPenalty) + && Objects.equals(this.jsonSchema, llmObsIntegrationInferenceRequest.jsonSchema) + && Objects.equals( + this.maxCompletionTokens, llmObsIntegrationInferenceRequest.maxCompletionTokens) + && Objects.equals(this.maxTokens, llmObsIntegrationInferenceRequest.maxTokens) + && Objects.equals(this.messages, llmObsIntegrationInferenceRequest.messages) + && Objects.equals(this.modelId, llmObsIntegrationInferenceRequest.modelId) + && Objects.equals(this.openaiMetadata, llmObsIntegrationInferenceRequest.openaiMetadata) + && Objects.equals(this.presencePenalty, llmObsIntegrationInferenceRequest.presencePenalty) + && Objects.equals(this.temperature, llmObsIntegrationInferenceRequest.temperature) + && Objects.equals(this.tools, llmObsIntegrationInferenceRequest.tools) + && Objects.equals(this.topK, llmObsIntegrationInferenceRequest.topK) + && Objects.equals(this.topP, llmObsIntegrationInferenceRequest.topP) + && Objects.equals(this.vertexAiMetadata, llmObsIntegrationInferenceRequest.vertexAiMetadata) + && Objects.equals( + this.additionalProperties, llmObsIntegrationInferenceRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + anthropicMetadata, + azureOpenaiMetadata, + bedrockMetadata, + frequencyPenalty, + jsonSchema, + maxCompletionTokens, + maxTokens, + messages, + modelId, + openaiMetadata, + presencePenalty, + temperature, + tools, + topK, + topP, + vertexAiMetadata, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsIntegrationInferenceRequest {\n"); + sb.append(" anthropicMetadata: ").append(toIndentedString(anthropicMetadata)).append("\n"); + sb.append(" azureOpenaiMetadata: ") + .append(toIndentedString(azureOpenaiMetadata)) + .append("\n"); + sb.append(" bedrockMetadata: ").append(toIndentedString(bedrockMetadata)).append("\n"); + sb.append(" frequencyPenalty: ").append(toIndentedString(frequencyPenalty)).append("\n"); + sb.append(" jsonSchema: ").append(toIndentedString(jsonSchema)).append("\n"); + sb.append(" maxCompletionTokens: ") + .append(toIndentedString(maxCompletionTokens)) + .append("\n"); + sb.append(" maxTokens: ").append(toIndentedString(maxTokens)).append("\n"); + sb.append(" messages: ").append(toIndentedString(messages)).append("\n"); + sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); + sb.append(" openaiMetadata: ").append(toIndentedString(openaiMetadata)).append("\n"); + sb.append(" presencePenalty: ").append(toIndentedString(presencePenalty)).append("\n"); + sb.append(" temperature: ").append(toIndentedString(temperature)).append("\n"); + sb.append(" tools: ").append(toIndentedString(tools)).append("\n"); + sb.append(" topK: ").append(toIndentedString(topK)).append("\n"); + sb.append(" topP: ").append(toIndentedString(topP)).append("\n"); + sb.append(" vertexAiMetadata: ").append(toIndentedString(vertexAiMetadata)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationInferenceResponse.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationInferenceResponse.java new file mode 100644 index 00000000000..f2e8d364a0a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationInferenceResponse.java @@ -0,0 +1,754 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** The result of an LLM inference request, including input parameters and the model response. */ +@JsonPropertyOrder({ + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_ANTHROPIC_METADATA, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_AZURE_OPENAI_METADATA, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_BEDROCK_METADATA, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_ERROR_RESPONSE, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_FREQUENCY_PENALTY, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_JSON_SCHEMA, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_MAX_COMPLETION_TOKENS, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_MAX_TOKENS, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_MESSAGES, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_MODEL_ID, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_OPENAI_METADATA, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_PRESENCE_PENALTY, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_RESPONSE, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_TEMPERATURE, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_TOOLS, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_TOP_K, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_TOP_P, + LLMObsIntegrationInferenceResponse.JSON_PROPERTY_VERTEX_AI_METADATA +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsIntegrationInferenceResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANTHROPIC_METADATA = "anthropic_metadata"; + private LLMObsAnthropicMetadata anthropicMetadata; + + public static final String JSON_PROPERTY_AZURE_OPENAI_METADATA = "azure_openai_metadata"; + private LLMObsAzureOpenAIMetadata azureOpenaiMetadata; + + public static final String JSON_PROPERTY_BEDROCK_METADATA = "bedrock_metadata"; + private LLMObsBedrockMetadata bedrockMetadata; + + public static final String JSON_PROPERTY_ERROR_RESPONSE = "error_response"; + private LLMObsInferenceErrorResponse errorResponse; + + public static final String JSON_PROPERTY_FREQUENCY_PENALTY = "frequency_penalty"; + private JsonNullable frequencyPenalty = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_JSON_SCHEMA = "json_schema"; + private JsonNullable jsonSchema = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MAX_COMPLETION_TOKENS = "max_completion_tokens"; + private JsonNullable maxCompletionTokens = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MAX_TOKENS = "max_tokens"; + private JsonNullable maxTokens = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MESSAGES = "messages"; + private List messages = new ArrayList<>(); + + public static final String JSON_PROPERTY_MODEL_ID = "model_id"; + private String modelId; + + public static final String JSON_PROPERTY_OPENAI_METADATA = "openai_metadata"; + private LLMObsOpenAIMetadata openaiMetadata; + + public static final String JSON_PROPERTY_PRESENCE_PENALTY = "presence_penalty"; + private JsonNullable presencePenalty = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_RESPONSE = "response"; + private LLMObsInferenceRunResult response; + + public static final String JSON_PROPERTY_TEMPERATURE = "temperature"; + private JsonNullable temperature = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TOOLS = "tools"; + private List tools = null; + + public static final String JSON_PROPERTY_TOP_K = "top_k"; + private JsonNullable topK = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TOP_P = "top_p"; + private JsonNullable topP = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_VERTEX_AI_METADATA = "vertex_ai_metadata"; + private LLMObsVertexAIMetadata vertexAiMetadata; + + public LLMObsIntegrationInferenceResponse() {} + + @JsonCreator + public LLMObsIntegrationInferenceResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_MESSAGES) + List messages, + @JsonProperty(required = true, value = JSON_PROPERTY_MODEL_ID) String modelId, + @JsonProperty(required = true, value = JSON_PROPERTY_RESPONSE) + LLMObsInferenceRunResult response) { + this.messages = messages; + this.modelId = modelId; + this.response = response; + this.unparsed |= response.unparsed; + } + + public LLMObsIntegrationInferenceResponse anthropicMetadata( + LLMObsAnthropicMetadata anthropicMetadata) { + this.anthropicMetadata = anthropicMetadata; + this.unparsed |= anthropicMetadata.unparsed; + return this; + } + + /** + * Anthropic-specific metadata for an inference request. + * + * @return anthropicMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ANTHROPIC_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsAnthropicMetadata getAnthropicMetadata() { + return anthropicMetadata; + } + + public void setAnthropicMetadata(LLMObsAnthropicMetadata anthropicMetadata) { + this.anthropicMetadata = anthropicMetadata; + } + + public LLMObsIntegrationInferenceResponse azureOpenaiMetadata( + LLMObsAzureOpenAIMetadata azureOpenaiMetadata) { + this.azureOpenaiMetadata = azureOpenaiMetadata; + this.unparsed |= azureOpenaiMetadata.unparsed; + return this; + } + + /** + * Azure OpenAI-specific metadata for an integration account or inference request. + * + * @return azureOpenaiMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_OPENAI_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsAzureOpenAIMetadata getAzureOpenaiMetadata() { + return azureOpenaiMetadata; + } + + public void setAzureOpenaiMetadata(LLMObsAzureOpenAIMetadata azureOpenaiMetadata) { + this.azureOpenaiMetadata = azureOpenaiMetadata; + } + + public LLMObsIntegrationInferenceResponse bedrockMetadata(LLMObsBedrockMetadata bedrockMetadata) { + this.bedrockMetadata = bedrockMetadata; + this.unparsed |= bedrockMetadata.unparsed; + return this; + } + + /** + * Amazon Bedrock-specific metadata for an inference request. + * + * @return bedrockMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BEDROCK_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsBedrockMetadata getBedrockMetadata() { + return bedrockMetadata; + } + + public void setBedrockMetadata(LLMObsBedrockMetadata bedrockMetadata) { + this.bedrockMetadata = bedrockMetadata; + } + + public LLMObsIntegrationInferenceResponse errorResponse( + LLMObsInferenceErrorResponse errorResponse) { + this.errorResponse = errorResponse; + this.unparsed |= errorResponse.unparsed; + return this; + } + + /** + * Error details returned when an inference provider returns an error. + * + * @return errorResponse + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsInferenceErrorResponse getErrorResponse() { + return errorResponse; + } + + public void setErrorResponse(LLMObsInferenceErrorResponse errorResponse) { + this.errorResponse = errorResponse; + } + + public LLMObsIntegrationInferenceResponse frequencyPenalty(Double frequencyPenalty) { + this.frequencyPenalty = JsonNullable.of(frequencyPenalty); + return this; + } + + /** + * Frequency penalty that was applied. + * + * @return frequencyPenalty + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getFrequencyPenalty() { + return frequencyPenalty.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_FREQUENCY_PENALTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getFrequencyPenalty_JsonNullable() { + return frequencyPenalty; + } + + @JsonProperty(JSON_PROPERTY_FREQUENCY_PENALTY) + public void setFrequencyPenalty_JsonNullable(JsonNullable frequencyPenalty) { + this.frequencyPenalty = frequencyPenalty; + } + + public void setFrequencyPenalty(Double frequencyPenalty) { + this.frequencyPenalty = JsonNullable.of(frequencyPenalty); + } + + public LLMObsIntegrationInferenceResponse jsonSchema(String jsonSchema) { + this.jsonSchema = JsonNullable.of(jsonSchema); + return this; + } + + /** + * JSON schema that was applied for structured output. + * + * @return jsonSchema + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getJsonSchema() { + return jsonSchema.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_JSON_SCHEMA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getJsonSchema_JsonNullable() { + return jsonSchema; + } + + @JsonProperty(JSON_PROPERTY_JSON_SCHEMA) + public void setJsonSchema_JsonNullable(JsonNullable jsonSchema) { + this.jsonSchema = jsonSchema; + } + + public void setJsonSchema(String jsonSchema) { + this.jsonSchema = JsonNullable.of(jsonSchema); + } + + public LLMObsIntegrationInferenceResponse maxCompletionTokens(Long maxCompletionTokens) { + this.maxCompletionTokens = JsonNullable.of(maxCompletionTokens); + return this; + } + + /** + * Maximum number of completion tokens that were configured. + * + * @return maxCompletionTokens + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getMaxCompletionTokens() { + return maxCompletionTokens.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MAX_COMPLETION_TOKENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getMaxCompletionTokens_JsonNullable() { + return maxCompletionTokens; + } + + @JsonProperty(JSON_PROPERTY_MAX_COMPLETION_TOKENS) + public void setMaxCompletionTokens_JsonNullable(JsonNullable maxCompletionTokens) { + this.maxCompletionTokens = maxCompletionTokens; + } + + public void setMaxCompletionTokens(Long maxCompletionTokens) { + this.maxCompletionTokens = JsonNullable.of(maxCompletionTokens); + } + + public LLMObsIntegrationInferenceResponse maxTokens(Long maxTokens) { + this.maxTokens = JsonNullable.of(maxTokens); + return this; + } + + /** + * Maximum number of tokens that were configured. + * + * @return maxTokens + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getMaxTokens() { + return maxTokens.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MAX_TOKENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getMaxTokens_JsonNullable() { + return maxTokens; + } + + @JsonProperty(JSON_PROPERTY_MAX_TOKENS) + public void setMaxTokens_JsonNullable(JsonNullable maxTokens) { + this.maxTokens = maxTokens; + } + + public void setMaxTokens(Long maxTokens) { + this.maxTokens = JsonNullable.of(maxTokens); + } + + public LLMObsIntegrationInferenceResponse messages(List messages) { + this.messages = messages; + for (LLMObsInferenceMessage item : messages) { + this.unparsed |= item.unparsed; + } + return this; + } + + public LLMObsIntegrationInferenceResponse addMessagesItem(LLMObsInferenceMessage messagesItem) { + this.messages.add(messagesItem); + this.unparsed |= messagesItem.unparsed; + return this; + } + + /** + * List of messages in an inference conversation. + * + * @return messages + */ + @JsonProperty(JSON_PROPERTY_MESSAGES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getMessages() { + return messages; + } + + public void setMessages(List messages) { + this.messages = messages; + } + + public LLMObsIntegrationInferenceResponse modelId(String modelId) { + this.modelId = modelId; + return this; + } + + /** + * The model identifier used for inference. + * + * @return modelId + */ + @JsonProperty(JSON_PROPERTY_MODEL_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getModelId() { + return modelId; + } + + public void setModelId(String modelId) { + this.modelId = modelId; + } + + public LLMObsIntegrationInferenceResponse openaiMetadata(LLMObsOpenAIMetadata openaiMetadata) { + this.openaiMetadata = openaiMetadata; + this.unparsed |= openaiMetadata.unparsed; + return this; + } + + /** + * OpenAI-specific metadata for an inference request. + * + * @return openaiMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPENAI_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsOpenAIMetadata getOpenaiMetadata() { + return openaiMetadata; + } + + public void setOpenaiMetadata(LLMObsOpenAIMetadata openaiMetadata) { + this.openaiMetadata = openaiMetadata; + } + + public LLMObsIntegrationInferenceResponse presencePenalty(Double presencePenalty) { + this.presencePenalty = JsonNullable.of(presencePenalty); + return this; + } + + /** + * Presence penalty that was applied. + * + * @return presencePenalty + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getPresencePenalty() { + return presencePenalty.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PRESENCE_PENALTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPresencePenalty_JsonNullable() { + return presencePenalty; + } + + @JsonProperty(JSON_PROPERTY_PRESENCE_PENALTY) + public void setPresencePenalty_JsonNullable(JsonNullable presencePenalty) { + this.presencePenalty = presencePenalty; + } + + public void setPresencePenalty(Double presencePenalty) { + this.presencePenalty = JsonNullable.of(presencePenalty); + } + + public LLMObsIntegrationInferenceResponse response(LLMObsInferenceRunResult response) { + this.response = response; + this.unparsed |= response.unparsed; + return this; + } + + /** + * The output of a completed LLM inference call. + * + * @return response + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsInferenceRunResult getResponse() { + return response; + } + + public void setResponse(LLMObsInferenceRunResult response) { + this.response = response; + } + + public LLMObsIntegrationInferenceResponse temperature(Double temperature) { + this.temperature = JsonNullable.of(temperature); + return this; + } + + /** + * Sampling temperature that was used. + * + * @return temperature + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getTemperature() { + return temperature.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TEMPERATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getTemperature_JsonNullable() { + return temperature; + } + + @JsonProperty(JSON_PROPERTY_TEMPERATURE) + public void setTemperature_JsonNullable(JsonNullable temperature) { + this.temperature = temperature; + } + + public void setTemperature(Double temperature) { + this.temperature = JsonNullable.of(temperature); + } + + public LLMObsIntegrationInferenceResponse tools(List tools) { + this.tools = tools; + for (LLMObsInferenceTool item : tools) { + this.unparsed |= item.unparsed; + } + return this; + } + + public LLMObsIntegrationInferenceResponse addToolsItem(LLMObsInferenceTool toolsItem) { + if (this.tools == null) { + this.tools = new ArrayList<>(); + } + this.tools.add(toolsItem); + this.unparsed |= toolsItem.unparsed; + return this; + } + + /** + * List of tools available to the model. + * + * @return tools + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTools() { + return tools; + } + + public void setTools(List tools) { + this.tools = tools; + } + + public LLMObsIntegrationInferenceResponse topK(Long topK) { + this.topK = JsonNullable.of(topK); + return this; + } + + /** + * Top-K sampling parameter that was used. + * + * @return topK + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getTopK() { + return topK.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TOP_K) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getTopK_JsonNullable() { + return topK; + } + + @JsonProperty(JSON_PROPERTY_TOP_K) + public void setTopK_JsonNullable(JsonNullable topK) { + this.topK = topK; + } + + public void setTopK(Long topK) { + this.topK = JsonNullable.of(topK); + } + + public LLMObsIntegrationInferenceResponse topP(Double topP) { + this.topP = JsonNullable.of(topP); + return this; + } + + /** + * Nucleus sampling parameter that was used. + * + * @return topP + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getTopP() { + return topP.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TOP_P) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getTopP_JsonNullable() { + return topP; + } + + @JsonProperty(JSON_PROPERTY_TOP_P) + public void setTopP_JsonNullable(JsonNullable topP) { + this.topP = topP; + } + + public void setTopP(Double topP) { + this.topP = JsonNullable.of(topP); + } + + public LLMObsIntegrationInferenceResponse vertexAiMetadata( + LLMObsVertexAIMetadata vertexAiMetadata) { + this.vertexAiMetadata = vertexAiMetadata; + this.unparsed |= vertexAiMetadata.unparsed; + return this; + } + + /** + * Vertex AI-specific metadata for an integration account or inference request. + * + * @return vertexAiMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERTEX_AI_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsVertexAIMetadata getVertexAiMetadata() { + return vertexAiMetadata; + } + + public void setVertexAiMetadata(LLMObsVertexAIMetadata vertexAiMetadata) { + this.vertexAiMetadata = vertexAiMetadata; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsIntegrationInferenceResponse + */ + @JsonAnySetter + public LLMObsIntegrationInferenceResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsIntegrationInferenceResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsIntegrationInferenceResponse llmObsIntegrationInferenceResponse = + (LLMObsIntegrationInferenceResponse) o; + return Objects.equals( + this.anthropicMetadata, llmObsIntegrationInferenceResponse.anthropicMetadata) + && Objects.equals( + this.azureOpenaiMetadata, llmObsIntegrationInferenceResponse.azureOpenaiMetadata) + && Objects.equals(this.bedrockMetadata, llmObsIntegrationInferenceResponse.bedrockMetadata) + && Objects.equals(this.errorResponse, llmObsIntegrationInferenceResponse.errorResponse) + && Objects.equals( + this.frequencyPenalty, llmObsIntegrationInferenceResponse.frequencyPenalty) + && Objects.equals(this.jsonSchema, llmObsIntegrationInferenceResponse.jsonSchema) + && Objects.equals( + this.maxCompletionTokens, llmObsIntegrationInferenceResponse.maxCompletionTokens) + && Objects.equals(this.maxTokens, llmObsIntegrationInferenceResponse.maxTokens) + && Objects.equals(this.messages, llmObsIntegrationInferenceResponse.messages) + && Objects.equals(this.modelId, llmObsIntegrationInferenceResponse.modelId) + && Objects.equals(this.openaiMetadata, llmObsIntegrationInferenceResponse.openaiMetadata) + && Objects.equals(this.presencePenalty, llmObsIntegrationInferenceResponse.presencePenalty) + && Objects.equals(this.response, llmObsIntegrationInferenceResponse.response) + && Objects.equals(this.temperature, llmObsIntegrationInferenceResponse.temperature) + && Objects.equals(this.tools, llmObsIntegrationInferenceResponse.tools) + && Objects.equals(this.topK, llmObsIntegrationInferenceResponse.topK) + && Objects.equals(this.topP, llmObsIntegrationInferenceResponse.topP) + && Objects.equals( + this.vertexAiMetadata, llmObsIntegrationInferenceResponse.vertexAiMetadata) + && Objects.equals( + this.additionalProperties, llmObsIntegrationInferenceResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + anthropicMetadata, + azureOpenaiMetadata, + bedrockMetadata, + errorResponse, + frequencyPenalty, + jsonSchema, + maxCompletionTokens, + maxTokens, + messages, + modelId, + openaiMetadata, + presencePenalty, + response, + temperature, + tools, + topK, + topP, + vertexAiMetadata, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsIntegrationInferenceResponse {\n"); + sb.append(" anthropicMetadata: ").append(toIndentedString(anthropicMetadata)).append("\n"); + sb.append(" azureOpenaiMetadata: ") + .append(toIndentedString(azureOpenaiMetadata)) + .append("\n"); + sb.append(" bedrockMetadata: ").append(toIndentedString(bedrockMetadata)).append("\n"); + sb.append(" errorResponse: ").append(toIndentedString(errorResponse)).append("\n"); + sb.append(" frequencyPenalty: ").append(toIndentedString(frequencyPenalty)).append("\n"); + sb.append(" jsonSchema: ").append(toIndentedString(jsonSchema)).append("\n"); + sb.append(" maxCompletionTokens: ") + .append(toIndentedString(maxCompletionTokens)) + .append("\n"); + sb.append(" maxTokens: ").append(toIndentedString(maxTokens)).append("\n"); + sb.append(" messages: ").append(toIndentedString(messages)).append("\n"); + sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); + sb.append(" openaiMetadata: ").append(toIndentedString(openaiMetadata)).append("\n"); + sb.append(" presencePenalty: ").append(toIndentedString(presencePenalty)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" temperature: ").append(toIndentedString(temperature)).append("\n"); + sb.append(" tools: ").append(toIndentedString(tools)).append("\n"); + sb.append(" topK: ").append(toIndentedString(topK)).append("\n"); + sb.append(" topP: ").append(toIndentedString(topP)).append("\n"); + sb.append(" vertexAiMetadata: ").append(toIndentedString(vertexAiMetadata)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationModel.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationModel.java new file mode 100644 index 00000000000..948a34ec4ce --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationModel.java @@ -0,0 +1,426 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A model available for a given LLM provider integration and account. */ +@JsonPropertyOrder({ + LLMObsIntegrationModel.JSON_PROPERTY_HAS_ACCESS, + LLMObsIntegrationModel.JSON_PROPERTY_ID, + LLMObsIntegrationModel.JSON_PROPERTY_INTEGRATION, + LLMObsIntegrationModel.JSON_PROPERTY_INTEGRATION_DISPLAY_NAME, + LLMObsIntegrationModel.JSON_PROPERTY_JSON_SCHEMA, + LLMObsIntegrationModel.JSON_PROPERTY_MODEL_DISPLAY_NAME, + LLMObsIntegrationModel.JSON_PROPERTY_MODEL_ID, + LLMObsIntegrationModel.JSON_PROPERTY_PROVIDER, + LLMObsIntegrationModel.JSON_PROPERTY_PROVIDER_DISPLAY_NAME, + LLMObsIntegrationModel.JSON_PROPERTY_REGION_PREFIX_OVERRIDES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsIntegrationModel { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HAS_ACCESS = "has_access"; + private Boolean hasAccess; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_INTEGRATION = "integration"; + private String integration; + + public static final String JSON_PROPERTY_INTEGRATION_DISPLAY_NAME = "integration_display_name"; + private String integrationDisplayName; + + public static final String JSON_PROPERTY_JSON_SCHEMA = "json_schema"; + private Boolean jsonSchema; + + public static final String JSON_PROPERTY_MODEL_DISPLAY_NAME = "model_display_name"; + private String modelDisplayName; + + public static final String JSON_PROPERTY_MODEL_ID = "model_id"; + private String modelId; + + public static final String JSON_PROPERTY_PROVIDER = "provider"; + private String provider; + + public static final String JSON_PROPERTY_PROVIDER_DISPLAY_NAME = "provider_display_name"; + private String providerDisplayName; + + public static final String JSON_PROPERTY_REGION_PREFIX_OVERRIDES = "region_prefix_overrides"; + private Map regionPrefixOverrides = null; + + public LLMObsIntegrationModel() {} + + @JsonCreator + public LLMObsIntegrationModel( + @JsonProperty(required = true, value = JSON_PROPERTY_HAS_ACCESS) Boolean hasAccess, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_INTEGRATION) String integration, + @JsonProperty(required = true, value = JSON_PROPERTY_INTEGRATION_DISPLAY_NAME) + String integrationDisplayName, + @JsonProperty(required = true, value = JSON_PROPERTY_JSON_SCHEMA) Boolean jsonSchema, + @JsonProperty(required = true, value = JSON_PROPERTY_MODEL_DISPLAY_NAME) + String modelDisplayName, + @JsonProperty(required = true, value = JSON_PROPERTY_MODEL_ID) String modelId, + @JsonProperty(required = true, value = JSON_PROPERTY_PROVIDER) String provider, + @JsonProperty(required = true, value = JSON_PROPERTY_PROVIDER_DISPLAY_NAME) + String providerDisplayName) { + this.hasAccess = hasAccess; + this.id = id; + this.integration = integration; + this.integrationDisplayName = integrationDisplayName; + this.jsonSchema = jsonSchema; + this.modelDisplayName = modelDisplayName; + this.modelId = modelId; + this.provider = provider; + this.providerDisplayName = providerDisplayName; + } + + public LLMObsIntegrationModel hasAccess(Boolean hasAccess) { + this.hasAccess = hasAccess; + return this; + } + + /** + * Whether the account has access to this model. + * + * @return hasAccess + */ + @JsonProperty(JSON_PROPERTY_HAS_ACCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getHasAccess() { + return hasAccess; + } + + public void setHasAccess(Boolean hasAccess) { + this.hasAccess = hasAccess; + } + + public LLMObsIntegrationModel id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the model entry. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public LLMObsIntegrationModel integration(String integration) { + this.integration = integration; + return this; + } + + /** + * The name of the LLM provider integration. + * + * @return integration + */ + @JsonProperty(JSON_PROPERTY_INTEGRATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIntegration() { + return integration; + } + + public void setIntegration(String integration) { + this.integration = integration; + } + + public LLMObsIntegrationModel integrationDisplayName(String integrationDisplayName) { + this.integrationDisplayName = integrationDisplayName; + return this; + } + + /** + * Human-readable name of the LLM provider integration. + * + * @return integrationDisplayName + */ + @JsonProperty(JSON_PROPERTY_INTEGRATION_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIntegrationDisplayName() { + return integrationDisplayName; + } + + public void setIntegrationDisplayName(String integrationDisplayName) { + this.integrationDisplayName = integrationDisplayName; + } + + public LLMObsIntegrationModel jsonSchema(Boolean jsonSchema) { + this.jsonSchema = jsonSchema; + return this; + } + + /** + * Whether the model supports structured output via JSON schema. + * + * @return jsonSchema + */ + @JsonProperty(JSON_PROPERTY_JSON_SCHEMA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getJsonSchema() { + return jsonSchema; + } + + public void setJsonSchema(Boolean jsonSchema) { + this.jsonSchema = jsonSchema; + } + + public LLMObsIntegrationModel modelDisplayName(String modelDisplayName) { + this.modelDisplayName = modelDisplayName; + return this; + } + + /** + * Human-readable model name. + * + * @return modelDisplayName + */ + @JsonProperty(JSON_PROPERTY_MODEL_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getModelDisplayName() { + return modelDisplayName; + } + + public void setModelDisplayName(String modelDisplayName) { + this.modelDisplayName = modelDisplayName; + } + + public LLMObsIntegrationModel modelId(String modelId) { + this.modelId = modelId; + return this; + } + + /** + * Provider-specific model identifier used in inference calls. + * + * @return modelId + */ + @JsonProperty(JSON_PROPERTY_MODEL_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getModelId() { + return modelId; + } + + public void setModelId(String modelId) { + this.modelId = modelId; + } + + public LLMObsIntegrationModel provider(String provider) { + this.provider = provider; + return this; + } + + /** + * The underlying model provider. + * + * @return provider + */ + @JsonProperty(JSON_PROPERTY_PROVIDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProvider() { + return provider; + } + + public void setProvider(String provider) { + this.provider = provider; + } + + public LLMObsIntegrationModel providerDisplayName(String providerDisplayName) { + this.providerDisplayName = providerDisplayName; + return this; + } + + /** + * Human-readable name of the underlying model provider. + * + * @return providerDisplayName + */ + @JsonProperty(JSON_PROPERTY_PROVIDER_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProviderDisplayName() { + return providerDisplayName; + } + + public void setProviderDisplayName(String providerDisplayName) { + this.providerDisplayName = providerDisplayName; + } + + public LLMObsIntegrationModel regionPrefixOverrides(Map regionPrefixOverrides) { + this.regionPrefixOverrides = regionPrefixOverrides; + return this; + } + + public LLMObsIntegrationModel putRegionPrefixOverridesItem( + String key, String regionPrefixOverridesItem) { + if (this.regionPrefixOverrides == null) { + this.regionPrefixOverrides = new HashMap<>(); + } + this.regionPrefixOverrides.put(key, regionPrefixOverridesItem); + return this; + } + + /** + * Map of region-specific model ID prefix overrides. + * + * @return regionPrefixOverrides + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REGION_PREFIX_OVERRIDES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getRegionPrefixOverrides() { + return regionPrefixOverrides; + } + + public void setRegionPrefixOverrides(Map regionPrefixOverrides) { + this.regionPrefixOverrides = regionPrefixOverrides; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsIntegrationModel + */ + @JsonAnySetter + public LLMObsIntegrationModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsIntegrationModel object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsIntegrationModel llmObsIntegrationModel = (LLMObsIntegrationModel) o; + return Objects.equals(this.hasAccess, llmObsIntegrationModel.hasAccess) + && Objects.equals(this.id, llmObsIntegrationModel.id) + && Objects.equals(this.integration, llmObsIntegrationModel.integration) + && Objects.equals( + this.integrationDisplayName, llmObsIntegrationModel.integrationDisplayName) + && Objects.equals(this.jsonSchema, llmObsIntegrationModel.jsonSchema) + && Objects.equals(this.modelDisplayName, llmObsIntegrationModel.modelDisplayName) + && Objects.equals(this.modelId, llmObsIntegrationModel.modelId) + && Objects.equals(this.provider, llmObsIntegrationModel.provider) + && Objects.equals(this.providerDisplayName, llmObsIntegrationModel.providerDisplayName) + && Objects.equals(this.regionPrefixOverrides, llmObsIntegrationModel.regionPrefixOverrides) + && Objects.equals(this.additionalProperties, llmObsIntegrationModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + hasAccess, + id, + integration, + integrationDisplayName, + jsonSchema, + modelDisplayName, + modelId, + provider, + providerDisplayName, + regionPrefixOverrides, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsIntegrationModel {\n"); + sb.append(" hasAccess: ").append(toIndentedString(hasAccess)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" integration: ").append(toIndentedString(integration)).append("\n"); + sb.append(" integrationDisplayName: ") + .append(toIndentedString(integrationDisplayName)) + .append("\n"); + sb.append(" jsonSchema: ").append(toIndentedString(jsonSchema)).append("\n"); + sb.append(" modelDisplayName: ").append(toIndentedString(modelDisplayName)).append("\n"); + sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" providerDisplayName: ") + .append(toIndentedString(providerDisplayName)) + .append("\n"); + sb.append(" regionPrefixOverrides: ") + .append(toIndentedString(regionPrefixOverrides)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationName.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationName.java new file mode 100644 index 00000000000..c808dff8ac6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsIntegrationName.java @@ -0,0 +1,64 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The name of a supported LLM provider integration. */ +@JsonSerialize(using = LLMObsIntegrationName.LLMObsIntegrationNameSerializer.class) +public class LLMObsIntegrationName extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "openai", "amazon_bedrock", "anthropic", "azure_openai", "vertex_ai", "llmproxy")); + + public static final LLMObsIntegrationName OPENAI = new LLMObsIntegrationName("openai"); + public static final LLMObsIntegrationName AMAZON_BEDROCK = + new LLMObsIntegrationName("amazon_bedrock"); + public static final LLMObsIntegrationName ANTHROPIC = new LLMObsIntegrationName("anthropic"); + public static final LLMObsIntegrationName AZURE_OPENAI = + new LLMObsIntegrationName("azure_openai"); + public static final LLMObsIntegrationName VERTEX_AI = new LLMObsIntegrationName("vertex_ai"); + public static final LLMObsIntegrationName LLMPROXY = new LLMObsIntegrationName("llmproxy"); + + LLMObsIntegrationName(String value) { + super(value, allowedValues); + } + + public static class LLMObsIntegrationNameSerializer extends StdSerializer { + public LLMObsIntegrationNameSerializer(Class t) { + super(t); + } + + public LLMObsIntegrationNameSerializer() { + this(null); + } + + @Override + public void serialize( + LLMObsIntegrationName value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static LLMObsIntegrationName fromValue(String value) { + return new LLMObsIntegrationName(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsInternalReasoning.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsInternalReasoning.java new file mode 100644 index 00000000000..1cddfde7b68 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsInternalReasoning.java @@ -0,0 +1,183 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** The model's internal reasoning or thinking output, if available. */ +@JsonPropertyOrder({ + LLMObsInternalReasoning.JSON_PROPERTY_REASONING_TOKENS, + LLMObsInternalReasoning.JSON_PROPERTY_TEXT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsInternalReasoning { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_REASONING_TOKENS = "reasoning_tokens"; + private JsonNullable reasoningTokens = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public LLMObsInternalReasoning() {} + + @JsonCreator + public LLMObsInternalReasoning( + @JsonProperty(required = true, value = JSON_PROPERTY_TEXT) String text) { + this.text = text; + } + + public LLMObsInternalReasoning reasoningTokens(Long reasoningTokens) { + this.reasoningTokens = JsonNullable.of(reasoningTokens); + return this; + } + + /** + * Number of tokens used for internal reasoning. + * + * @return reasoningTokens + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getReasoningTokens() { + return reasoningTokens.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_REASONING_TOKENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getReasoningTokens_JsonNullable() { + return reasoningTokens; + } + + @JsonProperty(JSON_PROPERTY_REASONING_TOKENS) + public void setReasoningTokens_JsonNullable(JsonNullable reasoningTokens) { + this.reasoningTokens = reasoningTokens; + } + + public void setReasoningTokens(Long reasoningTokens) { + this.reasoningTokens = JsonNullable.of(reasoningTokens); + } + + public LLMObsInternalReasoning text(String text) { + this.text = text; + return this; + } + + /** + * The reasoning text produced by the model. + * + * @return text + */ + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsInternalReasoning + */ + @JsonAnySetter + public LLMObsInternalReasoning putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsInternalReasoning object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsInternalReasoning llmObsInternalReasoning = (LLMObsInternalReasoning) o; + return Objects.equals(this.reasoningTokens, llmObsInternalReasoning.reasoningTokens) + && Objects.equals(this.text, llmObsInternalReasoning.text) + && Objects.equals(this.additionalProperties, llmObsInternalReasoning.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(reasoningTokens, text, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsInternalReasoning {\n"); + sb.append(" reasoningTokens: ").append(toIndentedString(reasoningTokens)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsOpenAIMetadata.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsOpenAIMetadata.java new file mode 100644 index 00000000000..3f3fd30b195 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsOpenAIMetadata.java @@ -0,0 +1,195 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** OpenAI-specific metadata for an inference request. */ +@JsonPropertyOrder({ + LLMObsOpenAIMetadata.JSON_PROPERTY_REASONING_EFFORT, + LLMObsOpenAIMetadata.JSON_PROPERTY_REASONING_SUMMARY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsOpenAIMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_REASONING_EFFORT = "reasoning_effort"; + private JsonNullable reasoningEffort = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_REASONING_SUMMARY = "reasoning_summary"; + private JsonNullable reasoningSummary = + JsonNullable.undefined(); + + public LLMObsOpenAIMetadata reasoningEffort(LLMObsOpenAIReasoningEffort reasoningEffort) { + this.reasoningEffort = JsonNullable.of(reasoningEffort); + return this; + } + + /** + * The reasoning effort level for OpenAI models that support it. + * + * @return reasoningEffort + */ + @jakarta.annotation.Nullable + @JsonIgnore + public LLMObsOpenAIReasoningEffort getReasoningEffort() { + return reasoningEffort.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_REASONING_EFFORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getReasoningEffort_JsonNullable() { + return reasoningEffort; + } + + @JsonProperty(JSON_PROPERTY_REASONING_EFFORT) + public void setReasoningEffort_JsonNullable( + JsonNullable reasoningEffort) { + this.reasoningEffort = reasoningEffort; + } + + public void setReasoningEffort(LLMObsOpenAIReasoningEffort reasoningEffort) { + if (!reasoningEffort.isValid()) { + this.unparsed = true; + } + this.reasoningEffort = JsonNullable.of(reasoningEffort); + } + + public LLMObsOpenAIMetadata reasoningSummary(LLMObsOpenAIReasoningSummary reasoningSummary) { + this.reasoningSummary = JsonNullable.of(reasoningSummary); + return this; + } + + /** + * The verbosity of the reasoning summary. + * + * @return reasoningSummary + */ + @jakarta.annotation.Nullable + @JsonIgnore + public LLMObsOpenAIReasoningSummary getReasoningSummary() { + return reasoningSummary.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_REASONING_SUMMARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getReasoningSummary_JsonNullable() { + return reasoningSummary; + } + + @JsonProperty(JSON_PROPERTY_REASONING_SUMMARY) + public void setReasoningSummary_JsonNullable( + JsonNullable reasoningSummary) { + this.reasoningSummary = reasoningSummary; + } + + public void setReasoningSummary(LLMObsOpenAIReasoningSummary reasoningSummary) { + if (!reasoningSummary.isValid()) { + this.unparsed = true; + } + this.reasoningSummary = JsonNullable.of(reasoningSummary); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsOpenAIMetadata + */ + @JsonAnySetter + public LLMObsOpenAIMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsOpenAIMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsOpenAIMetadata llmObsOpenAiMetadata = (LLMObsOpenAIMetadata) o; + return Objects.equals(this.reasoningEffort, llmObsOpenAiMetadata.reasoningEffort) + && Objects.equals(this.reasoningSummary, llmObsOpenAiMetadata.reasoningSummary) + && Objects.equals(this.additionalProperties, llmObsOpenAiMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(reasoningEffort, reasoningSummary, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsOpenAIMetadata {\n"); + sb.append(" reasoningEffort: ").append(toIndentedString(reasoningEffort)).append("\n"); + sb.append(" reasoningSummary: ").append(toIndentedString(reasoningSummary)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsOpenAIReasoningEffort.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsOpenAIReasoningEffort.java new file mode 100644 index 00000000000..76f9674cb02 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsOpenAIReasoningEffort.java @@ -0,0 +1,61 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The reasoning effort level for OpenAI models that support it. */ +@JsonSerialize(using = LLMObsOpenAIReasoningEffort.LLMObsOpenAIReasoningEffortSerializer.class) +public class LLMObsOpenAIReasoningEffort extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("none", "low", "medium", "high", "xhigh")); + + public static final LLMObsOpenAIReasoningEffort NONE = new LLMObsOpenAIReasoningEffort("none"); + public static final LLMObsOpenAIReasoningEffort LOW = new LLMObsOpenAIReasoningEffort("low"); + public static final LLMObsOpenAIReasoningEffort MEDIUM = + new LLMObsOpenAIReasoningEffort("medium"); + public static final LLMObsOpenAIReasoningEffort HIGH = new LLMObsOpenAIReasoningEffort("high"); + public static final LLMObsOpenAIReasoningEffort XHIGH = new LLMObsOpenAIReasoningEffort("xhigh"); + + LLMObsOpenAIReasoningEffort(String value) { + super(value, allowedValues); + } + + public static class LLMObsOpenAIReasoningEffortSerializer + extends StdSerializer { + public LLMObsOpenAIReasoningEffortSerializer(Class t) { + super(t); + } + + public LLMObsOpenAIReasoningEffortSerializer() { + this(null); + } + + @Override + public void serialize( + LLMObsOpenAIReasoningEffort value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static LLMObsOpenAIReasoningEffort fromValue(String value) { + return new LLMObsOpenAIReasoningEffort(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsOpenAIReasoningSummary.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsOpenAIReasoningSummary.java new file mode 100644 index 00000000000..fb8d35cd31c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsOpenAIReasoningSummary.java @@ -0,0 +1,60 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The verbosity of the reasoning summary. */ +@JsonSerialize(using = LLMObsOpenAIReasoningSummary.LLMObsOpenAIReasoningSummarySerializer.class) +public class LLMObsOpenAIReasoningSummary extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("auto", "concise", "detailed")); + + public static final LLMObsOpenAIReasoningSummary AUTO = new LLMObsOpenAIReasoningSummary("auto"); + public static final LLMObsOpenAIReasoningSummary CONCISE = + new LLMObsOpenAIReasoningSummary("concise"); + public static final LLMObsOpenAIReasoningSummary DETAILED = + new LLMObsOpenAIReasoningSummary("detailed"); + + LLMObsOpenAIReasoningSummary(String value) { + super(value, allowedValues); + } + + public static class LLMObsOpenAIReasoningSummarySerializer + extends StdSerializer { + public LLMObsOpenAIReasoningSummarySerializer(Class t) { + super(t); + } + + public LLMObsOpenAIReasoningSummarySerializer() { + this(null); + } + + @Override + public void serialize( + LLMObsOpenAIReasoningSummary value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static LLMObsOpenAIReasoningSummary fromValue(String value) { + return new LLMObsOpenAIReasoningSummary(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsVertexAIMetadata.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsVertexAIMetadata.java new file mode 100644 index 00000000000..f7cdd4d9133 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsVertexAIMetadata.java @@ -0,0 +1,201 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Vertex AI-specific metadata for an integration account or inference request. */ +@JsonPropertyOrder({ + LLMObsVertexAIMetadata.JSON_PROPERTY_LOCATION, + LLMObsVertexAIMetadata.JSON_PROPERTY_PROJECT, + LLMObsVertexAIMetadata.JSON_PROPERTY_PROJECT_IDS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsVertexAIMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_LOCATION = "location"; + private String location; + + public static final String JSON_PROPERTY_PROJECT = "project"; + private String project; + + public static final String JSON_PROPERTY_PROJECT_IDS = "project_ids"; + private List projectIds = null; + + public LLMObsVertexAIMetadata location(String location) { + this.location = location; + return this; + } + + /** + * The Vertex AI region. + * + * @return location + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public LLMObsVertexAIMetadata project(String project) { + this.project = project; + return this; + } + + /** + * The Google Cloud project ID. + * + * @return project + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProject() { + return project; + } + + public void setProject(String project) { + this.project = project; + } + + public LLMObsVertexAIMetadata projectIds(List projectIds) { + this.projectIds = projectIds; + return this; + } + + public LLMObsVertexAIMetadata addProjectIdsItem(String projectIdsItem) { + if (this.projectIds == null) { + this.projectIds = new ArrayList<>(); + } + this.projectIds.add(projectIdsItem); + return this; + } + + /** + * List of Google Cloud project IDs available to the service account. + * + * @return projectIds + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROJECT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getProjectIds() { + return projectIds; + } + + public void setProjectIds(List projectIds) { + this.projectIds = projectIds; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsVertexAIMetadata + */ + @JsonAnySetter + public LLMObsVertexAIMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsVertexAIMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsVertexAIMetadata llmObsVertexAiMetadata = (LLMObsVertexAIMetadata) o; + return Objects.equals(this.location, llmObsVertexAiMetadata.location) + && Objects.equals(this.project, llmObsVertexAiMetadata.project) + && Objects.equals(this.projectIds, llmObsVertexAiMetadata.projectIds) + && Objects.equals(this.additionalProperties, llmObsVertexAiMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(location, project, projectIds, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsVertexAIMetadata {\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).append("\n"); + sb.append(" projectIds: ").append(toIndentedString(projectIds)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/llm_observability.feature b/src/test/resources/com/datadog/api/client/v2/api/llm_observability.feature index ec671390145..0e1a7e984fa 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/llm_observability.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 02753f1a80a..9c1afc7d96b 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/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": {