Skip to content

Commit

Permalink
chore: force calling getStockPrice
Browse files Browse the repository at this point in the history
  • Loading branch information
manekinekko committed May 17, 2024
1 parent 6a12ebf commit adf4837
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/src/functions/assistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ async function* processQuery(userQuery, context) {
const run = openai.beta.threads.runs.stream(thread.id, {
assistant_id: assistant.id,
stream: true,
tool_choice: { "type": "function", "function": { "name": "getStockPrice" } }
});

context.log('Step 5: Read streamed response', { run });
Expand All @@ -126,7 +127,7 @@ async function* processQuery(userQuery, context) {
}

async function* handleRequiresAction(openai, run, runId, threadId, context) {
context.log('Handle Function Calling', {required_action: run.required_action.submit_tool_outputs.tool_calls});
context.log('Handle Function Calling', { required_action: run.required_action.submit_tool_outputs.tool_calls });
try {
const toolOutputs = await Promise.all(
run.required_action.submit_tool_outputs.tool_calls.map(
Expand Down

0 comments on commit adf4837

Please sign in to comment.