Template: OpenAI GPT chat bot API running on Cloudflare Worker(github.com)
github.com
Template: OpenAI GPT chat bot API running on Cloudflare Worker
https://github.com/kwhitley/cloudflare-template-gpt
4 comments
Looks interesting, what is the core use case.
I'm about to start hosting apps that need a preconfigured AI context (basically feed it an opening script/instructions), for users to interact with.
This is really just to test the concept, watch the token usage rates, etc.
Since you feed in the entire script with each pass, the API side could simple prepend the origin instructions/first parts, then tack on the user input to the end.
This is really just to test the concept, watch the token usage rates, etc.
Since you feed in the entire script with each pass, the API side could simple prepend the origin instructions/first parts, then tack on the user input to the end.
Look in the openai.ts file for an example of prepending messages... in this case, I actually prepend one just to embed a random seed (otherwise the same input always gives the same response).
Instructions to get started inside the README!
Let me know if this helps, or how to improve it! :)