Skip to content

Commit

Permalink
linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mutugiii committed Oct 16, 2024
1 parent 7b6cdb7 commit db0107c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion chatapi/src/services/chat.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
2 changes: 1 addition & 1 deletion chatapi/src/utils/chat-assistant.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
Expand Down
8 changes: 4 additions & 4 deletions chatapi/src/utils/chat-helpers.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;

Expand All @@ -143,7 +143,7 @@ export async function aiChatNonStream(
}
}

if(assistant) {
if (assistant) {
try {
const asst = await createAssistant(model);
const thread = await createThread();
Expand Down

0 comments on commit db0107c

Please sign in to comment.