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 
53  void conversation(const std::string& agent_id,
54  const std::string& query,
55  const std::optional<std::string>& chat_uid,
57 
62  void continue_conversation(const std::string& agent_id,
63  const std::string& chat_uid,
64  const std::string& message_id,
65  const AnswersByToolCall& answers,
67 
82  const std::string& agent_id,
83  const std::string& query,
84  const std::optional<std::string>& chat_uid,
87 
95  const std::string& agent_id,
96  const std::string& chat_uid,
97  const std::string& message_id,
98  const AnswersByToolCall& answers,
101 };
102 
103 } // namespace agent
104 } // 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
AgentContext & operator=(const AgentContext &ctx)
AgentContext(const AgentContext &ctx)
AgentContext(AgentContext &&ctx)
void conversation(const std::string &agent_id, const std::string &query, const std::optional< std::string > &chat_uid, AsyncCallback< AgentContext, ConversationResponse > callback) const
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 conversation_streamed(const std::string &agent_id, const std::string &query, const std::optional< std::string > &chat_uid, 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.
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