Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一个成功的案例 #26

Open
jcheny opened this issue Dec 14, 2022 · 4 comments
Open

一个成功的案例 #26

jcheny opened this issue Dec 14, 2022 · 4 comments

Comments

@jcheny
Copy link

jcheny commented Dec 14, 2022

首先我当前使用的版本是1.1.2
先使用代理登录上去,这个时候,去复制cookie中的值一定要断开vpn然后刷新一下页面(这个很重要,不然就会提示403),再去复制值

        private static final String sessionToken = "你复制出来的__Secure-next-auth.session-token";
        private static final String cf_clearance = "你复制出来的cf_clearance";
        private static final String user_agent = "客户端代理";
        Chatbot chatbot = new Chatbot(sessionToken,cf_clearance,user_agent);
        Map<String, Object> chatResponse = chatbot.getChatResponse("怎么把chatGPT接入到java程序呢");
        System.out.println(chatResponse.get("message"));

启动的时候会有点慢,耐心等待即可。

以上就是我成功的案例,希望能够帮到你。

@Ling-jia
Copy link

我的会崩溃,报“java.lang.ExceptionInInitializerError”在“Map<String, Object> chatResponse = chatbot.getChatResponse("怎么把chatGPT接入到java程序呢");”这一行,请问知道为啥吗

@jcheny
Copy link
Author

jcheny commented Dec 16, 2022

我的会崩溃,报“java.lang.ExceptionInInitializerError”在“Map<String, Object> chatResponse = chatbot.getChatResponse("怎么把chatGPT接入到java程序呢");”这一行,请问知道为啥吗

你可以打断点进去看看程序的执行,不过你可以检查一下你的参数是否都ok

@PlexPt PlexPt mentioned this issue Dec 17, 2022
@hongshunanhai
Copy link

从浏览器复制出来以后还是会403

@asleepyfish
Copy link

ookie中的值一定要断开vpn然后

那这个是不是只能用的时候去获取sessionToken和cf_clearance啊,然后如果403了还得自己去手动重新获取这两个值才能用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants