Package com.unfbx.chatgpt
Class OpenAiStreamClient
- java.lang.Object
-
- com.unfbx.chatgpt.OpenAiStreamClient
-
public class OpenAiStreamClient extends Object
描述: open ai 客户端- Author:
- https:www.unfbx.com 2023-02-28
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOpenAiStreamClient.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BillingUsagebillingUsage(@NotNull LocalDate starDate, @NotNull LocalDate endDate)账户调用接口消耗金额信息查询 最多查询100天static OpenAiStreamClient.Builderbuilder()构造CreditGrantsResponsecreditGrants()Deprecated.voidstreamChatCompletion(ChatCompletion chatCompletion, okhttp3.sse.EventSourceListener eventSourceListener)流式输出,最新版的GPT-3.5 chat completion 更加贴近官方网站的问答模型voidstreamChatCompletion(List<Message> messages, okhttp3.sse.EventSourceListener eventSourceListener)流式输出,最新版的GPT-3.5 chat completion 更加贴近官方网站的问答模型voidstreamCompletions(Completion completion, okhttp3.sse.EventSourceListener eventSourceListener)问答接口 stream 形式voidstreamCompletions(String question, okhttp3.sse.EventSourceListener eventSourceListener)问答接口-简易版Subscriptionsubscription()账户信息查询:里面包含总金额等信息
-
-
-
Method Detail
-
streamCompletions
public void streamCompletions(Completion completion, okhttp3.sse.EventSourceListener eventSourceListener)
问答接口 stream 形式- Parameters:
completion- open ai 参数eventSourceListener- sse监听器- See Also:
ConsoleEventSourceListener
-
streamCompletions
public void streamCompletions(String question, okhttp3.sse.EventSourceListener eventSourceListener)
问答接口-简易版- Parameters:
question- 请求参数eventSourceListener- sse监听器- See Also:
ConsoleEventSourceListener
-
streamChatCompletion
public void streamChatCompletion(ChatCompletion chatCompletion, okhttp3.sse.EventSourceListener eventSourceListener)
流式输出,最新版的GPT-3.5 chat completion 更加贴近官方网站的问答模型- Parameters:
chatCompletion- 问答参数eventSourceListener- sse监听器- See Also:
ConsoleEventSourceListener
-
streamChatCompletion
public void streamChatCompletion(List<Message> messages, okhttp3.sse.EventSourceListener eventSourceListener)
流式输出,最新版的GPT-3.5 chat completion 更加贴近官方网站的问答模型- Parameters:
messages- 问答列表eventSourceListener- sse监听器- See Also:
ConsoleEventSourceListener
-
creditGrants
@Deprecated public CreditGrantsResponse creditGrants()
Deprecated.## 官方已经禁止使用此api OpenAi账户余额查询- Returns:
- 余额信息
-
subscription
public Subscription subscription()
账户信息查询:里面包含总金额等信息- Returns:
- 个人账户信息
-
billingUsage
public BillingUsage billingUsage(@NotNull @NotNull LocalDate starDate, @NotNull @NotNull LocalDate endDate)
账户调用接口消耗金额信息查询 最多查询100天- Parameters:
starDate- 开始时间endDate- 结束时间- Returns:
- 消耗金额信息
-
builder
public static OpenAiStreamClient.Builder builder()
构造- Returns:
- Builder
-
-