diff --git a/chatapi/src/services/chat.service.ts b/chatapi/src/services/chat.service.ts index 34e93b968d..c60eafc070 100644 --- a/chatapi/src/services/chat.service.ts +++ b/chatapi/src/services/chat.service.ts @@ -26,7 +26,7 @@ export async function chat(data: any, stream?: boolean, callback?: (response: st throw new Error('"data.content" is a required non-empty string field'); } - if(stream && aiProvider.name === 'gemini') { + if (stream && aiProvider.name === 'gemini') { throw new Error('Streaming not supported on Gemini'); } diff --git a/chatapi/src/utils/chat-assistant.utils.ts b/chatapi/src/utils/chat-assistant.utils.ts index fe91ec237d..6905085502 100644 --- a/chatapi/src/utils/chat-assistant.utils.ts +++ b/chatapi/src/utils/chat-assistant.utils.ts @@ -10,7 +10,7 @@ export async function createAssistant(model: string) { return await keys.openai.beta.assistants.create({ 'name': assistant?.name, 'instructions': assistant?.instructions, - 'tools': [{ 'type': 'code_interpreter' }], + 'tools': [ { 'type': 'code_interpreter' } ], model, }); } diff --git a/chatapi/src/utils/chat-helpers.utils.ts b/chatapi/src/utils/chat-helpers.utils.ts index df510e9ebe..a146c063af 100644 --- a/chatapi/src/utils/chat-helpers.utils.ts +++ b/chatapi/src/utils/chat-helpers.utils.ts @@ -31,7 +31,7 @@ async function handleGemini( const geminiMessages: GeminiMessage[] = messages.map((message) => ({ 'role': message.role === 'assistant' ? 'model' : message.role, - 'parts': [ { 'text': message.content }], + 'parts': [ { 'text': message.content } ], })); geminiMessages.pop(); @@ -130,8 +130,8 @@ export async function aiChatNonStream( } const model = aiProvider.model ?? provider.defaultModel; - if(context.resource) { - for (const [attachmentName, attachment] of Object.entries(context.resource.attachments)) { + if (context.resource) { + for (const [ attachmentName, attachment ] of Object.entries(context.resource.attachments)) { const typedAttachment = attachment as Attachment; const contentType = typedAttachment.content_type; @@ -143,7 +143,7 @@ export async function aiChatNonStream( } } - if(assistant) { + if (assistant) { try { const asst = await createAssistant(model); const thread = await createThread();