generated from kevisual/vite-react-template
17 lines
476 B
TypeScript
17 lines
476 B
TypeScript
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
|
|
import { generateText } from 'ai';
|
|
|
|
|
|
const cnb = createOpenAICompatible({
|
|
baseURL: 'https://api.cnb.cool/kevisual/cnb-ai/-/ai',
|
|
name: 'custom-cnb',
|
|
apiKey: 'cIDfLOOIr1Trt15cdnwfndupEZG',
|
|
});
|
|
// const model = config.AI_MODEL;
|
|
const model = 'hunyuan';
|
|
const { text } = await generateText({
|
|
model: cnb(model),
|
|
prompt: 'Say hello in one sentence.',
|
|
});
|
|
console.log('text', text)
|
|
// https://api.cnb.cool
|