We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
No description provided.
The text was updated successfully, but these errors were encountered:
自问自答吧:
@service public class ChatService {
@Value("${api-key}") private String apiKey; @Value("${proxy.host}") private String proxyHost; @Value("${proxy.port}") private int proxyPort; @Value("${api-baseurl}") private String baseUrl; @Value("${api-model}") private String model; public SseEmitter createChatStream(List<Message> messages) { Proxy proxy = Proxys.http(proxyHost, proxyPort); ChatGPTStream chatGPTStream = ChatGPTStream.builder() .timeout(600) .apiKey(apiKey) .proxy(proxy) .apiHost(baseUrl) .build() .init(); SseEmitter sseEmitter = new SseEmitter(Long.MAX_VALUE); GPTEventSourceListener listener = new GPTEventSourceListener(sseEmitter); ChatCompletion chatCompletion = ChatCompletion.builder() .messages(messages) .model(model) .stream(true) .build(); chatGPTStream.streamChatCompletion(chatCompletion, listener); return sseEmitter; }
}
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: