From b6cbb2f7fc94d0d0d09ea8d7c9ec9b92e691b7c1 Mon Sep 17 00:00:00 2001 From: Bam4d Date: Thu, 7 Dec 2023 14:12:56 +0100 Subject: [PATCH] some mayonnaise related readme stuff --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cf69430..40c269f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,43 @@ -# client-js -JS Client library for Mistral AI platform +# Mistral Javascript Client + +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: + +```bash +node [example.js] + +```