| Package | Description |
|---|---|
| com.plexpt.chatgpt | |
| com.plexpt.chatgpt.entity.chat | |
| com.plexpt.chatgpt.util |
| Modifier and Type | Method and Description |
|---|---|
ChatCompletionResponse |
ChatGPT.chatCompletion(List<Message> messages)
简易版
|
void |
ChatGPTStream.streamChatCompletion(List<Message> messages,
okhttp3.sse.EventSourceListener eventSourceListener)
流式输出
|
| Modifier and Type | Field and Description |
|---|---|
private Message |
ChatChoice.delta
请求参数stream为true返回是delta
|
private Message |
ChatChoice.message
请求参数stream为false返回是message
|
| Modifier and Type | Method and Description |
|---|---|
static Message |
Message.of(String content) |
static Message |
Message.ofAssistant(String content) |
static Message |
Message.ofFunction(String function) |
static Message |
Message.ofSystem(String content) |
| Modifier and Type | Field and Description |
|---|---|
private static Map<String,List<Message>> |
ChatContextHolder.context |
| Modifier and Type | Method and Description |
|---|---|
static List<Message> |
ChatContextHolder.get(String id)
获取对话历史
|
| Modifier and Type | Method and Description |
|---|---|
static void |
ChatContextHolder.add(String id,
Message message)
添加对话
|
| Modifier and Type | Method and Description |
|---|---|
static int |
TokensUtil.tokens(String modelName,
List<Message> messages)
计算tokens
|
Copyright © 2023. All rights reserved.