@@ -21,13 +21,11 @@ import { jsonrepair } from 'jsonrepair';
2121import OpenAI from 'openai' ;
2222import type { ChatCompletionMessageParam } from 'openai/resources/index' ;
2323import type { Stream } from 'openai/streaming' ;
24- import type { AIActionType , AIArgs } from '../../common' ;
24+ import type { AIArgs } from '../../common' ;
2525
2626async function createChatClient ( {
27- AIActionTypeValue,
2827 modelConfig,
2928} : {
30- AIActionTypeValue : AIActionType ;
3129 modelConfig : IModelConfig ;
3230} ) : Promise < {
3331 completion : OpenAI . Chat . Completions ;
@@ -204,7 +202,6 @@ async function createChatClient({
204202
205203export async function callAI (
206204 messages : ChatCompletionMessageParam [ ] ,
207- AIActionTypeValue : AIActionType ,
208205 modelConfig : IModelConfig ,
209206 options ?: {
210207 stream ?: boolean ;
@@ -219,7 +216,6 @@ export async function callAI(
219216} > {
220217 const { completion, modelName, modelDescription, uiTarsVersion, vlMode } =
221218 await createChatClient ( {
222- AIActionTypeValue,
223219 modelConfig,
224220 } ) ;
225221
@@ -425,7 +421,6 @@ export async function callAI(
425421
426422export async function callAIWithObjectResponse < T > (
427423 messages : ChatCompletionMessageParam [ ] ,
428- AIActionTypeValue : AIActionType ,
429424 modelConfig : IModelConfig ,
430425 options ?: {
431426 deepThink ?: DeepThinkOption ;
@@ -436,7 +431,7 @@ export async function callAIWithObjectResponse<T>(
436431 usage ?: AIUsageInfo ;
437432 reasoning_content ?: string ;
438433} > {
439- const response = await callAI ( messages , AIActionTypeValue , modelConfig , {
434+ const response = await callAI ( messages , modelConfig , {
440435 deepThink : options ?. deepThink ,
441436 } ) ;
442437 assert ( response , 'empty response' ) ;
@@ -456,10 +451,9 @@ export async function callAIWithObjectResponse<T>(
456451
457452export async function callAIWithStringResponse (
458453 msgs : AIArgs ,
459- AIActionTypeValue : AIActionType ,
460454 modelConfig : IModelConfig ,
461455) : Promise < { content : string ; usage ?: AIUsageInfo } > {
462- const { content, usage } = await callAI ( msgs , AIActionTypeValue , modelConfig ) ;
456+ const { content, usage } = await callAI ( msgs , modelConfig ) ;
463457 return { content, usage } ;
464458}
465459
0 commit comments