MCPcopy Create free account
hub / github.com/admineral/OpenAI-Assistant-API-Chat / runAssistant

Function runAssistant

app/services/api.js:78–92  ·  view source on GitHub ↗
(assistantId, threadId)

Source from the content-addressed store, hash-verified

76
77 // Runs an assistant
78 export const runAssistant = async (assistantId, threadId) => {
79 console.log('Running assistant...');
80 const response = await fetch('/api/runAssistant', {
81 method: 'POST',
82 headers: { 'Content-Type': 'application/json' },
83 body: JSON.stringify({ assistantId, threadId }),
84 });
85 if (!response.ok) {
86 console.error('Failed to run assistant');
87 throw new Error('Failed to run assistant');
88 }
89 const data = await response.json();
90 console.log('Assistant run successfully. Run ID:', data.runId);
91 return data;
92 };
93
94 // Checks the status of a run
95 export const checkRunStatus = async (threadId, runId) => {

Callers 1

runChatAssistantFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected