Download the PHP package lucianotonet/groq-laravel without Composer
On this page you can find all versions of the php package lucianotonet/groq-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lucianotonet/groq-laravel
More information about lucianotonet/groq-laravel
Files in lucianotonet/groq-laravel
Package groq-laravel
Short Description Laravel integration for GroqCloud
License MIT
Informations about the package groq-laravel
Groq Laravel
A Laravel package to easily integrate your application with the Groq API, providing access to popular models like Llama3, Mixtral, and others.
Installation
-
Install via Composer:
-
Publish the configuration file:
- Add your API key to the
.env
file:
Basic Usage
Chat
Available Models
Computer Vision
Audio
Batch Processing
Configuration
The package can be configured through the config/groq.php
file. The main options are:
Runtime Configuration
You can change settings during runtime:
Error Handling
The package throws GroqException
when something goes wrong:
Development
Development Installation
-
Clone the repository
- Install dependencies
Running Tests
The package includes unit and integration tests. To run them:
-
Copy the example environment file:
-
Configure your Groq API key in the
.env
file (required only for integration tests): - Run the tests:
-
All tests:
-
Unit tests only:
-
Integration tests only:
- Tests with code coverage:
Note: Unit tests don't require an API key. Integration tests will be skipped if no API key is provided.
Advanced Features
Vision API
The Vision API allows you to analyze images and extract information from them.
Example of use with image URL:
Example of use with local image file:
Remember:
- The Vision API requires a model compatible with image analysis, such as
llava-v1.5-7b-4096-preview
. You can configure the default model for Vision in theconfig/groq.php
configuration file. - The Vision API is an experimental feature and may not meet expectations, as well as not having long-term support.
Audio Transcriptions
The Groq Laravel package allows you to transcribe audio using advanced models like Whisper.
Example of transcribing an audio file:
Example with advanced options:
Audio Translations
The Groq Laravel package also provides support for direct audio translation to English text.
Basic example of audio translation:
Example with advanced options:
Step-by-Step Reasoning
Groq Laravel offers support for obtaining responses with step-by-step reasoning, useful for detailed explanations, mathematical problems, or any solution that benefits from a transparent process.
Example with raw reasoning format:
Example with parsed reasoning format:
Example with hidden reasoning:
Advanced Completions
Groq Laravel supports advanced completion features, including image analysis and response streaming.
Example with image input:
Example with streaming:
File Management
Groq Laravel allows you to manage files for use with the API.
More examples
As the GroqLaravel package is a wrapper for the GroqPHP package, you can check more examples in the GroqPHP repository.
Testing
Testing is an essential part of quality software development. The Groq Laravel package includes a test suite that covers integration, unit, and configuration. To run the tests, follow the steps below:
-
Install the project dependencies:
-
Run the tests:
or individually:
Credits
- Luciano Tonet
- All Contributors
Contributing
Contributions are welcome! Follow the guidelines described in the CONTRIBUTING.md file.
License
This package is open-source software licensed under the MIT license.
All versions of groq-laravel with dependencies
illuminate/support Version *
illuminate/contracts Version *
lucianotonet/groq-php Version ^1.2