ai-switcher
Version:
A package which helps you switch between AI APIs using configurations, so that code changes are not required.
9 lines (7 loc) • 312 B
text/typescript
// src/clients/base.ts
import { Message, CompletionOptions } from '../types';
export abstract class BaseAIClient {
protected abstract apiKey: string;
abstract createCompletion(messages: Message[], options?: CompletionOptions): Promise<string>;
abstract createEmbedding(text: string): Promise<number[]>;
}