This commit is contained in:
从何开始123
2026-01-09 01:07:03 +08:00
parent 21842c2b50
commit a32f3a5faf
17 changed files with 334 additions and 135 deletions

View File

@@ -1,3 +1,4 @@
import OpenAI from "openai";
import { ModelOption } from '../../types';
import { withRetry } from '../utils/retry';
@@ -10,7 +11,7 @@ export interface OpenAIStreamChunk {
export interface OpenAIConfig {
model: ModelOption;
systemInstruction?: string;
content: string;
content: string | Array<any>;
temperature?: number;
responseFormat?: 'text' | 'json_object';
thinkingConfig?: {
@@ -49,7 +50,7 @@ export const generateContent = async (
messages.push({
role: 'user',
content: config.content
content: config.content as any
});
const requestOptions: any = {
@@ -93,7 +94,7 @@ export async function* generateContentStream(
messages.push({
role: 'user',
content: config.content
content: config.content as any
});
const requestOptions: any = {