aiwrapper
Version:
A Universal AI Wrapper for JavaScript & TypeScript
26 lines (25 loc) • 925 B
TypeScript
import { LangOptions, LangResult, LanguageProvider, LangMessage } from "../language-provider.ts";
import { LangMessages } from "../messages.ts";
import { Model } from 'aimodels';
export type OllamaLangOptions = {
model?: string;
systemPrompt?: string;
maxTokens?: number;
url?: string;
};
export type OllamaLangConfig = {
model: string;
systemPrompt: string;
maxTokens?: number;
baseURL: string;
};
export declare class OllamaLang extends LanguageProvider {
protected _config: OllamaLangConfig;
protected modelInfo?: Model;
constructor(options: OllamaLangOptions);
protected transformBody(body: Record<string, unknown>): Record<string, unknown>;
ask(prompt: string, options?: LangOptions): Promise<LangResult>;
chat(messages: LangMessage[] | LangMessages, options?: LangOptions): Promise<LangResult>;
private extractThinking;
private processChunkForThinking;
}