It's a simple demo RAG application for the WordCamp organizers. We can easy to create a new RAG application to get a recommendation about the session on the WordCamp that you're getting involved in.
You must have a active Cloudflare account.
And please subscribe the Workers Paid
plan before delpoy this.
https://www.cloudflare.com/plans/developer-platform/#overview
% git clone git@github.com:hideokamoto/cloudflare-rag-for-wordcamp.git
% cd cloudflare-rag-for-wordcamp
% npm install
% npx wrangler vectorize create wordcamp-sessions --dimensions=1024 --metric=cosine
% npx wrangler secret put CLOUDFLARE_ACCOUNT_ID
% npx wrangler secret put CLOUDFLARE_API_TOKEN
% npx wrangler secret put WORDCAMP_NAME
% npx wrangler secret put EVENT_YEAR
% npx wrangler secret put ADMIN_USERNAME
% npx wrangler secret put ADMIN_PASSWORD
Sercet name | Value | example |
---|---|---|
CLOUDFLARE_ACCOUNT_ID | Read official document | |
CLOUDFLARE_API_TOKEN | Read official document | |
WORDCAMP_NAME | Target event name | WordCamp Asia 2024 -> asia |
EVENT_YEAR | Target event year | WordCamp Asia 2024 -> 2024 |
ADMIN_USERNAME | Basic Authentication for indexing API | admin |
ADMIN_PASSWORD | Basic Authentication for indexing API | password |
% npm run dev
or
% npm run deploy
On the following example, the application URL is `http://localhost:49705``.
% wrangler dev src/index.tsx --remote
⛅️ wrangler 3.48.0
-------------------
Using vars defined in .dev.vars
Your worker has access to the following bindings:
[wrangler:inf] Ready on http://localhost:49705
Please visit the {YOUR_APPLICATION_URL}/api/indexes
.
For example, if the application URL is http://localhost:49705
, you should visit to http://localhost:49705/api/indexes
.
The page is proctected by the BASIC Authentication. Please put the username and password that you set before.