Download the PHP package navi-ai/php-sdk without Composer
On this page you can find all versions of the php package navi-ai/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download navi-ai/php-sdk
More information about navi-ai/php-sdk
Files in navi-ai/php-sdk
Package php-sdk
Short Description Official PHP SDK for Navi AI Agent Platform - Build AI-powered conversations with ease
License MIT
Homepage https://github.com/deivid11/navi-ai-sdk
Informations about the package php-sdk
Navi PHP SDK
Official PHP SDK for the Navi AI Agent Platform.
Requirements
- PHP 8.1 or higher
- Composer
Installation
Or add to your composer.json:
Quick Start
Configuration
API Reference
Check API Status
Agents
List Available Agents
Get a Specific Agent
Conversations
Create a Conversation
Contact Metadata: Flat key-value pairs stored with the contact for additional information and search capabilities. Values can be strings, numbers, booleans, or null. Metadata is merged on updates (new values override existing).
List Conversations
Get a Conversation
With contact filtering (to ensure contacts only access their own conversations):
Update a Conversation
With contact filtering for authorization:
List Messages with Pagination
Close a Conversation
Chat
Streaming with Callback
Best for real-time output in CLI or streaming HTTP responses:
Streaming with Generator
For more control over the stream processing:
Synchronous (Non-Streaming)
Wait for the complete response:
With Contact Identification
You can specify the contact sending the message. This creates or retrieves a contact to associate with the message:
This is useful when:
- Multiple contacts share the same conversation (e.g., group support)
- You want to track which contact sent each message
- You need to associate messages with specific contacts in the system
- You want to store searchable metadata with contacts
With Context
Pass additional context with your message:
With Runtime Parameters
Runtime parameters are dynamic values that can be injected at execution time and referenced
in agent configurations using ${params.key} syntax. Use them for user tokens, API keys,
and other per-execution values:
Where runtime parameters can be used in agent configuration:
- MCP server headers:
Authorization: Bearer ${params.user_token} - HTTP request headers:
X-API-Key: ${params.api_key} - Custom functions:
tools.getParam('user_id') - Agent instructions:
You are helping user ${params.user_id}
Built-in parameters (automatically available):
| Parameter | Description |
|---|---|
params.current_date |
Current date (YYYY-MM-DD) |
params.current_datetime |
Full ISO datetime |
params.current_timestamp |
Unix timestamp in ms |
params.execution_id |
Unique execution identifier |
Example combining contact identification, metadata, context, and runtime parameters:
Stream Events
| Event | Description | Data |
|---|---|---|
message_created |
User message saved | userMessageId, conversationId |
reasoning_start |
Agent started thinking | - |
reasoning_delta |
Agent thinking text | text |
reasoning_complete |
Agent finished thinking | action, confidence |
tool_start |
Tool execution started | tool, args |
tool_complete |
Tool execution finished | tool, result |
response_start |
Response generation started | - |
response_delta |
Response text chunk | text |
response_complete |
Response finished | response |
complete |
Execution complete | success, executionId, assistantMessageId, stats |
error |
Error occurred | error |
Error Handling
Complete Example
License
MIT