import { MidGenerationCompressor } from "../../compression/MidGenerationCompressor.js";
import { AgentRunContext, ResolvedGenerationResponse } from "../agent-types.js";
import { Part } from "@inkeep/agents-core";
import { Span } from "@opentelemetry/api";
import { ToolSet } from "ai";

//#region src/domains/run/agents/generation/generate.d.ts
declare function setupGenerationContext(ctx: AgentRunContext, runtimeContext?: {
  contextId: string;
  metadata: {
    conversationId: string;
    threadId: string;
    taskId: string;
    streamRequestId: string;
    apiKey?: string;
  };
}): {
  contextId: string;
  taskId: string;
  streamRequestId: string;
  sessionId: string;
};
declare function buildBaseGenerationConfig(ctx: AgentRunContext, modelSettings: Record<string, unknown>, messages: unknown[], sanitizedTools: ToolSet, compressor: MidGenerationCompressor | null, originalMessageCount: number, timeoutMs: number, toolChoice?: 'auto' | 'required', phase?: string): Record<string, unknown>;
declare function buildTelemetryConfig(ctx: AgentRunContext, phase?: string): object;
declare function handleGenerationError(ctx: AgentRunContext, error: unknown, span: Span): never;
declare function runGenerate(ctx: AgentRunContext, userParts: Part[], runtimeContext?: {
  contextId: string;
  metadata: {
    conversationId: string;
    threadId: string;
    taskId: string;
    streamRequestId: string;
    apiKey?: string;
  };
}, options?: {
  schemaOnlyTools?: boolean;
}): Promise<ResolvedGenerationResponse>;
//#endregion
export { buildBaseGenerationConfig, buildTelemetryConfig, handleGenerationError, runGenerate, setupGenerationContext };