Skip to content

Commit

Permalink
update mistral
Browse files Browse the repository at this point in the history
  • Loading branch information
andrefs committed Jun 4, 2024
1 parent 6500788 commit cde877b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
26 changes: 13 additions & 13 deletions auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
// Generated by unplugin-auto-import
export {}
declare global {
const afterAll: typeof import("vitest")["afterAll"];
const afterEach: typeof import("vitest")["afterEach"];
const assert: typeof import("vitest")["assert"];
const beforeAll: typeof import("vitest")["beforeAll"];
const beforeEach: typeof import("vitest")["beforeEach"];
const chai: typeof import("vitest")["chai"];
const describe: typeof import("vitest")["describe"];
const expect: typeof import("vitest")["expect"];
const it: typeof import("vitest")["it"];
const suite: typeof import("vitest")["suite"];
const test: typeof import("vitest")["test"];
const vi: typeof import("vitest")["vi"];
const vitest: typeof import("vitest")["vitest"];
const afterAll: typeof import('vitest')['afterAll']
const afterEach: typeof import('vitest')['afterEach']
const assert: typeof import('vitest')['assert']
const beforeAll: typeof import('vitest')['beforeAll']
const beforeEach: typeof import('vitest')['beforeEach']
const chai: typeof import('vitest')['chai']
const describe: typeof import('vitest')['describe']
const expect: typeof import('vitest')['expect']
const it: typeof import('vitest')['it']
const suite: typeof import('vitest')['suite']
const test: typeof import('vitest')['test']
const vi: typeof import('vitest')['vi']
const vitest: typeof import('vitest')['vitest']
}
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@anthropic-ai/sdk": "0.21.0",
"@google/generative-ai": "0.12.0",
"@mistralai/mistralai": "0.1.3",
"@mistralai/mistralai": "0.4.0",
"@sinclair/typebox": "0.32.30",
"@stdlib/stats-pcorrtest": "0.2.1",
"cohere-ai": "7.10.2",
Expand Down
6 changes: 3 additions & 3 deletions src/lib/models/mistral.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import MistralClient, {
ChatCompletionResponse,
ToolChoice,
ChatRequest,
} from "@mistralai/mistralai";
import { Model, ModelTool, ModelResponse, ModelPricing } from "./model";
import logger from "../logger";
Expand Down Expand Up @@ -40,7 +40,7 @@ const buildModel = (
pricing?: ModelPricing
) => {
const makeRequest = async function (prompt: string, toolParams: ModelTool) {
const req = {
const req: ChatRequest = {
model: modelId,
messages: [
{ role: "system", content: "You are a helpful assistant." },
Expand All @@ -49,7 +49,7 @@ const buildModel = (
content: prompt,
},
],
toolChoice: "any" as ToolChoice,
toolChoice: "any",
tools: [
{
type: "function",
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/testMistral.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MistralClient, { ToolChoice } from "@mistralai/mistralai";
import MistralClient from "@mistralai/mistralai";
import "dotenv/config";
const apiKey = process.env.MISTRAL_API_KEY;

Expand All @@ -16,7 +16,7 @@ const run = async () => {
"Give me a list of 10 French cheeses so that I could choose the best one.",
},
],
toolChoice: "any" as ToolChoice,
toolChoice: "any",
tools: [
{
type: "function",
Expand Down

0 comments on commit cde877b

Please sign in to comment.