Download the PHP package ami-praha/ai-text-tool without Composer
On this page you can find all versions of the php package ami-praha/ai-text-tool. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ami-praha/ai-text-tool
More information about ami-praha/ai-text-tool
Files in ami-praha/ai-text-tool
Package ai-text-tool
Short Description OpenAI-powered text operations for Laravel with multilingual language packs.
License MIT
Informations about the package ai-text-tool
AmiPraha AiTextTool
AmiPraha\AiTextTool is a Laravel package for OpenAI-powered text operations with multilingual language packs.
Features
- Text summarization with requested output length.
- Headline generation with requested max length.
- Translation using the same output language resolution as all other operations.
- Text repair (grammar, punctuation, readability improvements).
- Native language packs for multiple languages to improve output quality with non-English source text.
Supported Languages
Languages are defined by the AmiPraha\AiTextTool\Language enum:
Language::EnglishLanguage::CzechLanguage::SlovakLanguage::GermanLanguage::Spanish
Installation
Publish package config:
Optional: publish language files so you can customize them:
Configuration
File: config/ai-text-tool.php
default_language: default language used by package (must match aLanguageenum value).custom_language_path: optional directory with language files that override package language files.openai_api_key: OpenAI API key used for chat completion requests.openai_model: OpenAI model used by package operations.openai_base_url: optional OpenAI-compatible base URL (useful for gateways/proxies).timeout: HTTP timeout in seconds.
Example:
Environment variables:
Usage
Fluent per-call output language override
All operations use the configured default_language for output. Use usingLanguage() to override the output language per call:
The override is immutable and per-call, so it does not change global config defaults.
Optional source language hint
Use fromLanguage() to tell the LLM what language the source text is written in. This is optional -- when not provided, the model detects the source language automatically.
Both usingLanguage() and fromLanguage() are immutable and can be chained in any order.
Requirements
- PHP 8.2+
- Laravel 12+
- OpenAI API key.