lobe-chat
lobe-chat copied to clipboard
del err return endpoint
💻 变更类型 | Change Type
- [ ] ✨ feat
- [x] 🐛 fix
- [ ] ♻️ refactor
- [ ] 💄 style
- [ ] 🔨 chore
- [ ] 📝 docs
🔀 变更说明 | Description of Change
fix https://github.com/lobehub/lobe-chat/issues/842
📝 补充信息 | Additional Information
@CaoYunzhou is attempting to deploy a commit to the LobeHub Team on Vercel.
A member of the Team first needs to authorize it.
👍 @CaoYunzhou
Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。
只返回错误的message,不返回endpoint
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Only the error message is returned, not the endpoint.
@CaoYunzhou 其实返回 endpoint 会有 2 个场景很有用:
- 用户填入了官方的 OpenAI apikey ,但是 endpoint 在服务端已经被改成了其他的 proxy url。这个时候如果提示无效,用户就能知道当前的 endpoint 不是官方的 endpoint;
- 方便排查 proxy url 是否正确,目前存在很多用户没有填写
v1
后缀导致无法获得正常返回进而求助。例如: https://github.com/lobehub/lobe-chat/discussions/734
综上考虑我建议endpoint 的 url 字段仍然保留,但是脱敏展示。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
@CaoYunzhou In fact, there are 2 scenarios where returning endpoint is useful:
- The user filled in the official OpenAI apikey, but the endpoint has been changed to another proxy url on the server side. If the prompt is invalid at this time, the user will know that the current endpoint is not an official endpoint;
- It is convenient to check whether the proxy URL is correct. Currently, many users do not fill in the
v1
suffix, resulting in the failure to obtain normal returns and asking for help. For example: https://github.com/lobehub/lobe-chat/discussions/734
Based on the above considerations, I suggest that the url field of the endpoint should still be retained, but displayed in a desensitized manner.
@CaoYunzhou 其实返回 endpoint 会有 2 个场景很有用:
- 用户填入了官方的 OpenAI apikey ,但是 endpoint 在服务端已经被改成了其他的 proxy url。这个时候如果提示无效,用户就能知道当前的 endpoint 不是官方的 endpoint;
- 方便排查 proxy url 是否正确,目前存在很多用户没有填写
v1
后缀导致无法获得正常返回进而求助。例如: [Q&A] 使用第三方接口报错的原因? #734综上考虑我建议endpoint 的 url 字段仍然保留,但是脱敏展示。
1.这个只是一个配置baseurl的方式 2.用户自定义配置或者部署维护,应该是明确知道某个站点的url的 经供参考的PR,可能我最近被攻击了几次cloudflare的work有这个担忧
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
@CaoYunzhou In fact, there are 2 scenarios where returning endpoint is useful:
- The user filled in the official OpenAI apikey, but the endpoint has been changed to another proxy url on the server side. If the prompt is invalid at this time, the user will know that the current endpoint is not an official endpoint;
- It is convenient to check whether the proxy url is correct. Currently, many users do not fill in the
v1
suffix, resulting in the failure to obtain normal returns and seek help. For example: [Q&A] Why are errors reported when using third-party interfaces? #734Based on the above considerations, I suggest that the url field of the endpoint should still be retained, but displayed in a desensitized manner.
- This is just a way to configure baseurl
- User-defined configuration or deployment maintenance should clearly know the URL of a certain site. For reference, I may have this concern because my cloudflare work has been attacked several times recently.
在 https://github.com/lobehub/lobe-chat/pull/918 跟进。这个我关了
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Follow along at https://github.com/lobehub/lobe-chat/pull/918. I've turned this off