You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The instrumentation-openai package should be able to capture calls to the OpenAI Assistants API. Specifically, it should be able to trace this program taken from the linked quickstart documentation:
importOpenAIfrom"openai";constopenai=newOpenAI({apiKey: OPENAI_KEY});asyncfunctionmain(){constassistant=awaitopenai.beta.assistants.create({name: "Math Tutor",instructions: "You are a personal math tutor. Write and run code to answer math questions.",tools: [{type: "code_interpreter"}],model: "gpt-4o"});constthread=awaitopenai.beta.threads.create();constmessage=awaitopenai.beta.threads.messages.create(thread.id,{role: "user",content: "I need to solve the equation `3x + 11 = 14`. Can you help me?"});letrun=awaitopenai.beta.threads.runs.createAndPoll(thread.id,{assistant_id: assistant.id,instructions: "Please address the user as Jane Doe. The user has a premium account."});if(run.status==='completed'){constmessages=awaitopenai.beta.threads.messages.list(run.thread_id);for(constmessageofmessages.data.reverse()){console.log(`${message.role} > ${message.content[0].text.value}`);}}else{console.log(run.status);}}main();
The text was updated successfully, but these errors were encountered:
Not immediately, which is why I made the issue instead of a PR. I should be able to get around to it soon-ish. If I'm not able to get to this within a week, then I'll update this issue.
The
instrumentation-openai
package should be able to capture calls to the OpenAI Assistants API. Specifically, it should be able to trace this program taken from the linked quickstart documentation:The text was updated successfully, but these errors were encountered: