Search by

papi-ai / mistral

md

Mistral provider for PapiAI

Package info

github.com/papi-ai/mistral

Type:papi-provider

pkg:composer/papi-ai/mistral

Statistics

Installs: 12

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.16.3 2026-11-16 20:40 UTC

This package is not auto-updated.

Last update: 2026-11-16 20:45:04 UTC


README

CI Latest Version Total Downloads PHP Version License

Mistral provider for PapiAI - A simple but powerful PHP library for building AI agents.

Installation

composer require papi-ai/mistral

Usage

use PapiAI\Core\Agent;
use PapiAI\Mistral\MistralProvider;

$provider = new MistralProvider(
    apiKey: $_ENV['MISTRAL_API_KEY'],
);

$agent = new Agent(
    provider: $provider,
    instructions: 'You are a helpful assistant.',
);

$response = $agent->run('Hello!');
echo $response->text;

Available Models

MistralProvider::MODEL_MISTRAL_LARGE  // 'mistral-large-latest' (default)
MistralProvider::MODEL_MISTRAL_EMBED  // 'mistral-embed' (embeddings)

Features

  • Tool/function calling
  • Streaming support
  • Embeddings support

Creating It by Name

An application that picks its provider from configuration can build this one without naming its class:

use PapiAI\Core\Factory\ComposerDiscovery;
use PapiAI\Core\Factory\ProviderRegistry;

$registry = new ProviderRegistry(new ComposerDiscovery());

$provider = $registry->create('mistral', [
    'api_key' => $_ENV['MISTRAL_API_KEY'],
]);

It takes api_key (required), model and max_tokens. Anything it is not given falls back to the constructor's defaults, and a missing or unknown setting throws ConfigurationException before any request is made.

License

MIT