Problem/Motivation
The current ECA ChatGPT promot plugin takes only one token input. However, a prompt can and will likely include multiple tokens sometimes.
Steps to reproduce
- When the "OpenAI ChatGPT ECA" is installed and configured, add a new ECA task for OpenAI/ChatGPT Chat.
- "Token input" under "Custom properties" takes only one token. If you try to input multiple tokens (i.e., comma-separated), it saves, but the task errors when token replacement is triggered in the prompt.
Proposed resolution
- Add possibility to accept multiple "Token input" in comma-separated format
- Add capability to replace multiple tokens in the prompt
Remaining tasks
- Patch / Merge request in Chat.php
- Perhaps apply this to other plugins/tasks
- Change UI labels or descriptions to indicate the possibility of entering multiple tokens in comma-separated format
- Add OpenAI ECA to the issue tracker (to be able to log such issues to that component)
User interface changes
- Naming with descriptions to guide users with the ability to input multiple tokens in comma-separated format
API changes
None.
Data model changes
None.
Issue fork openai-3413325
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mohammed j. razemComment #4
mohammed j. razemComment #5
kevinquillen commentedDoes this really need to change or can this be facilitated with other Actions? I tried to keep it minimal so this slotted in to ECA as chainable workflows.
From Jurgen:
Comment #6
jurgenhaasWell, it depends upon the field definition in the configuration form. Currently,
token_inputis defined like this:This means, ECA expects the name of a token - exactly one and really only a name. So you couldn't even use
node:bodyhere.For the use case of providing "The data input for OpenAI.", this field configuration is not ideal, I guess. I should probably be more like this:
In that case, the input could be
[node:body]or any sequence of text, containing any number of tokens.Note, the current
token_inputwith the'#eca_token_reference' => TRUE,really just expects a token name without the brackets and uses that token's data for further processing. It helps us to validate the configuration form, so that this is not providing any non-valid token name.Whenever arbitrary text content should be allowed, this is not the correct format, then it should be a text-area that allows for any input, including tokens or just a token. But then with real token syntax, i.e. with the surrounding brackets.
Comment #7
alfthecat commentedMy suggestion for an ideal solution would be to not require an "Input token" but simply allow tokens inside of the "Prompt" field. I think that is in line with what @jurgenhaas is suggesting.
I have noticed that if I store data inside of tokens, I can use those tokens in the Prompt field. But it does not support prompts like, "Summarize [entity:body]".