/**
 * Converts internal message types to OTel GenAI JSON schema format.
 * @see https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-input-messages.json
 * @see https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-output-messages.json
 */
/**
 * Truncate a string to fit within OTel attribute size limits.
 * Returns the original string if within bounds, otherwise truncates with a suffix.
 *
 * @param value The string to truncate.
 * @param maxLength The maximum length in characters. A value of `0` (the
 * default) or any non-positive number disables truncation entirely, matching
 * the OTel spec's `AttributeValueLengthLimit` default of `Infinity` for string
 * attributes (see https://opentelemetry.io/docs/specs/otel/common/#attribute-limits).
 * Production call sites should pass `OTelConfig.maxAttributeSizeChars` so
 * users can configure truncation to match their backend's per-attribute limit.
 */
export declare function truncateForOTel(value: string, maxLength?: number): string;
export interface OTelChatMessage {
    role: string | undefined;
    parts: OTelMessagePart[];
}
export interface OTelOutputMessage extends OTelChatMessage {
    finish_reason?: string;
}
export type OTelMessagePart = {
    type: 'text';
    content: string;
} | {
    type: 'tool_call';
    id: string;
    name: string;
    arguments: unknown;
} | {
    type: 'tool_call_response';
    id: string;
    response: unknown;
} | {
    type: 'tool_search_output';
    id: string;
    tools?: unknown;
    status?: string;
} | {
    type: 'reasoning';
    content: string;
};
export type OTelSystemInstruction = Array<{
    type: 'text';
    content: string;
}>;
export interface OTelToolDefinition {
    type: 'function';
    name: string;
    description?: string;
    parameters?: unknown;
}
/**
 * Convert an array of internal messages to OTel input message format.
 * Handles OpenAI format (tool_calls, tool_call_id) natively.
 */
export declare function toInputMessages(messages: ReadonlyArray<{
    role?: string;
    content?: string;
    tool_calls?: ReadonlyArray<{
        id: string;
        function: {
            name: string;
            arguments: string;
        };
    }>;
    tool_call_id?: string;
}>): OTelChatMessage[];
/**
 * Convert model response choices to OTel output message format.
 */
export declare function toOutputMessages(choices: ReadonlyArray<{
    message?: {
        role?: string;
        content?: string;
        tool_calls?: ReadonlyArray<{
            id: string;
            function: {
                name: string;
                arguments: string;
            };
        }>;
    };
    finish_reason?: string;
}>): OTelOutputMessage[];
/**
 * Convert system message to OTel system instruction format.
 */
export declare function toSystemInstructions(systemMessage: string | undefined): OTelSystemInstruction | undefined;
/**
 * Normalize provider-specific messages (Anthropic content blocks, OpenAI
 * Chat Completions, OpenAI Responses API) to OTel GenAI semantic
 * convention format.
 *
 * Handles:
 * - Anthropic content block arrays: tool_use → tool_call, tool_result → tool_call_response, thinking → reasoning
 * - OpenAI Chat Completions: tool_calls, role=tool with tool_call_id
 * - OpenAI Responses API items: `type: 'message'` with `input_text` /
 *   `output_text` content blocks; `type: 'function_call'` →
 *   role=assistant + tool_call; `type: 'function_call_output'` →
 *   role=tool + tool_call_response; `type: 'tool_search_output'` →
 *   role=tool_search + tool_search_output; `type: 'reasoning'` →
 *   role=assistant + reasoning part
 * - Plain string content
 */
export declare function normalizeProviderMessages(messages: ReadonlyArray<Record<string, unknown>>): OTelChatMessage[];
/**
 * Convert tool definitions to OTel `gen_ai.tool.definitions` format.
 *
 * Accepts the variants emitted by the different request bodies/providers:
 * - OpenAI Chat Completions: `{ type: 'function', function: { name, description, parameters } }`
 * - OpenAI Responses API:    `{ type: 'function', name, description, parameters }`
 * - Anthropic Messages API:  `{ name, description, input_schema }`
 * - VS Code tool info:       `{ name, description, inputSchema }`
 *
 * Tools without a name (e.g. OpenAI client-side `tool_search`) are skipped
 * because OTel `gen_ai.tool.definitions` requires a name per entry.
 *
 * @see https://opentelemetry.io/docs/specs/semconv/registry/attributes/gen-ai/#gen-ai-tool-definitions
 */
export declare function toToolDefinitions(tools: ReadonlyArray<{
    type?: string;
    name?: string;
    description?: string;
    parameters?: unknown;
    input_schema?: unknown;
    inputSchema?: unknown;
    function?: {
        name?: string;
        description?: string;
        parameters?: unknown;
    };
}> | undefined): OTelToolDefinition[] | undefined;
//# sourceMappingURL=messageFormatters.d.ts.map