Think of workspaces as different “assistants” you can create for various purposes. Each workspace can have its own personality (system prompt) and capabilities. The best part? Workspaces are created automatically when you configure them – no separate creation step needed!For example:
customer-support - A helpful assistant for customer queries
product-search - An expert at finding the perfect product
docs-helper - A technical assistant for documentation
When using the OpenAI SDK with Meilisearch’s chat completions endpoint, errors from the streamed responses are natively handled by the official OpenAI SDK. This means you can use the SDK’s built-in error handling mechanisms without additional configuration:
Since Meilisearch keeps your data private and doesn’t store conversations, you’ll need to manage conversation history in your application. Here’s a simple approach:
Copy
// Store conversation history in your appconst conversation = [];// Add user messageconversation.push({ role: 'user', content: 'What is Meilisearch?' });// Get response and add to historyconst response = await client.chat.completions.create({ model: 'gpt-3.5-turbo', messages: conversation, stream: true,});// Add assistant response to historylet assistantMessage = '';for await (const chunk of response) { assistantMessage += chunk.choices[0]?.delta?.content || '';}conversation.push({ role: 'assistant', content: assistantMessage });// Use the full conversation for follow-up questionsconversation.push({ role: 'user', content: 'Can it handle typos?' });// ... continue the conversation
Remember: Each request is independent, so always send the full conversation history if you want the AI to remember previous exchanges.