Download the PHP package helgesverre/mistral without Composer
On this page you can find all versions of the php package helgesverre/mistral. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download helgesverre/mistral
More information about helgesverre/mistral
Files in helgesverre/mistral
Package mistral
Short Description Laravel Client for the Mistral.ai API
License MIT
Homepage https://github.com/helgesverre/mistral-php
Informations about the package mistral
Laravel Client for Mistral.AI
The Mistral.ai Laravel Client enables laravel applications to interact with the Mistral.ai API, providing straightforward access to features like chat completions and text embeddings.
Get your API key at console.mistral.ai.
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Usage
Client Instantiation
Create an instance of the Mistral client to start interacting with the API. This instance will be your primary interface for sending requests to Mistral.AI.
Resources
Models
Resource
List available models
Embeddings
Resource
Create embedding
Chat
Resource
Create Chat Completion
Create Chat Completion with Function Calling
Create Streamed Chat Completions
SimpleChat
Resource
For convenience, the client also provides a simple chat completion method, which returns a simpler, condensed and flattened DTO, which is useful for quick prototyping.
Create simple chat completions
SimpleChat
Resource
For convenience, the client also provides a simple chat completion method, which returns a simpler, condensed, and flattened DTO, useful for quick prototyping.
Create Streamed Simple Chat Completions
List of DTOs
For convenience, here is a list of all the DTOs available in this package.
- Chat
- Chat/ChatCompletionChoice.php
- Chat/ChatCompletionMessage.php
- Chat/ChatCompletionRequest.php
- Chat/ChatCompletionResponse.php
- Chat/StreamedChatCompletionChoice.php
- Chat/StreamedChatCompletionDelta.php
- Chat/StreamedChatCompletionResponse.php
- Chat/FunctionCall.php
- Chat/ToolCalls.php
- Embedding
- Embedding/Embedding.php
- Embedding/EmbeddingRequest.php
- Embedding/EmbeddingResponse.php
- Models
- Models/Model.php
- Models/ModelList.php
- Models/ModelPermission.php
- SimpleChat
- SimpleChat/SimpleChatResponse.php
- SimpleChat/SimpleStreamChunk.php
- Misc
- Usage.php
List of available Mistral models
The following models are available in the Mistral API. You can use the Model
enum in this package to refer to them, or
use the string value directly.
Enum Case | String Value | Documentation Link |
---|---|---|
Model::large->value |
'mistral-large-latest' |
Mistral Large Docs |
Model::medium->value |
'mistral-medium-latest' |
Mistral Medium Docs |
Model::small->value |
'mistral-small-latest' |
Mistral Small Docs |
Model::mixtral->value |
'open-mixtral-8x7b' |
Mistral Mixtral-8x7b Docs |
Model::mistral7b->value |
'open-mistral-7b' |
Mistral Mistral-7b Docs |
Model::embed->value |
'mistral-embed' |
Mistral Embed Docs |
Testing
License
The MIT License (MIT). Please see License File for more information.
Disclaimer
Mistral and the Mistral logo are trademarks of Mistral.ai. This package is not affiliated with, endorsed by, or sponsored by Mistral.ai. All trademarks and registered trademarks are the property of their respective owners.
See Mistral.AI for more information.
All versions of mistral with dependencies
saloonphp/laravel-plugin Version ^v3.5
spatie/laravel-data Version ^3|^4
spatie/laravel-package-tools Version ^1.16