udpate
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kevisual/ai",
|
"name": "@kevisual/ai",
|
||||||
"version": "0.0.13",
|
"version": "0.0.14",
|
||||||
"description": "AI Center Services",
|
"description": "AI Center Services",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"basename": "/root/ai-center-services",
|
"basename": "/root/ai-center-services",
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { OpenAI } from 'openai';
|
|
||||||
import type {
|
import type {
|
||||||
BaseChatInterface,
|
BaseChatInterface,
|
||||||
ChatMessageComplete,
|
ChatMessageComplete,
|
||||||
@@ -51,12 +50,11 @@ export class BaseChat implements BaseChatInterface, BaseChatUsageInterface {
|
|||||||
total_tokens: number;
|
total_tokens: number;
|
||||||
completion_tokens: number;
|
completion_tokens: number;
|
||||||
responseText: string;
|
responseText: string;
|
||||||
utils: AIUtils;
|
utils = AIUtils;
|
||||||
constructor(options: BaseChatOptions) {
|
constructor(options: BaseChatOptions) {
|
||||||
this.baseURL = options.baseURL;
|
this.baseURL = options.baseURL;
|
||||||
this.model = options.model;
|
this.model = options.model;
|
||||||
this.apiKey = options.apiKey;
|
this.apiKey = options.apiKey;
|
||||||
this.utils = new AIUtils();
|
|
||||||
}
|
}
|
||||||
post(url = '', opts: { headers?: Record<string, string>, data?: any } = {}) {
|
post(url = '', opts: { headers?: Record<string, string>, data?: any } = {}) {
|
||||||
let _url = url.startsWith('http') ? url : this.baseURL + url;
|
let _url = url.startsWith('http') ? url : this.baseURL + url;
|
||||||
|
|||||||
@@ -3,3 +3,5 @@ export * from './chat.ts';
|
|||||||
export * from './knowledge.ts';
|
export * from './knowledge.ts';
|
||||||
|
|
||||||
export * from './utils/index.ts';
|
export * from './utils/index.ts';
|
||||||
|
|
||||||
|
export { AIUtils } from './core/utils/index.ts';
|
||||||
Reference in New Issue
Block a user