Closed buzhou9 closed 5 months ago
Hi @buzhou9. I'm sorry to hear you are having proxy issues.
First I want to clarify your problem statement; the first example works fine if you run it in the terminal, but the second next.js example doesn't work?
May I ask what error are you getting in the second example and are you sure it is a proxy error?
If it is a proxy error, then the problem will largely depend on your pc/proxy setup and is unfortunately difficult for me to diagnose. However I can perhaps point you to areas to look at:
NextJs
API endpoints using the terminal or a tool like Postman to see if the error will still be there.This is unfortunately as much advise I can give you as proxy issues are largely dependent on the setup of the proxy itself. Furthermore, the scope of the problem is outside of the topic of Deep Chat, hence the information I can provide is limited.
Thank you for the suggestion. I'd like to try debugging locally。Both of the snippets I provided work fine, which is enough to prove that the agent is valid. The fetch method of next.js does not have server access through a proxy, which should be a problem with the next.js framework itself, which is indeed beyond the topic of deep-chat.
OpenAI/chat.ts in the next.js example is not accessible in regions where OpenAI prohibits access, even if I have the proxy turned on. But I execute JS scripts in the terminal and it can be accessed normally。
Here's what I tested the script。
This is the “chat.ts ” file I rewrote and it works fine
Why can't the agent I configure in the terminal not take effect in the fetch method of next.js?