C API reference · Kjarni 0.2.8
summarizer
kjarni_summarizer_config_default
struct KjarniSummarizerConfig kjarni_summarizer_config_default(void);
Get default summarizer configuration.
kjarni_summarizer_new
enum KjarniErrorCode kjarni_summarizer_new(const struct KjarniSummarizerConfig *config, struct KjarniSummarizer **out);
Create a new Summarizer. Downloads the model on first use.
Safety
configmust be null (defaults) or point to a valid config whose strings are null or nul-terminated.outmust be a valid, writable pointer.
kjarni_summarizer_free
void kjarni_summarizer_free(struct KjarniSummarizer *summarizer);
Free a Summarizer.
Safety
summarizermust be null, or a handle fromkjarni_summarizer_newnot already freed.
kjarni_summarizer_summarize
enum KjarniErrorCode kjarni_summarizer_summarize(const struct KjarniSummarizer *summarizer, const char *text, char **out);
Summarize a text.
Safety
summarizermust be a live handle;texta nul-terminated string.outmust be a valid, writable pointer. On success it receives a string the caller frees withkjarni_string_free; on failure it is set to null.
Kjarni runs the same engine on every platform: