Longbridge OpenAPI C++ SDK
Classes | Typedefs | Enumerations
longbridge::agent Namespace Reference

Classes

class  AgentContext
 AI Agent conversation context. More...
 
struct  Workspace
 A Workspace the current account belongs to. More...
 
struct  WorkspacesResponse
 Response for AgentContext::workspaces. More...
 
struct  Agent
 An Agent in a Workspace. More...
 
struct  AgentsResponse
 Response for AgentContext::agents. More...
 
struct  GetAgentsOptions
 Options for AgentContext::agents (all fields optional). More...
 
struct  Reference
 A source referenced by the answer. More...
 
struct  QuestionOption
 One option of a Question. More...
 
struct  Question
 One question the Agent needs you to answer. More...
 
struct  Interrupt
 
struct  AgentError
 Present when a conversation run failed. More...
 
struct  ConversationResponse
 
struct  ChatStartedPayload
 Payload of a ChatStarted conversation stream event. More...
 
struct  MessagePayload
 
struct  WorkflowStartedInputs
 inputs of a WorkflowStarted conversation stream event. More...
 
struct  WorkflowStartedPayload
 
struct  ThinkingStartedPayload
 
struct  ThinkingFinishedPayload
 
struct  NodeToolUseStartedPayload
 
struct  NodeToolUseOutputs
 
struct  NodeToolUseFinishedPayload
 
struct  SubagentStartedPayload
 
struct  SubagentProgressPayload
 
struct  SubagentOutputs
 outputs of a SubagentFinished conversation stream event. More...
 
struct  SubagentFinishedPayload
 Payload of a SubagentFinished conversation stream event. More...
 
struct  AgentToolStartedPayload
 
struct  AgentToolProgressPayload
 
struct  AgentToolFinishedPayload
 Payload of an AgentToolFinished conversation stream event. More...
 
struct  QueryMaskedPayload
 
struct  PlanChangedPayload
 
struct  ContextCompressStartedPayload
 
struct  ContextCompressFinishedPayload
 
struct  ChatFinishedPayload
 
struct  ChatTitleUpdatedPayload
 
struct  ConversationStreamEvent
 

Typedefs

using AnswersByToolCall = std::map< std::string, std::map< std::string, std::string > >
 

Enumerations

enum class  ConversationStatus { Succeeded , Interrupted , Failed , Stopped }
 Final run status of a conversation. More...
 
enum class  ConversationStreamEventKind {
  ChatStarted , WorkflowStarted , Message , Ping ,
  ThinkingStarted , ThinkingFinished , NodeToolUseStarted , NodeToolUseFinished ,
  SubagentStarted , SubagentProgress , SubagentFinished , AgentToolStarted ,
  AgentToolProgress , AgentToolFinished , HumanInteractionRequired , QueryMasked ,
  PlanChanged , ContextCompressStarted , ContextCompressFinished , ChatFinished ,
  WorkflowFinished , ChatTitleUpdated , Other
}
 

Typedef Documentation

◆ AnswersByToolCall

using longbridge::agent::AnswersByToolCall = typedef std::map<std::string, std::map<std::string, std::string> >

Answers keyed by tool_call_id, then by question text — mirrors the Rust core's HashMap<String, HashMap<String, String>> (see the C layer's lb_answers_by_tool_call_entry_t/lb_answer_question_t, which flatten this nested map into arrays since C has no native map type).

Enumeration Type Documentation

◆ ConversationStatus

Final run status of a conversation.

Enumerator
Succeeded 

The run completed successfully.

Interrupted 

The run is paused, waiting for AgentContext::continue_conversation.

Failed 

The run failed.

Stopped 

The run was stopped.

◆ ConversationStreamEventKind

Kind of a ConversationStreamEvent. Only the field matching this kind is populated, the others are std::nullopt.

Enumerator
ChatStarted 

The run has started; chat_started is populated.

WorkflowStarted 

Observed right after ChatStarted on every run seen so far; workflow_started is populated

Message 

An incremental piece of the answer; message is populated.

Ping 

A heartbeat with no payload, observed at arbitrary points in the stream (including in between Message chunks); every field below is std::nullopt

ThinkingStarted 

The Agent has entered the reasoning phase; thinking_started is populated

ThinkingFinished 

The reasoning phase is over; thinking_finished is populated.

NodeToolUseStarted 

An ordinary tool call has started; node_tool_use_started is populated

NodeToolUseFinished 

An ordinary tool call has ended; node_tool_use_finished is populated

SubagentStarted 

The Agent has spawned a subagent to work on a sub-task; subagent_started is populated

SubagentProgress 

The subagent has called one of its own tools; subagent_progress is populated

SubagentFinished 

The subagent has finished its sub-task; subagent_finished is populated

AgentToolStarted 

The Agent has delegated to another Agent as a tool; agent_tool_started is populated

AgentToolProgress 

The delegated Agent has called one of its own tools; agent_tool_progress is populated

AgentToolFinished 

The delegated Agent's run has finished; agent_tool_finished is populated

HumanInteractionRequired 

The run is paused: the Agent needs more information or confirmation from you; human_interaction_required is populated. Unlike WorkflowFinished, this is emitted instead of (never alongside) WorkflowFinished for the same run

QueryMasked 

Sensitive content in the user query was masked before processing; query_masked is populated

PlanChanged 

The Agent created or updated its task plan; plan_changed is populated

ContextCompressStarted 

A context-compression pass has started; context_compress_started is populated

ContextCompressFinished 

The context-compression pass has finished; context_compress_finished is populated

ChatFinished 

Observed once all Message events for this round have been sent; chat_finished is populated

WorkflowFinished 

The run finished successfully, with a failure, or stopped by the user; workflow_finished is populated. Never emitted for an interrupted run — see HumanInteractionRequired for that case

ChatTitleUpdated 

The server auto-generating a short title for the conversation; chat_title_updated is populated

Other 

An event type not recognized by this SDK version; other_json is populated with the raw event JSON