|
Entropic 2.3.8
Local-first agentic inference engine
|
Function pointer types for core-to-inference communication. More...
#include <stddef.h>

Go to the source code of this file.
Typedefs | |
| typedef int(* | entropic_generate_fn) (const char *messages_json, const char *params_json, char **result_json, void *user_data) |
| Generate a response (batch mode). | |
| typedef int(* | entropic_generate_streaming_fn) (const char *messages_json, const char *params_json, void(*on_token) (const char *token, size_t len, void *user_data), void *token_user_data, int *cancel, void *user_data) |
| Generate a response with streaming. | |
| typedef int(* | entropic_route_fn) (const char *messages_json, char **result_json, void *user_data) |
| Route messages to determine tier. | |
| typedef int(* | entropic_complete_fn) (const char *prompt, const char *params_json, char **result_json, void *user_data) |
| Raw text completion without chat template. | |
| typedef int(* | entropic_parse_tool_calls_fn) (const char *raw_content, char **cleaned_content, char **tool_calls_json, void *user_data) |
| Parse tool calls from raw model output. | |
| typedef int(* | entropic_is_response_complete_fn) (const char *content, const char *tool_calls_json, void *user_data) |
| Check if a response is complete (no pending work). | |
| typedef void(* | entropic_inference_free_fn) (void *ptr) |
| Free a string allocated by the inference layer. | |
| typedef int(* | entropic_get_tool_prompt_fn) (const char *tier, char **result, void *user_data) |
| Get formatted tool prompt for a tier. | |
Function pointer types for core-to-inference communication.
Core does not #include any inference headers. These function pointer types define the contract. The facade (librentropic.so) wires them to the actual InferenceBackend at engine creation time.
Definition in file i_inference_callbacks.h.
| typedef int(* entropic_complete_fn) (const char *prompt, const char *params_json, char **result_json, void *user_data) |
Raw text completion without chat template.
| prompt | Raw prompt string (no chat formatting). | |
| params_json | Generation parameters JSON. | |
| [out] | result_json | Output: JSON result string. Caller must free. |
| user_data | Opaque pointer to backend instance. |
Definition at line 87 of file i_inference_callbacks.h.
| typedef int(* entropic_generate_fn) (const char *messages_json, const char *params_json, char **result_json, void *user_data) |
Generate a response (batch mode).
| messages_json | JSON array of messages. | |
| params_json | Generation parameters JSON. | |
| [out] | result_json | Output: JSON result string. Caller must free. |
| user_data | Opaque pointer to backend instance. |
Definition at line 37 of file i_inference_callbacks.h.
| typedef int(* entropic_generate_streaming_fn) (const char *messages_json, const char *params_json, void(*on_token)(const char *token, size_t len, void *user_data), void *token_user_data, int *cancel, void *user_data) |
Generate a response with streaming.
| messages_json | JSON array of messages. |
| params_json | Generation parameters JSON. |
| on_token | Callback invoked per token. |
| token_user_data | Opaque pointer for on_token callback. |
| cancel | Pointer to atomic cancel flag (1 = cancel). |
| user_data | Opaque pointer to backend instance. |
Definition at line 55 of file i_inference_callbacks.h.
| typedef int(* entropic_get_tool_prompt_fn) (const char *tier, char **result, void *user_data) |
Get formatted tool prompt for a tier.
Returns the adapter-formatted tool definitions filtered by the tier's allowed_tools. The caller must free the result with the interface's free_fn.
| tier | Tier name (e.g., "lead", "researcher"). | |
| [out] | result | Output: formatted tool prompt string. Caller frees. |
| user_data | Opaque pointer (facade context). |
Definition at line 145 of file i_inference_callbacks.h.
| typedef void(* entropic_inference_free_fn) (void *ptr) |
Free a string allocated by the inference layer.
| ptr | Pointer to free. NULL is a safe no-op. @callback |
Definition at line 129 of file i_inference_callbacks.h.
| typedef int(* entropic_is_response_complete_fn) (const char *content, const char *tool_calls_json, void *user_data) |
Check if a response is complete (no pending work).
| content | Response content string. |
| tool_calls_json | JSON array of tool calls (may be "[]"). |
| user_data | Opaque pointer to adapter. |
Definition at line 118 of file i_inference_callbacks.h.
| typedef int(* entropic_parse_tool_calls_fn) (const char *raw_content, char **cleaned_content, char **tool_calls_json, void *user_data) |
Parse tool calls from raw model output.
| raw_content | Raw model output string. | |
| [out] | cleaned_content | Output: cleaned content. Caller must free. |
| [out] | tool_calls_json | Output: JSON array of tool calls. Caller must free. |
| user_data | Opaque pointer to adapter. |
Definition at line 103 of file i_inference_callbacks.h.
| typedef int(* entropic_route_fn) (const char *messages_json, char **result_json, void *user_data) |
Route messages to determine tier.
| messages_json | JSON array of messages. | |
| [out] | result_json | Output: JSON routing result. Caller must free. |
| user_data | Opaque pointer to orchestrator. |
Definition at line 72 of file i_inference_callbacks.h.