Code Monkey home page Code Monkey logo

cloudflare-ai-worker's Introduction

cloudflare-ai-worker

使用cloudflare+openai/gemini提供的API实现一个轻量的,随时随地可访问的ai web,并且支持openai代理。

说明

需要创建一个cloudflare的Worker,复制代码库的两个文件到Worker中,然后配置两个环境变量。

  • OPENAI_KEY 填写openai的API key
  • GEMINI_API_KEY 填写gemini的API key
  • TOKEN 填写你访问服务是校验的"账号:密码"转BASE64后的编码
    • 例如:账号admin,密码123456,使用“admin:123456”通过base64编码得到的值是“YWRtaW46MTIzNDU2”
  • 【可选】R2 存储桶绑定变量ChatRecordR2(需要提前创建存储桶)
    • 绑定R2后可以存储历史会话
      image

worker

创建worker

image

创建配置

image

复制代码

image

cloudflare-ai-worker's People

Contributors

realqiyan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.