This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7cbb42e
commit eb08ba5
Showing
2 changed files
with
3 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,16 @@ | ||
# Mistral Javascript Client | ||
|
||
You can use the Mistral Javascript client to interact with the Mistral AI API | ||
You can use the Mistral Javascript client to interact with the Mistral AI API. | ||
|
||
## Installing | ||
|
||
You can install the library in your project using: | ||
|
||
`npm install mistralai` | ||
|
||
## Usage | ||
|
||
### Chat | ||
|
||
The simplest use case is to chat with Mistral AI models: | ||
|
||
```javascript | ||
const client = require("mistralai"); | ||
|
||
const response = client.chat('le-tiny', [{role: 'user', content: 'What is your favourite French food, and why is it mayonnaise?'}]) | ||
|
||
``` | ||
|
||
You can also use `client.chatStream` for streaming results. | ||
|
||
### Embeddings | ||
|
||
To use our embedding API you can use the following code: | ||
|
||
```javascript | ||
const client = require('mistralai'); | ||
|
||
const response = client.embed('le-embed', 'My favourite place to eat mayonnaise is embed'); | ||
``` | ||
|
||
## Run examples | ||
|
||
Examples can be found in the `examples/` directory you can run them using: | ||
|
||
You can run the examples in the `examples/` directory using | ||
```bash | ||
node [example.js] | ||
|
||
node [examples/chat_no_streaming.js] | ||
``` |
This file was deleted.
Oops, something went wrong.