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

  • config must be null (defaults) or point to a valid config whose strings are null or nul-terminated.
  • out must be a valid, writable pointer.

kjarni_summarizer_free

void kjarni_summarizer_free(struct KjarniSummarizer *summarizer);

Free a Summarizer.

Safety

  • summarizer must be null, or a handle from kjarni_summarizer_new not already freed.

kjarni_summarizer_summarize

enum KjarniErrorCode kjarni_summarizer_summarize(const struct KjarniSummarizer *summarizer, const char *text, char **out);

Summarize a text.

Safety

  • summarizer must be a live handle; text a nul-terminated string.
  • out must be a valid, writable pointer. On success it receives a string the caller frees with kjarni_string_free; on failure it is set to null.

Kjarni runs the same engine on every platform: