Download the PHP package websystems/web-prompt-creator-bundle without Composer
On this page you can find all versions of the php package websystems/web-prompt-creator-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download websystems/web-prompt-creator-bundle
More information about websystems/web-prompt-creator-bundle
Files in websystems/web-prompt-creator-bundle
Package web-prompt-creator-bundle
Short Description OpenAI prompt creator for Symfony
License MIT
Informations about the package web-prompt-creator-bundle
Web Prompt Creator
for Symfony & EasyAdmin
WPC is drag & drop builder for OpenAi (or other) prompts.
By WPC you can design advanced prompts which can send several request before final response
Requirements
- Symfony UX Vue https://symfony.com/bundles/ux-vue/current/index.html
Installation
Install WPC
Create service which will override input data $options will be used in input widget and values will be updated before send to AI
Configure EasyAdmin crud controller and add service Add PromptField and set custom option named "input" with service options
Create override template for this field in templates/admin for example. web_prompt_creator.html.twig In {% block _Prompt_prompt_widget %} Prompt is a entity name and _prompt is entity property name arguments:
- element_hidden - if true then block will show <input type="hidden"... field, if false then
- element_value - field value
- element_id - field id
- element_name - field name
- input - "input" data from your service
Add form themes to crud controller
Configure assets by adding js and css files
Usage
WPC creates JSON data which is stored in database. There are functions to handle this JSON and process to final response.
If you have an API class which is used to send requests to AI it must implements interface:
If you want to process for example in your controller, you must use dependency injection to get services:
And add important things to your webPromptCreator instance createRequests() - will send requests to ai and process all
To read final response
To read response by UID of request:
To read response data by UID of request widget:
showDummyCoversation is like createRequests() but will not send requests to AI and create PromptRequestCollection with dummy data