summaryrefslogtreecommitdiff
path: root/libpanto-c/include/panto.h
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-06-11 11:16:25 -0600
committert <t@tjp.lol>2026-06-11 11:51:54 -0600
commit6d725a9e35c3086f61cb6579d2840f5a09be450a (patch)
tree646897da7374af871381ecbbebccd8b401cfa7ee /libpanto-c/include/panto.h
parent27e37c62bc1483c0489d6db01344906472a1f8d3 (diff)
expand libpanto-go and -c to the full libpanto API surface
Diffstat (limited to 'libpanto-c/include/panto.h')
-rw-r--r--libpanto-c/include/panto.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/libpanto-c/include/panto.h b/libpanto-c/include/panto.h
index 0772e6e..94ddcb9 100644
--- a/libpanto-c/include/panto.h
+++ b/libpanto-c/include/panto.h
@@ -119,6 +119,21 @@ PANTO_EXPORT void panto_stream_destroy(PantoStream *stream);
PANTO_EXPORT PantoNextStatus panto_stream_next(PantoStream *stream, PantoEvent *out);
PANTO_EXPORT void panto_event_free(PantoEvent *event);
+/* Go/callback-oriented tool ABI. */
+typedef struct { PantoSlice name, description, schema_json; } PantoToolDecl;
+typedef struct { PantoSlice media_type; bool has_media_type; PantoSlice data; } PantoMediaPart;
+typedef enum { PANTO_RESULT_TEXT = 0, PANTO_RESULT_MEDIA = 1 } PantoResultPartTag;
+typedef struct { PantoResultPartTag tag; union { PantoSlice text; PantoMediaPart media; } data; } PantoResultPart;
+typedef struct { PantoResultPart *ptr; size_t len; } PantoResultParts;
+typedef struct { PantoSlice tool_name, input; } PantoToolCall;
+typedef struct { bool ok; PantoResultParts parts; PantoSlice error; } PantoToolCallResult;
+typedef PantoStatus (*PantoToolInvokeFn)(void *ctx, PantoSlice input, PantoResultParts *out);
+typedef PantoStatus (*PantoToolSourceInvokeBatchFn)(void *ctx, const PantoToolCall *calls, PantoToolCallResult *results, size_t len);
+typedef void (*PantoToolDestroyFn)(void *ctx);
+PANTO_EXPORT PantoStatus panto_agent_register_tool(PantoAgent *agent, PantoToolDecl decl, void *ctx, PantoToolInvokeFn invoke, PantoToolDestroyFn destroy);
+PANTO_EXPORT PantoStatus panto_agent_register_tool_source(PantoAgent *agent, PantoSlice name, const PantoToolDecl *decls, size_t len, void *ctx, PantoToolSourceInvokeBatchFn invoke_batch, PantoToolDestroyFn destroy);
+PANTO_EXPORT PantoResultParts panto_result_parts_text(const char *text);
+PANTO_EXPORT void panto_result_parts_destroy(PantoResultParts parts);
#ifdef __cplusplus
}
#endif