Skip to content

Messaging

Open in ChatGPT Open in Claude

Send messages to your agent as if the user typed them, blending conversation, actions, and UI components into your product flows.

Every call references your Agent API Name, found in Agent Studio → Setup.

Call agent methods once the SDK is ready.

foldspace("when", "ready", () => {
const agent = foldspace.agent({ /* …common setup… */ });
// Now you can call any of the methods below:
agent.message("What actions can you do?");
});

Send a chat message as if the user typed it into the agent. Returns the agent instance for chaining.

ParameterTypeDescription
textstringThe message content to send.
foldspace.agent("myproduct-agentic-agent")
.message("Configure brand settings for me");

Because text is a plain string, you can interpolate runtime values and chain other methods such as .open().

const userName = "John";
agent("myproduct-agentic-agent")
.message(`Hi ${userName}, let's review your pipeline today`)
.open();