This project is a PHP command-line tool based on Symfony Console. It allows you to analyze text or images to generate tags or descriptions using a large language model (LLM). The features are as follows:
- text-to-tags: Analyze a text to generate a list of tags.
- pictures-to-tags: Analyze one or more pictures to generate a list of tags.
- text-to-description: Analyze a text to generate a complete description.
- pictures-to-description: Analyze one or more pictures to generate a complete description.
- PHP 7.4 or higher
- Composer
- An account and API key for a large language model (LLM) service such as OpenAI or Perplexity.
-
Clone the project repository:
git clone https://github.com/acseo/eshop-ai-tools cd eshop-ai-tools -
Install the dependencies using Composer:
composer install
-
text-to-tags
Analyze a text to generate tags.
php bin/eshop-ai-tools text-to-tags "Your text here" --apiKey="your_api_key"
Options:
--baseUri: Specify the LLM API endpoint (default isapi.openai.com/v1).--apiKey: API key for authentication.--existingTags: List of existing tags that can be used (ex:--existingTags="tag1" --existingTags="tag2").--locale: Language to use (default isen_US).--model: Model to use (default isgpt-4o-mini).
-
pictures-to-tags
Analyze one or more pictures to generate tags.
php bin/eshop-ai-tools pictures-to-tags image1.jpg image2.png --apiKey="your_api_key"Similar options as
text-to-tags. -
text-to-description
Analyze a text to generate a complete description.
php bin/eshop-ai-tools text-to-description "Your text here" --apiKey="your_api_key"
Similar options as
text-to-tags. -
pictures-to-description
Analyze one or more pictures to generate a complete description.
php bin/eshop-ai-tools pictures-to-description image1.jpg image2.png --apiKey="your_api_key"Similar options as
text-to-tags. -
pictures-to-product
Analyze a picture and tranform it to a product
php bin/eshop-ai-tools pictures-to-product product.jpg --apiKey="your_api_key"Similar options as
text-to-tags.
You can configure default options such as baseUri and locale directly in the code or via environment variables.
The Perplexity API only accepts plain text messages in the content field. Sending multimodal data (such as images, audio, or objects like image_url) is not supported at this time. Any attempt to send non-text content will result in an error such as “Message content was empty.”
See the official documentation for supported formats.
This project was developed by the ACSEO team.
This project is licensed under the MIT License.