Download the PHP package distvan/dialclient without Composer
On this page you can find all versions of the php package distvan/dialclient. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download distvan/dialclient
More information about distvan/dialclient
Files in distvan/dialclient
Package dialclient
Short Description HTTP client library built on top of Guzzle with async requests and stream support.
License MIT
Informations about the package dialclient
PHP DialClient
DIAL AI Chat Completion Task implemented in PHP. A command line chat application that communicates with the DIAL AI API.
API specification: https://dialx.ai/dial_api
Install
Basic usage (sync)
DialChatCompletions::create() returns a Message (role + content).
Local env vars (scripts)
If you want to run the included app.php locally, you can set the required environment variables using the scripts in ./scripts.
The CLI expects:
DIAL_BASE_URI(required)DIAL_DEPLOYMENT(required)DIAL_API_KEY(optional; sent asapi-keyheader)DIAL_CA_BUNDLE(optional; used as Guzzleverifypath)
DIAL_API_KEY (if set) is sent as an api-key header by app.php via DialChatCompletions.
Note: app.php currently runs the CLI in streaming mode ($app->run(true)), but it prints the final assembled answer (not token-by-token).
Bash / Git Bash
PowerShell
Run the CLI chat example
This repo includes a tiny interactive CLI chat in app.php (backed by DialClient\Application).
- Pass an optional
system_promptas the first argument. - Type
exitto quit.
PowerShell
Bash / Git Bash
SSL / cURL error 60 (Windows)
If you see cURL error 60: SSL certificate problem: unable to get local issuer certificate, PHP/cURL can't validate the certificate chain.
- Preferred fix: set
DIAL_CA_BUNDLEto the path of a PEM CA bundle (or your corporate root/intermediate CA in PEM format). Example:
Async
createAsync() returns a Promise that resolves to the decoded JSON array returned by the server.
Streaming
The API streams SSE events (data: ...) where each JSON chunk contains choices[0].delta (partial output).
The stream ends with data: [DONE].
In many deployments, early chunks may contain only role/metadata and no delta.content, and finish_reason stays null until the final chunk.
To print tokens/fragments as they arrive:
If you need access to the full decoded chunks:
If you just want the final assembled message content:
Xdebug step-debug noise (CLI)
If you see Xdebug: [Step Debug] Time-out connecting to debugging client ... when running composer test / composer phpstan, disable step-debug for the Composer process:
🌐 Join Me on CoderLegion
Check out my articles and community posts on CoderLegion!
All versions of dialclient with dependencies
guzzlehttp/guzzle Version ^7.8
guzzlehttp/promises Version ^2.0
guzzlehttp/psr7 Version ^2.6
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0