Skip to content

Commit

Permalink
Set the entire context var not just the .data
Browse files Browse the repository at this point in the history
  • Loading branch information
Mutugiii committed Sep 20, 2024
1 parent d357e65 commit 97a24d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chatapi/src/utils/chat-helpers.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export async function aiChatNonStream(
messages: ChatMessage[],
aiProvider: AIProvider,
assistant: boolean,
context: any,
context: any = '',
): Promise<string> {
const provider = models[aiProvider.name];
if (!provider) {
Expand All @@ -150,7 +150,7 @@ export async function aiChatNonStream(
for (const message of messages) {
await addToThread(thread.id, message.content);
}
const run = await createRun(thread.id, asst.id, context.data = '');
const run = await createRun(thread.id, asst.id, context.data);
await waitForRunCompletion(thread.id, run.id);

return await retrieveResponse(thread.id);
Expand Down

0 comments on commit 97a24d3

Please sign in to comment.