smartai/ts/classes.smartai.ts
2024-04-25 10:49:07 +02:00

47 lines
1.2 KiB
TypeScript

import { Conversation } from './classes.conversation.js';
import * as plugins from './plugins.js';
import type { AnthropicProvider } from './provider.anthropic.js';
import type { OllamaProvider } from './provider.ollama.js';
import type { OpenAiProvider } from './provider.openai.js';
import type { PerplexityProvider } from './provider.perplexity.js';
export interface ISmartAiOptions {
openaiToken?: string;
anthropicToken?: string;
perplexityToken?: string;
exposeCredentials?: plugins.smartexpose.ISmartExposeOptions;
}
export class SmartAi {
public options: ISmartAiOptions;
public openaiProvider: OpenAiProvider;
public anthropicProvider: AnthropicProvider;
public perplexityProvider: PerplexityProvider;
public ollamaProvider: OllamaProvider;
constructor(optionsArg: ISmartAiOptions) {
this.options = optionsArg;
}
public async start() {
}
public async stop() {}
/**
* creates an OpenAI conversation
*/
public async createOpenApiConversation() {
const conversation = await Conversation.createWithOpenAi(this);
}
/**
* creates an OpenAI conversation
*/
public async createAnthropicConversation() {
const conversation = await Conversation.createWithAnthropic(this);
}
}