StaticnewList the Workspaces the current account belongs to.
const { Config, AgentContext } = require('longbridge');
const ctx = AgentContext.new(config);
const resp = await ctx.workspaces();
console.log(resp);
List the Agents in the specified Workspace.
page/limit control pagination; name fuzzy-searches by Agent name.
All three are optional.
const { Config, AgentContext } = require('longbridge');
const ctx = AgentContext.new(config);
const resp = await ctx.agents(workspaceId);
console.log(resp);
Optionalpage: number | nullOptionallimit: number | nullOptionalname: string | nullList all publicly available Agents on the platform (the Explore catalog). Not scoped to a Workspace.
Optionalpage: number | nullOptionallimit: number | nullOptionalname: string | nullStart a conversation with the specified Agent, blocking until the run succeeds, is interrupted, or fails.
parentMessageId is the messageId from a previous response. Pass it
when asking a follow-up in an existing conversation to attach the new
message after the specified one, keeping the message stream in order. It
is only valid together with chatUid, the parent message must belong to
that conversation, and it must not be set for a new conversation.
const { Config, AgentContext } = require('longbridge');
const ctx = AgentContext.new(config);
const resp = await ctx.conversation(agentId, "How has Tesla stock performed recently?");
console.log(resp);
OptionalchatUid: string | nullOptionalparentMessageId: string | nullResume an interrupted conversation, blocking until the run succeeds, is interrupted again, or fails.
answersByToolCall is keyed by toolCallId (see Interrupt), each
value being a map of question text to answer.
Start a conversation with the specified Agent, invoking callback for
every progress event observed over SSE, and resolving to the final
ConversationResponse once the run finishes (this is the same shape
conversation returns).
const { Config, AgentContext } = require('longbridge');
const ctx = AgentContext.new(config);
const resp = await ctx.conversationStreamed(
agentId,
"How has Tesla stock performed recently?",
undefined,
undefined,
(err, event) => console.log(event),
);
console.log(resp);
parentMessageId behaves as in conversation.
Resume an interrupted conversation, invoking callback for every
progress event observed over SSE, and resolving to the final
ConversationResponse once the run finishes.
answersByToolCall is keyed by toolCallId (see Interrupt), each
value being a map of question text to answer.
AI Agent conversation context.
Reference: https://open.longbridge.com/en/docs/ai/chat/conversation