Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Cloudflare AI Prompt Summarizer

A usable agent-style API that accepts a textual LLM prompt (such as those found at AWS Startups Prompt Library and produces JSON output containing a name and description.

For example, the output should resemble:

{
  "name": "AWS DevOps Assistant for Startups",
  "description": "A comprehensive guide for early-stage startup founders to implement AWS best practices and DevOps principles."
}

Deployment

  1. Create a Cloudflare AI Worker application.
  2. Copy the worker.js code into the application.
  3. Define one or more API keys in the apiKeys array.
  4. Deploy the worker.

Testing

Making API calls to the deployed AI Worker will now return a response.

curl -i -H "Authorization: <your api key>" -d @full_aws_deployment_agent.prompt https://prompt-summarizer.<your-domain>.workers.dev/

Notes

  • This worker uses a small (aka free or less-expensive and quick) model to summarize the prompts. Context limits may apply to large prompts and will require truncation.
  • Small models (like llama-3.2-3b-instruct used here) do not generally support Structured Output or JSON Mode via JSON schema validation. While this implementation tends to adhere pretty well, JSON results are not enforced or guaranteed.

About

A simple Cloudflare AI Worker that accepts a prompt and summarizes it into JSON containing a 'name' and 'description'.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages