sdkHosted AI, explicit consent

Analyze sentiment

pipeline.analyzeSentiment

Run the SentimentAgent on a conversation: classifies the prospect across the canonical 7 stages (initial, interested, neutral, objection, meeting_ready, closed_lost, closed_won) and updates the conversation_contexts row. Pass the full conversation object plus its messages - the agent uses the message thread, not the chat_id alone.

Parameters

workspaceId
string
Optional workspace ID or slug. Required when this credential can access multiple workspaces and no workspace was configured on the client.
decisionOverride
object
No description.
workspaceSlug
string
Required for Clerk auth. Ignored when using API key (workspace inferred from key).
conversationrequired
object
Required. The conversation object (must include chat_id).
messages
object[]
Message thread to analyze.
currentTags
string[]
Existing conversation tags so the agent can update incrementally.
allowHostedAi
boolean
Must be true when this operation uses Pipeline hosted inference.

Example

TypeScripttypescript
await pipeline.analyzeSentiment({
"conversation": {},
"allowHostedAi": true
})

Response

The operation is available, but its typed response schema has not been published yet.

Exceptions

PipelineError
Thrown for validation, authentication, JSON-RPC, HTTP, and network failures. Inspect code and data when present.
Pipeline TypeScript SDK documentation | Pipeline