diff --git a/README.md b/README.md index 6dd8851..0d14c39 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
- -
Make your AI system smarter.
@@ -16,6 +16,8 @@ openssl rand -base64 32 After generating the key, paste it as the `ENCRYPTION_KEY` value from the `.env.local` file. +Include all emails that should be able to sign in to the application on the `ALLOWED_EMAILS` environment variable. + You're good to go now. Install the dependencies and run the development server: ```sh @@ -38,4 +40,17 @@ Take a look at the `.env.example` file to see which environment variables you ne This project is deployed using [Vercel](https://vercel.com/). You can deploy your own instance using the button below (feel free to deploy it anywhere else): -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/eutiveumsonho/hitl) +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/eutiveumsonho/chiron) + +## Human-in-the-loop sequence + +```mermaid +sequenceDiagram + Human->>+Chiron: Accesses the service based on the ALLOWED_EMAILS list + Human->>+Chiron: Provides vendor information (via API Management page) + Chiron->>+Human: Outputs vendor-specific API keys + Human->>+App: Configures App to hit Chiron with given API keys + App->>+Chiron: Hits Chiron with any data generated by AI (or not) + Human->>+Chiron: Review generated data (Human-in-the-loop) + Chiron->>+App: Hits App back with reviewed data +``` \ No newline at end of file diff --git a/containers/completions.js b/containers/completions.js index c8d7930..2ef584f 100644 --- a/containers/completions.js +++ b/containers/completions.js @@ -36,10 +36,10 @@ export function CompletionsContainer(props) { return completion[0]._id === JSON.parse(selected.item)._id; })[1]; - if ( - !completionWithForeignKey?.[CHIRON_VENDOR_ID] || - !completionWithForeignKey?.[CHIRON_FOREIGN_KEY] - ) { + const vendorId = completionWithForeignKey?.[CHIRON_VENDOR_ID]; + const foreignKey = completionWithForeignKey?.[CHIRON_FOREIGN_KEY]; + + if (!vendorId || !foreignKey) { setReviewing(false); return alert("Missing data"); } @@ -50,8 +50,8 @@ export function CompletionsContainer(props) { direction, data: { ...JSON.parse(data), - [CHIRON_VENDOR_ID]: selected[CHIRON_VENDOR_ID], - [CHIRON_FOREIGN_KEY]: selected[CHIRON_FOREIGN_KEY], + [CHIRON_VENDOR_ID]: vendorId, + [CHIRON_FOREIGN_KEY]: foreignKey, }, }), }); @@ -59,6 +59,7 @@ export function CompletionsContainer(props) { if (res.status !== 200) { alert(res.statusText); } else { + // TODO: Refetch on success to refresh data in the UI alert("Sucess"); } diff --git a/lib/fetch.js b/lib/fetch.js index 45e967c..9992da6 100644 --- a/lib/fetch.js +++ b/lib/fetch.js @@ -5,6 +5,7 @@ export async function f(input, init = {}) { return fetch(url, { ...init, + cache: "no-cache", // 'force-cache' is the default in Next.js 🤦 headers: headers(), }); } diff --git a/package.json b/package.json index 1027f5b..609bb62 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "hitl", + "name": "chiron", "version": "0.1.0", "private": true, "scripts": {