Public declaration syntax from forge-ts/packages/forge-core/src/model.ts Original source SHA-256: 6503238e749226b0e2f6c8cd9d2f85cfa286e5eaba656bb776d7fd3dcff75944 Function bodies and constant values are omitted. This is not the complete implementation. Source line 46 export interface LanguageModel { /** The model identifier (e.g., "gpt-4o", "claude-sonnet-4-5-20250929"). */ readonly modelId: string; /** The provider namespace (e.g., "openai", "anthropic"). */ readonly provider: string; /** Whether this model supports tool calling. */ readonly supportsToolCalling: boolean; /** Whether this model supports structured output (JSON mode). */ readonly supportsStructuredOutput: boolean; /** Whether this model supports image input. */ readonly supportsImageInput: boolean; /** Whether this model supports streaming. */ readonly supportsStreaming: boolean; /** * Generates a complete response from the model. * * @param messages - The conversation history. * @param tools - Available tool definitions for this inference call. * @param options - Generation options (temperature, max_tokens, etc.). * @returns A GenerateResult containing the model's response, usage statistics, * and finish reason. * @throws {ForgeError} If the provider call fails, times out, or returns * an invalid response. */ generate( messages: readonly ModelMessage[], tools: readonly ToolDefinition[], options: GenerateOptions ): Promise; /** * Streams a response from the model as chunks. * * @param messages - The conversation history. * @param tools - Available tool definitions for this inference call. * @param options - Generation options. * @returns An async generator of StreamChunk values. Callers should process * chunks as they arrive for real-time output. * @throws {ForgeError} If the provider call fails. */ stream( messages: readonly ModelMessage[], tools: readonly ToolDefinition[], options: GenerateOptions ): AsyncGenerator; }