MCPcopy Index your code
hub / github.com/admineral/OpenAI-Assistant-API-Chat / createThread

Function createThread

app/services/api.js:62–75  ·  view source on GitHub ↗
(inputmessage)

Source from the content-addressed store, hash-verified

60
61 // Creates a thread
62 export const createThread = async (inputmessage) => {
63 console.log('Creating thread...');
64 const response = await fetch('/api/createThread', {
65 method: 'POST',
66 headers: { 'Content-Type': 'application/json' },
67 body: JSON.stringify({ inputmessage }),
68 });
69 if (!response.ok) {
70 console.error('Failed to create thread');
71 throw new Error('Failed to create thread');
72 }
73 console.log('Thread created successfully');
74 return await response.json();
75 };
76
77 // Runs an assistant
78 export const runAssistant = async (assistantId, threadId) => {

Callers 1

createChatThreadFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected