public abstract class AbstractChatDialect extends Object implements ChatDialect
| Constructor and Description |
|---|
AbstractChatDialect() |
| Modifier and Type | Method and Description |
|---|---|
org.noear.snack.ONode |
buildAssistantMessageNode(Map<Integer,ToolCallBuilder> toolCallBuilders) |
org.noear.snack.ONode |
buildChatMessageNode(ChatMessage chatMessage) |
protected void |
buildChatMessageNodeDo(org.noear.snack.ONode oNode,
AssistantMessage msg) |
protected void |
buildChatMessageNodeDo(org.noear.snack.ONode oNode,
SystemMessage msg) |
protected void |
buildChatMessageNodeDo(org.noear.snack.ONode oNode,
ToolMessage msg) |
protected void |
buildChatMessageNodeDo(org.noear.snack.ONode oNode,
UserMessage msg) |
protected void |
buildReqToolsNode(org.noear.snack.ONode n,
ChatConfig config,
ChatOptions options,
ChatMessage lastMessage)
构建请求工具节点
|
protected void |
buildReqToolsNodeDo(org.noear.snack.ONode n,
Collection<FunctionTool> tools) |
String |
buildRequestJson(ChatConfig config,
ChatOptions options,
List<ChatMessage> messages,
boolean isStream)
构建请求数据
|
List<AssistantMessage> |
parseAssistantMessage(ChatResponseDefault resp,
org.noear.snack.ONode oMessage)
分析工具调用
|
protected ToolCall |
parseToolCall(org.noear.snack.ONode n1) |
protected List<ToolCall> |
parseToolCalls(org.noear.snack.ONode toolCallsNode)
解析工具调用
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmatched, parseResponseJsonprotected void buildChatMessageNodeDo(org.noear.snack.ONode oNode,
AssistantMessage msg)
protected void buildChatMessageNodeDo(org.noear.snack.ONode oNode,
SystemMessage msg)
protected void buildChatMessageNodeDo(org.noear.snack.ONode oNode,
ToolMessage msg)
protected void buildChatMessageNodeDo(org.noear.snack.ONode oNode,
UserMessage msg)
public org.noear.snack.ONode buildChatMessageNode(ChatMessage chatMessage)
protected void buildReqToolsNode(org.noear.snack.ONode n,
ChatConfig config,
ChatOptions options,
ChatMessage lastMessage)
protected void buildReqToolsNodeDo(org.noear.snack.ONode n,
Collection<FunctionTool> tools)
public String buildRequestJson(ChatConfig config, ChatOptions options, List<ChatMessage> messages, boolean isStream)
ChatDialectbuildRequestJson in interface ChatDialectconfig - 聊天配置options - 聊天选项public org.noear.snack.ONode buildAssistantMessageNode(Map<Integer,ToolCallBuilder> toolCallBuilders)
buildAssistantMessageNode in interface ChatDialectprotected ToolCall parseToolCall(org.noear.snack.ONode n1)
public List<AssistantMessage> parseAssistantMessage(ChatResponseDefault resp, org.noear.snack.ONode oMessage)
ChatDialectparseAssistantMessage in interface ChatDialectCopyright © 2025. All rights reserved.