diff options
| author | t <t@tjp.lol> | 2026-06-18 14:15:55 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-06-18 14:16:24 -0600 |
| commit | 270cd00129551647e7c764a13836e03e0b2dc4e2 (patch) | |
| tree | f939bbf999dd67d996b4025b03dbfe4abd30b9f4 /libpanto-c/include/panto.h | |
| parent | 7c2d8825660f73198149c0b2ce26166b16ba3532 (diff) | |
preserve signature origins across compactions
Diffstat (limited to 'libpanto-c/include/panto.h')
| -rw-r--r-- | libpanto-c/include/panto.h | 16 |
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. */ |
