Download the PHP package apie/ai-instructor without Composer
On this page you can find all versions of the php package apie/ai-instructor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download apie/ai-instructor
More information about apie/ai-instructor
Files in apie/ai-instructor
Package ai-instructor
Short Description Use a LLM to create an object in PHP similar to Instructor in Python
License MIT
Informations about the package ai-instructor
ai-instructor
This package is part of the Apie library. The code is maintained in a monorepo, so PR's need to be sent to the monorepo
Documentation
Instructor is a library for Python that works with LLM's to force a specific structure. Wouldn't it be nice if we have the same functionality in PHP? That's what apie/ai-instructor does. Like you have some class in PHP and ask AI to fill it in for you from a chat prompt given by the user:
Requirements
You need a OpenAI key or a valid ollama service running (in Docker or locally).
Setup
The simplest standalone setup is using any of the static methods in :
It would give a response like this:
Setup with Apie
You can also set it up with the Apie library. In This case you would need to require apie/apie-bundle for Symfony or apie/laravel-apie for Laravel to setup the key and url in the Laravel/Symfony configuration:
It is recommended to use environment variables for the api key: Symfony:
Laravel:
All versions of ai-instructor with dependencies
apie/core Version self.version
apie/serializer Version self.version
apie/schema-generator Version self.version
devizzent/cebe-php-openapi Version ^1.1.2
symfony/http-client Version ^7.2