- Issue created by @fishfree
- 🇦🇺Australia murrayw
Hi fishtree. 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:
Can you provide a report on the paragraph? The report should include document statistics, vocabulary statistics, readability score, tone type (available options are Formal, Informal, Optimistic, Worried, Friendly, Curious, Assertive, Encouraging, Surprised, or Cooperative), intent type (available options are Inform, Describe, Convince, or Tell A Story), audience type (available options are General, Knowledgeable, or Expert), style type (available options are Formal or Informal), emotion type (available options are Mild or Strong), and domain type (available options are General, Academic, Business, Technical, Creative, or Casual).
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. 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. It could return it as a JSON "string". The challenge then is working out how to handle JSON. Currently Augmentors pretty much assume that the response is a string and most of the integrations are set up around that.
Now, Augmentors do returned a keyed array, and so, they do support some structure - pretrty much what you are discussing.
I would recommend implementing your own Augmentor which is apple to translate the results to something which is more structured.
- 🇨🇳China fishfree
@murrayw I've test by using the prompt "Please answer in JSON format", and it worked! Maybe you can have a try.
- 🇨🇳China fishfree
Can we implement a JSON parser widget just as AugmentorSelectRegexWidget.php to make it?
- 🇨🇳China fishfree
Although 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.
- 🇯🇵Japan eleonel Itoshima 🇯🇵
I'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):
Target fields: { "0": {"target_field": "field__image_racy", "key": "racy"}, "1": {"target_field": "field_image_spoof", "key": "spoof"}, "2": {"target_field": "field_image_adult", "key": "adult"}, "3": {"target_field": "field_image_violence", "key": "violence"}, "4": {"target_field": "field_image_medical", "key": "medical"} }
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:
{ "root-level": { "second-level": { "third-level": "value" } } }
This feature will provide more flexibility in handling complex data structures returned by the augmentor.