rawi
Version:
Rawi (راوي) is the developer-friendly AI CLI that brings the power of 11 major AI providers directly to your terminal. With seamless shell integration, persistent conversations, and 200+ specialized prompt templates, Rawi transforms your command line into
54 lines (51 loc) • 2.31 kB
TypeScript
import { LanguageModelV2 } from '@ai-sdk/provider';
import { z } from 'zod';
import { OllamaChatModelId, OllamaChatSettings } from './ollama-chat-settings.js';
import './ollama-models-list.js';
interface OllamaChatConfig {
baseURL: string;
fetch?: typeof fetch;
headers: () => Record<string, string | undefined>;
provider: string;
}
declare class OllamaChatLanguageModel implements LanguageModelV2 {
#private;
readonly modelId: OllamaChatModelId;
readonly settings: OllamaChatSettings;
readonly config: OllamaChatConfig;
readonly specificationVersion = "v2";
readonly defaultObjectGenerationMode = "json";
readonly supportsImageUrls = true;
readonly supportedUrls: Record<string, RegExp[]> | PromiseLike<Record<string, RegExp[]>>;
constructor(modelId: OllamaChatModelId, settings: OllamaChatSettings, config: OllamaChatConfig);
get supportsStructuredOutputs(): boolean;
get provider(): string;
doGenerate(options: Parameters<LanguageModelV2['doGenerate']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doGenerate']>>>;
doStream(options: Parameters<LanguageModelV2['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doStream']>>>;
}
declare const ollamaChatResponseSchema: z.ZodObject<{
created_at: z.ZodString;
done: z.ZodLiteral<true>;
done_reason: z.ZodNullable<z.ZodOptional<z.ZodString>>;
eval_count: z.ZodNumber;
eval_duration: z.ZodNumber;
load_duration: z.ZodOptional<z.ZodNumber>;
message: z.ZodObject<{
content: z.ZodString;
images: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
role: z.ZodString;
tool_calls: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
function: z.ZodObject<{
arguments: z.ZodRecord<z.ZodString, z.ZodAny>;
name: z.ZodString;
}, z.core.$strip>;
id: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>>;
}, z.core.$strip>;
model: z.ZodString;
prompt_eval_count: z.ZodOptional<z.ZodNumber>;
prompt_eval_duration: z.ZodOptional<z.ZodNumber>;
total_duration: z.ZodNumber;
}, z.core.$strip>;
type OllamaChatResponseSchema = z.infer<typeof ollamaChatResponseSchema>;
export { OllamaChatLanguageModel, type OllamaChatResponseSchema };