csse-uoft / ckanext-udc

GNU Affero General Public License v3.0
1 stars 0 forks source link

Incorporate ChatGPT for Catalogue Entry Metadata properties #84

Open bgajdero opened 2 months ago

bgajdero commented 2 months ago

Use the test repo and code in program.py to create descriptions for catalogue entries.

The get_catalog_summary_from_openai() method takes a CKAN package and metadata and creates a prompt to ChatGPT, and retrieves the response.

Ensure parameters for max_tokens=1000 and temperature=0.0 are kept. Ensure to securely store OPENAI key to work with CKAN architecture.

Store resulting description in a new property called cudc:hasMetadataSummary, with range xsd:string.

Display the text above "Additional Information" section, under new section title "Metadata Maturity Summary". Add a disclaimer underneath, stating "This summary automatically generated by an AI model."

Allow site admin and Organization admin to have access to generate an entry description.

Ensure the following tasks are complete:

  1. Implement the relevant program.py code.
  2. Test the generation of code.
  3. On each entry "Manage" page, add a button to generate the summary, with label "Generate Summary"
  4. On the admin Config page, add a button to generate summary for any entry that does not have one, or has an empty value for cudc:hasMetadataSummary property.