https://github.com/ikesler/qai
Quick AI - quick and dirty AI prompting API
https://github.com/ikesler/qai
chatgpt directus fastify nodejs openai
Last synced: about 2 months ago
JSON representation
Quick AI - quick and dirty AI prompting API
- Host: GitHub
- URL: https://github.com/ikesler/qai
- Owner: ikesler
- Created: 2024-12-10T16:36:01.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-18T16:22:19.000Z (over 1 year ago)
- Last Synced: 2025-04-06T07:16:54.185Z (about 1 year ago)
- Topics: chatgpt, directus, fastify, nodejs, openai
- Language: TypeScript
- Homepage:
- Size: 73.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
A simple OpenAI chat client for using in automated flows.
Define AI assistant configurations in [Directus](https://docs.directus.io/) headless CMS and use them by calling this app like `http://localhost:3000/?q=Github&a=en_dict&t=***`. In this example:
- `http://localhost:3000` - URL of an instance of this application
- `q` - prompt to the AI
- `a` - assistant code defined in Directus
- `t` - Directus user API token (defined in the back office)
Application will send the prompt to the AI, get completion, save it to Directus DB and render the completion as a web page.
As for Directus, there are just two collections used: `qai_assistant` and `qai_completion_cache`. Corresponding interfaces can be found in `directus.ts`.
Application supports AI configurations via [HashiCorp's Vault](https://www.hashicorp.com/products/vault) or environment variables. See `.env-cmdrc.example` file.
I personally use it as a part of [Tasker's AutoShare](https://joaoapps.com/autoshare/what-it-is/) command handlers. Selecting text in any app and then sharing it to a pre-configured AI assistant: dictionary, web summary, translator, etc.
CSS borrowed from beautiful [Cactus theme](https://github.com/monkeyWzr/hugo-theme-cactus).