papi-ai / cohere
Cohere provider for PapiAI
v0.9.1
2026-03-10 18:12 UTC
Requires
- php: ^8.2
- ext-curl: *
- papi-ai/papi-core: ^0.9
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- pestphp/pest: ^3.0
- vimeo/psalm: ^6.0
This package is not auto-updated.
Last update: 2026-03-11 16:33:39 UTC
README
Cohere provider for PapiAI - A simple but powerful PHP library for building AI agents.
Installation
composer require papi-ai/cohere
Usage
use PapiAI\Core\Agent; use PapiAI\Cohere\CohereProvider; $provider = new CohereProvider( apiKey: $_ENV['COHERE_API_KEY'], ); $agent = new Agent( provider: $provider, instructions: 'You are a helpful assistant.', ); $response = $agent->run('Hello!'); echo $response->text;
Available Models
Chat Models
CohereProvider::MODEL_COMMAND_R_PLUS // 'command-r-plus' (default) CohereProvider::MODEL_COMMAND_R // 'command-r' CohereProvider::MODEL_COMMAND // 'command'
Embedding Models
CohereProvider::MODEL_EMBED_ENGLISH // 'embed-english-v3.0' CohereProvider::MODEL_EMBED_MULTILINGUAL // 'embed-multilingual-v3.0'
Features
- Chat completions via Cohere v2 API
- Tool/function calling
- Streaming support
- Text embeddings
License
MIT