Skip to content
/ chatDMP Public

Demo code and Jupyter slides for the UNM Tech Days "ChatDMP" session.

Notifications You must be signed in to change notification settings

unmrds/chatDMP

Repository files navigation

ChatDMP project repository

This repository contains python and R Shiny code related to UNM Research Data Services experimentation with use of the ChatGPT Application Programming Interface (API) to generate experimental narrative research project data management plans for theoretical submission to a research sponsor as part of a broader research proposal submission.

To execute either the python or R code a ChatGPT API Key is required. Documentation for the ChatGPT API may be found here

The python code for API interaction is contained in the scripts folder and consists of an annotated Jupyter notebook (API Testing.ipynb). This python code defines collections of potential data management plan parameters (i.e. sponsor organization, type of plan, types of data and associated attributes, target repository, and documentation standards). Based upon random selection of the defined DMP values API prompts are generated both as a single narrative prompt (similar to the one that might be entered into the ChatGPT web interface), and as a colleciton of 'chat' prompts that might be entered into a sequential interaction with the ChatGPT platform. Sample API calls are then submitted to ChatGPT with the resulting DMPs and prompts that generated them being saved in the 'generated_DMPs' folder.

The R Shiny application developed for this project provides an interactive user interface for collecting individual DMP element values from a user, generating a series of ChatGPT chat completion prompts, encodes the provided data in a structured Javascript Object Notation (JSON) document that includes elements from the RDA DMP Common Standard for Machine-actionalble Data Management Plans [1], and supplemental JSON data elements related to the DMP, but not included in the RDA schema. These additional metadata elements include a representation of the corresponding ChatGPT API submission content, and if submitted to ChatGPT for processing, the DMP narrative text returned in response to the API call. The developed Shiny application is located in the shiny folder, and may be run by executing the included app.R script in RStudio, or in a hosted R Shiny platform that allows for saving of local files by the running applicaton. When run, a browser window will open and a new output JSON file will be incrementally saved in the shiny/output folder as values are entered into the user interface and if output is generated through the subnmission of an API call. Prior to running the application a shiny/config.R file must be created that contains your API key, with the format of the config.R conforming to the sample shiny/config_template.R file.

[1] Miksa, T., Walk, P., & Neish, P. (2019). RDA DMP Common Standard for Machine-actionable Data Management Plans. https://doi.org/10.15497/rda00039

About

Demo code and Jupyter slides for the UNM Tech Days "ChatDMP" session.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published