Client does not return a response
chanmathew opened this issue · comments
Hi there,
Running the latest version of the SDK 0.1.3, but when I try to init and call the client, it does not return anything.
Here is my code:
const mistral = new MistralClient(env.PUBLIC_MISTRAL_API_KEY)
const response = await mistral.chatStream({
model: 'mistral-large-latest',
messages: [{ role: 'system', content: 'Say hello world.' }],
temperature: 0
})
// response is an empty object {}
I can give this one a try.
chatStream is a generator function
client: MistralClient {
_request: [AsyncFunction: _request],
_makeChatCompletionRequest: [Function: _makeChatCompletionRequest],
listModels: [AsyncFunction: listModels],
chat: [AsyncFunction: chat],
chatStream: [AsyncGeneratorFunction: chatStream],
embeddings: [AsyncFunction: embeddings],
endpoint: 'https://api.mistral.ai',
apiKey: '********',
maxRetries: 5,
timeout: 120,
modelDefault: 'mistral'
}
This is not necessary. You are supposed to use as so:
client-js/examples/chat_with_streaming.js
Lines 1 to 18 in 6499236