@@ -73,7 +73,6 @@ export function buildChatRequestBody(
7373 const mergedOptions = { ...defaultApiOptions , ...options }
7474 return {
7575 model : mergedOptions . model ,
76- // 不默认设置stream,让调用者自己决定是否流式
7776 max_tokens : mergedOptions . max_tokens ,
7877 temperature : mergedOptions . temperature ,
7978 top_p : mergedOptions . top_p ,
@@ -264,9 +263,6 @@ export async function sendStreamChatRequest(
264263 'Content-Type' : 'application/json' ,
265264 Authorization : Cookies . get ( 'bizy_token' ) || '' ,
266265 ...( options as any ) ?. headers
267- 'Content-Type' : 'application/json' ,
268- Authorization : Cookies . get ( 'bizy_token' ) || '' ,
269- ...( options as any ) ?. headers
270266 } ,
271267 body : JSON . stringify ( requestBody ) ,
272268 signal : abortController . signal // 添加中止信号
@@ -512,11 +508,6 @@ export async function handleImageWithKontextPro(prompt: string, imageBase64: str
512508 } ) ;
513509 console . log ( response , '请求结果' ) ;
514510
515- // if (!response.ok) {
516- // const errorText = await response.text();
517- // console.error('API请求失败:', response.status, errorText);
518- // throw new Error(`图像编辑API请求失败: ${response.status} ${response.statusText}`);
519- // }
520511
521512 const responseData = await response . json ( ) ;
522513 console . log ( 'API响应数据:' , responseData ) ;
0 commit comments