datasette / datasette-enrichments-gpt

Datasette enrichment for analyzing row data using OpenAI's GPT models

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

datasette-enrichments-gpt

PyPI Changelog Tests License

Datasette enrichment for analyzing row data using OpenAI's GPT models

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-enrichments-gpt

Configuration

This plugin needs an OpenAI API key. Configure that in metadata.yml like so

plugins:
  datasette-enrichments-gpt:
    api_key: sk-..

Or to avoid that key being visible on /-/metadata set it as an environment variable and use this:

plugins:
  datasette-enrichments-gpt:
    api_key:
      $env: OPENAI_API_KEY

Usage

Once installed, this plugin will allow users to select rows to enrich and run them through prompts using gpt-3.5-turbo, saving the result of the prompt in the specified column.

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-enrichments-gpt
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

About

Datasette enrichment for analyzing row data using OpenAI's GPT models

License:Apache License 2.0


Languages

Language:Python 89.4%Language:HTML 10.6%