summaryrefslogtreecommitdiff
path: root/libpanto-c/include
diff options
context:
space:
mode:
Diffstat (limited to 'libpanto-c/include')
-rw-r--r--libpanto-c/include/panto.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/libpanto-c/include/panto.h b/libpanto-c/include/panto.h
index c43b39f..3b4a22a 100644
--- a/libpanto-c/include/panto.h
+++ b/libpanto-c/include/panto.h
@@ -139,13 +139,23 @@ PANTO_EXPORT void panto_message_builder_destroy(PantoMessageBuilder *builder);
PANTO_EXPORT PantoStatus panto_message_builder_add_text(PantoMessageBuilder *builder, const char *text);
/* `signature` may be NULL/empty when the provider emitted no signature, in
* which case the `signature_*` origin args are ignored. When a signature is
- * supplied, pass the origin (style/base_url/model) it was produced under so
- * the block can be replayed; an Anthropic request drops thinking blocks whose
- * signature origin does not match the request's base_url/model. */
+ * supplied you may pass the origin (style/base_url/model) it was produced
+ * under so the block can be replayed; an Anthropic request drops thinking
+ * blocks whose signature origin does not match the request's base_url/model.
+ * The origin args are OPTIONAL: pass PANTO_API_STYLE 0 and NULL base_url/model
+ * to omit them and instead rely on the enclosing message's identity (see
+ * `panto_message_builder_set_identity`), which is the preferred, per-message
+ * source of truth — no per-block identity copy required. */
PANTO_EXPORT PantoStatus panto_message_builder_add_thinking(PantoMessageBuilder *builder, const char *text, const char *signature, PantoAPIStyle signature_api_style, const char *signature_base_url, const char *signature_model);
PANTO_EXPORT PantoStatus panto_message_builder_add_tool_use(PantoMessageBuilder *builder, const char *id, const char *name, const char *input);
PANTO_EXPORT PantoStatus panto_message_builder_add_tool_result(PantoMessageBuilder *builder, const char *tool_use_id, const char *text, bool is_error);
PANTO_EXPORT PantoStatus panto_message_builder_add_system(PantoMessageBuilder *builder, const char *text, PantoSystemMode mode);
+/* Attach the wire identity (provider/style/model + reasoning) that produced
+ * this message. This is the per-message source of truth for replaying thinking
+ * signatures and is preserved through compaction, so a kept-verbatim turn is
+ * not re-stamped with the compaction model. Strings are copied. Optional; when
+ * omitted, thinking replay relies on each block's own signature origin. */
+PANTO_EXPORT PantoStatus panto_message_builder_set_identity(PantoMessageBuilder *builder, PantoAPIStyle api_style, const char *base_url, const char *model, PantoReasoningEffort reasoning);
/* Commit the builder's blocks as one message of the builder's role. Consumes
* (frees) the builder. `usage` applies to assistant turns; pass has_usage=false
* otherwise. */