Extraction schema (#398)

This commit is contained in:
Archer
2023-10-14 23:02:01 +08:00
committed by GitHub
parent 7db8d3ea0f
commit dd8f2744bf
193 changed files with 2036 additions and 15694 deletions

View File

@@ -1,4 +1,4 @@
import { UserModelSchema } from '../user/type';
import type { UserModelSchema } from '@fastgpt/support/user/type.d';
import OpenAI from 'openai';
export const openaiBaseUrl = process.env.OPENAI_BASE_URL || 'https://api.openai.com/v1';

View File

@@ -10,7 +10,7 @@ export async function createQuestionGuide({
messages: ChatCompletionRequestMessage[];
model: string;
}) {
const ai = getAIApi();
const ai = getAIApi(undefined, 48000);
const data = await ai.chat.completions.create({
model: model,
temperature: 0,
@@ -25,7 +25,7 @@ export async function createQuestionGuide({
stream: false
});
const answer = data.choices?.[0].message?.content || '';
const answer = data.choices?.[0]?.message?.content || '';
const totalTokens = data.usage?.total_tokens || 0;
const start = answer.indexOf('[');