pezzolabs / pezzo

🕹️ Open-source, developer-first LLMOps platform designed to streamline prompt design, version management, instant delivery, collaboration, troubleshooting, observability and more.
https://pezzo.ai
Apache License 2.0
2.55k stars 211 forks source link

可配置的 OPENAI API BASH #187

Closed deTian0 closed 1 year ago

deTian0 commented 1 year ago

Proposal

在配置文件中增加 OPENAI API BASH 属性,openai 对象 可以通过读取 这个属性配置 OPENAI API BASH

Add the 'OPENAI API BASH' property to the configuration file, and openai objects can configure 'OPENAI API BASH' by reading this property

Use-Case

在一些国家的网络环境中,openai 官网 是不允许访问的。增加这个功能可以使用某些代理网站或者搭建本地的 openai 环境完成 提示测试 In some countries, the openai website is not allowed to be accessed. This feature can be added by using some proxy website or setting up a local openai environment to complete prompt testing

如果有人遇到同样的问题(openai 网络环境不允许访问)。可以更改 server 容器中的 main.js:10935 行 加入以下代码 If someone encounters the same problem (the openai network environment does not allow access). You can change the main.js:10935 line in the server container to include the following code

configuration.baseURL = "xxxxxxxxxxxxx";
this.openai = new openai_1.default(configuration);
this.chat = new Chat(pezzo,this.openai)

Is this a feature you are interested in implementing yourself?

No

deTian0 commented 1 year ago

也许这个修改可以实现这个功能,但是我的机器环境不方便进行这个测试 Perhaps this modification will do the trick, but my machine environment is not convenient for this test

pezzo/apps/server/src/app/prompt-tester/prompt-tester.service.ts line 42


 apiKey: testerApiKey,
 baseURL = process.env["OPENAI_API_KEY"]
wuzhiping commented 1 year ago

OPENAI API BASH -- > OPENAI_API_BASE

arielweinberger commented 1 year ago

Closing as I don't plan to implement this at the moment - need to see more demand. Feel free to create a pull request if you need it urgently :) Let me know if you need support.