Longbridge OpenAPI C++ SDK
agent_context.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <map>
4 
5 #include "async_result.hpp"
6 #include "callback.hpp"
7 #include "config.hpp"
8 #include "push.hpp"
9 #include "types.hpp"
10 
12 
13 namespace longbridge {
14 namespace agent {
15 
20 using AnswersByToolCall = std::map<std::string, std::map<std::string, std::string>>;
21 
24 {
25 private:
26  const lb_agent_context_t* ctx_;
27 
28 public:
34 
36 
38  static AgentContext create(const Config& config);
39 
42 
44  void agents(const std::string& workspace_id,
45  const std::optional<GetAgentsOptions>& opts,
47 
50  void public_agents(const std::optional<GetAgentsOptions>& opts,
52 
63  void conversation(const std::string& agent_id,
64  const std::string& query,
65  const std::optional<std::string>& chat_uid,
66  const std::optional<std::string>& parent_message_id,
68 
73  void continue_conversation(const std::string& agent_id,
74  const std::string& chat_uid,
75  const std::string& message_id,
76  const AnswersByToolCall& answers,
78 
98  const std::string& agent_id,
99  const std::string& query,
100  const std::optional<std::string>& chat_uid,
101  const std::optional<std::string>& parent_message_id,
104 
112  const std::string& agent_id,
113  const std::string& chat_uid,
114  const std::string& message_id,
115  const AnswersByToolCall& answers,
118 };
119 
120 } // namespace agent
121 } // namespace longbridge
struct lb_agent_context_t lb_agent_context_t
Definition: agent_context.hpp:11
Definition: config.hpp:16
AI Agent conversation context.
Definition: agent_context.hpp:24
void continue_conversation(const std::string &agent_id, const std::string &chat_uid, const std::string &message_id, const AnswersByToolCall &answers, AsyncCallback< AgentContext, ConversationResponse > callback) const
void conversation(const std::string &agent_id, const std::string &query, const std::optional< std::string > &chat_uid, const std::optional< std::string > &parent_message_id, AsyncCallback< AgentContext, ConversationResponse > callback) const
AgentContext & operator=(const AgentContext &ctx)
AgentContext(const AgentContext &ctx)
AgentContext(AgentContext &&ctx)
void agents(const std::string &workspace_id, const std::optional< GetAgentsOptions > &opts, AsyncCallback< AgentContext, AgentsResponse > callback) const
List the Agents in the specified Workspace.
AgentContext(const lb_agent_context_t *ctx)
void continue_conversation_streamed(const std::string &agent_id, const std::string &chat_uid, const std::string &message_id, const AnswersByToolCall &answers, PushCallback< AgentContext, ConversationStreamEvent > on_event, AsyncCallback< AgentContext, ConversationResponse > callback) const
void workspaces(AsyncCallback< AgentContext, WorkspacesResponse > callback) const
List the Workspaces the current account belongs to.
void public_agents(const std::optional< GetAgentsOptions > &opts, AsyncCallback< AgentContext, AgentsResponse > callback) const
void conversation_streamed(const std::string &agent_id, const std::string &query, const std::optional< std::string > &chat_uid, const std::optional< std::string > &parent_message_id, PushCallback< AgentContext, ConversationStreamEvent > on_event, AsyncCallback< AgentContext, ConversationResponse > callback) const
static AgentContext create(const Config &config)
Create an AgentContext from a Config.
std::map< std::string, std::map< std::string, std::string > > AnswersByToolCall
Definition: agent_context.hpp:20
Definition: agent_context.hpp:13
std::function< void(PushEvent< Ctx, T >)> PushCallback
Definition: push.hpp:27
std::function< void(AsyncResult< Ctx, T >)> AsyncCallback
Definition: async_result.hpp:48