Active
Project:
Augmentor AI
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 May 2023 at 00:01 UTC
Updated:
17 Nov 2023 at 05:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
murrayw commentedHi fishfree. The tutorial looks good. It has a lot of prompts which could easily be wrapped up as Augmentors and exposed in the WYSIWYG or as field widgets. There are a lot of good ideas in there.
In regards to the structure data... if I get the gist of it I believe this is the prompt you are referring to:
ChatGPT retiurns data back as text - list items. From what I can see this is not JSON, although, i may be mistaken. Aslo, does ChatGPT always return data in exactly the same format.
My hunch is that the text feedback is not going to be structured enough... or it won't be structured wnough for general cases at least. If you believe that it is possible, then you could implement a specialised ChatGPT augmentor to return the data back in a structure you liked.
Augmentors do returned a keyed array, and so, they do support some structure - pretrty much what you are discussing.
For example, your Augmentor could return a structure like:
{
"score": ["10"],
"tone": ["simple"]
}
The trick will be working out how to extract the structure. Please refer to the "safe search" augmentor from Google Cloud Vision to see a bunch of keys with different values in them:
https://git.drupalcode.org/project/augmentor_google_cloud_vision/-/blob/...
I'm not sure that we would have success trying to build that into the standard ChatGPT Augmentor. The "Drupal way" would allow a hook to transform the result and so this might be onbe avenue worther considering if you needed that.
In short, I would recommend implementing your own Augmentor which is apple to translate the results to something which is more structured.
Comment #3
fishfree commented@murrayw I've test by using the prompt "Please answer in JSON format", and it worked! Maybe you can have a try.
Comment #4
fishfree commentedCan we implement a JSON parser widget just as AugmentorSelectRegexWidget.php to make it?
Comment #5
mindaugasd commentedComment #6
fishfree commentedAlthough ai_interpolator module is going to implement this feature, it is still neccessary for augmentor to make it. Because augmentor is used on the editing page with human manual curation, ai_interpolator is used totallay automatically.
Comment #7
eleonelI'm planning to work on the "Output Format" feature vert soon. It's a straightforward addition that shouldn't take long to implement. Currently, our system supports targeting multiple fields with a single API request.
For instance, take a look at this screenshot: https://www.drupal.org/files/Screenshot%202022-10-31%20at%2015-39-23%20E.... This example utilizes the Google Cloud Safe Search endpoint to analyze images for potential explicit content (more details at https://www.drupal.org/project/augmentor_google_cloud_vision).
In the widget's configuration, we have the following setup (refer to the attached image for clarity):
These keys like "racy", "medical", etc., correspond to the root-level keys returned by the augmentor. To enhance this, we're considering the introduction of multi-level key selection. This would allow configurations like `root-level:second-level:third-level` to navigate through a response structure like:
This feature will provide more flexibility in handling complex data structures returned by the augmentor.