Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #38 from mistralai/bam4d/user-agent
Browse files Browse the repository at this point in the history
Bam4d/user agent
  • Loading branch information
Bam4d authored Jan 15, 2024
2 parents 1750bab + 30e9ed6 commit 0fb76d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
npm version ${{ github.ref_name }}
sed -i '' -e 's/VERSION = '\''0.0.1'\''/VERSION = '\''${{ github.ref_name }}'\''/g' src/client.js
npm publish
8 changes: 5 additions & 3 deletions src/client.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
let isNode = false;

const VERSION = '0.0.3';
const RETRY_STATUS_CODES = [429, 500, 502, 503, 504];
const ENDPOINT = 'https://api.mistral.ai';

/**
* Initialize fetch
* @return {Promise<void>}
Expand All @@ -17,9 +21,6 @@ async function initializeFetch() {

initializeFetch();

const RETRY_STATUS_CODES = [429, 500, 502, 503, 504];
const ENDPOINT = 'https://api.mistral.ai';

/**
* MistralAPIError
* @return {MistralAPIError}
Expand Down Expand Up @@ -74,6 +75,7 @@ class MistralClient {
const options = {
method: method,
headers: {
'User-Agent': `mistral-client-js/${VERSION}`,
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': `Bearer ${this.apiKey}`,
Expand Down

0 comments on commit 0fb76d5

Please sign in to comment.