Download the PHP package lucianotonet/groq-php without Composer
On this page you can find all versions of the php package lucianotonet/groq-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lucianotonet/groq-php
More information about lucianotonet/groq-php
Files in lucianotonet/groq-php
Package groq-php
Short Description PHP library to access Groq REST API
License MIT
Informations about the package groq-php
Groq PHP
A powerful PHP library for seamless integration with the Groq API. This library simplifies interactions with Groq, allowing developers to effortlessly leverage its advanced language models, audio processing and vision capabilities.
Using on Laravel? Check this out: GroqLaravel
Installation
Configuration
Obtain your API key from the Groq Console and set it as an environment variable:
Usage
Initialize the Groq client:
You can also pass the API key directly to the constructor:
Configuration
You can set all configuration options via the constructor:
Or using the setConfig
method at any time:
Listing Models
Retrieve a list of available models:
Chat Capabilities
Basic Chat
Send a chat completion request:
Streaming Chat
Stream a chat completion response:
Tool Calling
Utilize tools in chat completions:
JSON Mode
Request a JSON object as the response format:
Audio Transcription
Transcribe audio content:
Audio Translation
Translate audio content:
Vision Capabilities
Analyze an image with a prompt:
Error Handling
Handle potential errors gracefully:
Timeouts
Global Timeout Configuration
Set a global timeout for all requests (in milliseconds):
Per-Request Timeout
Specify a timeout for a specific request (in milliseconds):
Semantic Versioning
This package follows SemVer conventions. However, backward-incompatible changes might be released under minor versions in the following cases:
- Changes that only affect static types and do not impact runtime behavior.
- Modifications to internal library components that are technically public but not intended for external use. (Please submit a GitHub issue if you rely on such internals).
- Changes that are not expected to affect most users in practical scenarios.