🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
ast::ChatMessage类 参考

#include <ChatMessage.hpp>

Public 成员函数

 ChatMessage ()=default
 
 ChatMessage (EChatRole role, StringView content)
 
 ~ChatMessage ()=default
 
AST_AI_API JsonValue toJson () const
 
void setRole (EChatRole role)
 
EChatRole role () const
 
void setName (const std::string &name)
 
std::string name () const
 
void setContent (StringView content)
 
std::string content () const
 
void setReasoningContent (StringView reasoningContent)
 
std::string reasoningContent () const
 
void setToolCallId (StringView toolCallId)
 
std::string toolCallId () const
 
void setToolCalls (const JsonValue &toolCalls)
 
const JsonValuetoolCalls () const
 

静态 Public 成员函数

static ChatMessage System (StringView content)
 
static ChatMessage User (StringView content)
 
static ChatMessage Assistant (StringView content)
 
static ChatMessage Assistant (StringView content, const JsonValue &toolCalls)
 
static ChatMessage Tool (StringView content, StringView toolCallId)
 

详细描述

聊天消息

构造及析构函数说明

◆ ChatMessage()

ast::ChatMessage::ChatMessage ( EChatRole role,
StringView content )
inline

构造函数

参数
role消息角色
content消息内容

成员函数说明

◆ Assistant()

static ChatMessage ast::ChatMessage::Assistant ( StringView content)
inlinestatic

创建助手消息

参数
content助手消息内容
返回
助手消息

◆ System()

static ChatMessage ast::ChatMessage::System ( StringView content)
inlinestatic

创建系统提示消息

参数
content系统提示
返回
系统提示消息

◆ toJson()

JsonValue ast::ChatMessage::toJson ( ) const

转换为JSON值

返回
JSON值

◆ Tool()

static ChatMessage ast::ChatMessage::Tool ( StringView content,
StringView toolCallId )
inlinestatic

创建工具消息

参数
content工具消息内容
toolCallId工具调用ID
返回
工具消息

◆ User()

static ChatMessage ast::ChatMessage::User ( StringView content)
inlinestatic

创建用户消息

参数
content用户消息内容
返回
用户消息

该类的文档由以下文件生成: