Git Product home page Git Product logo

Comments (6)

LiangYang666 avatar LiangYang666 commented on July 20, 2024 1

app = Flask(name)
app.config['SECRET_KEY'] = os.urandom(24)

os.environ['HTTP_PROXY'] = 'socks5://127.0.0.1:7890'
os.environ['HTTPS_PROXY'] = 'socks5://127.0.0.1:7890'
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") # 从环境变量中获取api_key,或直接设置api_key

openai.api_key = OPENAI_API_KEY
STREAM_FLAG = True # 是否开启流式推送
USER_SAVE_MAX = 12 # 设置最多存储12个用户,当用户过多时可适当调大
chat_context_number_max = 5 # 连续对话模式下的上下文最大数量
lock = threading.Lock() # 用于线程锁

具体是这一行,将等号后面的改成你的apikey加引号即可,OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")

from chatgpt-web.

xdtxAM avatar xdtxAM commented on July 20, 2024

哇哦我一直使用的是OPENAI_API_KEY = os.getenv("填写openai")怪不得无法通过
还有一个问题想要请教一下,clash for Windows的代理是正常的,openai网站访问也正常,
os.environ['HTTP_PROXY'] = 'socks5://127.0.0.1:7890'
os.environ['HTTPS_PROXY'] = 'socks5://127.0.0.1:7890'
这两行代码我还需要修改吗?确实是7890端口

from chatgpt-web.

LiangYang666 avatar LiangYang666 commented on July 20, 2024

哇哦我一直使用的是OPENAI_API_KEY = os.getenv("填写openai")怪不得无法通过
还有一个问题想要请教一下,clash for Windows的代理是正常的,openai网站访问也正常,
os.environ['HTTP_PROXY'] = 'socks5://127.0.0.1:7890'
os.environ['HTTPS_PROXY'] = 'socks5://127.0.0.1:7890'
这两行代码我还需要修改吗?确实是7890端口

不用修改,但是clash软件主页你要打开允许局域网连接,即勾选allow lan

from chatgpt-web.

xdtxAM avatar xdtxAM commented on July 20, 2024

哇哦我一直使用的是OPENAI_API_KEY = os.getenv("填写openai")怪不得无法通过
还有一个问题想要请教一下,clash for Windows的代理是正常的,openai网站访问也正常,
os.environ['HTTP_PROXY'] = 'socks5://127.0.0.1:7890'
os.environ['HTTPS_PROXY'] = 'socks5://127.0.0.1:7890'
这两行代码我还需要修改吗?确实是7890端口

不用修改,但是clash软件主页你要打开允许局域网连接,即勾选allow lan

非常感谢,我正在尝试,感谢您。

from chatgpt-web.

xdtxAM avatar xdtxAM commented on July 20, 2024

哇哦我一直使用的是OPENAI_API_KEY = os.getenv("填写openai")怪不得无法通过
还有一个问题想要请教一下,clash for Windows的代理是正常的,openai网站访问也正常,
os.environ['HTTP_PROXY'] = 'socks5://127.0.0.1:7890'
os.environ['HTTPS_PROXY'] = 'socks5://127.0.0.1:7890'
这两行代码我还需要修改吗?确实是7890端口

不用修改,但是clash软件主页你要打开允许局域网连接,即勾选allow lan

非常感谢,我已经测试成功了。我是使用的是clash 给出的命令:export https_proxy=http://127.0.0.1:7890;export http_proxy=http://127.0.0.1:7890;export all_proxy=socks5://127.0.0.1:7890现在终端运行了一下这个命令,然后运行程序就可以通过了。

这种方式可能就没用到 clash 里面的局域网链接。
因为我打开局域网链接。
image
这玩意儿是个红色的 lo,确实相比终端命令,这个方便一些,但是不清楚我应该设置全局还是规则就可以。我的机场是 glados 赔钱机场 一元机场。您能在主页教程可以更新一些相关信息,也可以推荐一下您的机场,

谢谢谢谢୧(๑•̀◡•́๑)૭学习了。

from chatgpt-web.

LiangYang666 avatar LiangYang666 commented on July 20, 2024

哇哦我一直使用的是OPENAI_API_KEY = os.getenv("填写openai")怪不得无法通过
还有一个问题想要请教一下,clash for Windows的代理是正常的,openai网站访问也正常,
os.environ['HTTP_PROXY'] = 'socks5://127.0.0.1:7890'
os.environ['HTTPS_PROXY'] = 'socks5://127.0.0.1:7890'
这两行代码我还需要修改吗?确实是7890端口

不用修改,但是clash软件主页你要打开允许局域网连接,即勾选allow lan

非常感谢,我已经测试成功了。我是使用的是clash 给出的命令:export https_proxy=http://127.0.0.1:7890;export http_proxy=http://127.0.0.1:7890;export all_proxy=socks5://127.0.0.1:7890现在终端运行了一下这个命令,然后运行程序就可以通过了。

这种方式可能就没用到 clash 里面的局域网链接。
因为我打开局域网链接。
image
这玩意儿是个红色的 lo,确实相比终端命令,这个方便一些,但是不清楚我应该设置全局还是规则就可以。我的机场是 glados 赔钱机场 一元机场。您能在主页教程可以更新一些相关信息,也可以推荐一下您的机场,

谢谢谢谢୧(๑•̀◡•́๑)૭学习了。

全局和规则都可以,机场就不直接评论推荐了哈哈,有需要邮件私聊

from chatgpt-web.

Related Issues (20)

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.