Giter Club home page Giter Club logo

openaiapibase's Introduction

🚀 openaiapi

用于openai的api域名中转到cloudfare pages的中转服务 🌐

🛠 使用方法

  1. 先点击点击 fork 按钮创建一个新的代码库。🍴
  2. 然后去到 cloudfare pages 创建一个pages项目,然后把代码库中的代码复制到pages项目中,然后就可以使用了 🌪 01.png 02.png 03.png 04.png 05.png 06.png 07.png

📝 使用说明

使用的时候需要替换openai的api域名为:把官方接口的https://api.openai.com 替换为 https://xxx.pages.dev 即可 👌

Python 调用可以这样 👩‍💻:

import os
os.environ['OPENAI_API_BASE']='https://xxx.pages.dev/v1'

这样就完成系统的域名替换了,可以正常使用了 🎊

如果不在代码中设置环境变量,也可以在系统环境变量中设置 OPENAI_API_BASE,这样也可以正常使用 ✨

比如在 windows 系统中,可以在系统环境变量中设置 OPENAI_API_BASE,这样就可以正常使用了 🖥

🌍 环境变量设置

1️⃣ 第一步,按下“win+r”键,打开运行框 🪟

2️⃣ 第二步,输入命令“control system” 📝

3️⃣ 第三步,在控制面板主页,打开“高级系统设置” ⚙️

4️⃣ 第四步,在高级系统设置界面,选择“环境变量”选项 🔄

5️⃣ 第五步,根据需求进行设置 ✅

参考

https://github.com/opentdp/openai-chat

openaiapibase's People

Contributors

xingyu-zhong 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.