pulsatrix 1.1.0
Loading...
Searching...
No Matches
pulsatrix::orch::ContentBlock Struct Reference

One block of a message's content. More...

#include <message.hpp>

Collaboration diagram for pulsatrix::orch::ContentBlock:

Public Types

enum class  Type {
  Text , ToolUse , ToolResult , Thinking ,
  Opaque
}
 

Static Public Member Functions

static ContentBlock Text (std::string text)
 
static ContentBlock ToolUse (std::string id, std::string name, JsonValue input)
 
static ContentBlock ToolResult (std::string tool_use_id, std::string content, bool is_error=false)
 

Public Attributes

Type type = Type::Text
 
std::string text
 Text, a tool result's content, or thinking.
 
std::string id
 A tool call's id, or for a result the id of the call it answers.
 
std::string name
 A tool call's tool name.
 
JsonValue input
 A tool call's input, a JSON object.
 
bool is_error = false
 Whether a tool result reports a failure.
 
JsonValue raw
 For Thinking and Opaque blocks, the block exactly as the provider sent it, and the provider's name in origin. The provider sends it back unchanged: the Anthropic API rejects a request whose thinking blocks were altered. Other providers skip it.
 
std::string origin
 

Detailed Description

One block of a message's content.

Member Enumeration Documentation

◆ Type

Enumerator
Text 
ToolUse 

the model calls a tool: id, name and input

ToolResult 

the answer to a ToolUse: id (the call's), text and is_error

Thinking 

the model's reasoning: text, plus the provider's block in raw

Opaque 

anything else the provider sent: raw only

Member Function Documentation

◆ Text()

static ContentBlock pulsatrix::orch::ContentBlock::Text ( std::string  text)
static

◆ ToolResult()

static ContentBlock pulsatrix::orch::ContentBlock::ToolResult ( std::string  tool_use_id,
std::string  content,
bool  is_error = false 
)
static

◆ ToolUse()

static ContentBlock pulsatrix::orch::ContentBlock::ToolUse ( std::string  id,
std::string  name,
JsonValue  input 
)
static

Member Data Documentation

◆ id

std::string pulsatrix::orch::ContentBlock::id

A tool call's id, or for a result the id of the call it answers.

◆ input

JsonValue pulsatrix::orch::ContentBlock::input

A tool call's input, a JSON object.

◆ is_error

bool pulsatrix::orch::ContentBlock::is_error = false

Whether a tool result reports a failure.

◆ name

std::string pulsatrix::orch::ContentBlock::name

A tool call's tool name.

◆ origin

std::string pulsatrix::orch::ContentBlock::origin

◆ raw

JsonValue pulsatrix::orch::ContentBlock::raw

For Thinking and Opaque blocks, the block exactly as the provider sent it, and the provider's name in origin. The provider sends it back unchanged: the Anthropic API rejects a request whose thinking blocks were altered. Other providers skip it.

◆ text

std::string pulsatrix::orch::ContentBlock::text

Text, a tool result's content, or thinking.

◆ type

Type pulsatrix::orch::ContentBlock::type = Type::Text

The documentation for this struct was generated from the following file: