@anvia/mistral
v0.1.4
Published
Mistral provider adapter for Anvia.
Readme
@anvia/mistral
Mistral completion and embedding provider adapter for Anvia.
Use this package when you want Anvia agents, extractors, pipelines, embeddings, or model listing to run on Mistral APIs.
Installation
pnpm add @anvia/mistral @anvia/coreIn this monorepo, the package is available through the workspace:
pnpm --filter @anvia/mistral buildUsage
import { AgentBuilder } from "@anvia/core";
import { MistralClient } from "@anvia/mistral";
const client = new MistralClient({ apiKey: process.env.MISTRAL_API_KEY });
const model = client.completionModel("mistral-large-latest");
const agent = new AgentBuilder("support", model)
.instructions("Answer clearly and concisely.")
.build();
const response = await agent.prompt("What should I check before launch?").send();
console.log(response.output);Embeddings
const embeddings = client.embeddingModel("mistral-embed");
const vectors = await embeddings.embedTexts(["Refunds take five business days."]);Model Listing
const models = await client.listModels();Capabilities
The v1 adapter supports text completions, streaming, tools, tool choice, structured output, Mistral embeddings, and model listing. Image inputs, document file inputs, transcription, audio generation, and image generation are not implemented yet.
Exports
MistralClientMistralCompletionModelMistralEmbeddingModelMistralClientOptionsMistralEmbeddingModelOptionsmistralMessageHelpersmistral
Development
pnpm --filter @anvia/mistral typecheck
pnpm --filter @anvia/mistral test
pnpm --filter @anvia/mistral build