AQIT 0.1.0
Loading...
Searching...
No Matches
aquin.compute.llm_json Namespace Reference

Functions

dict[str, Any] parse_llm_json_object (str raw)
tuple[list[str], list[str]] sentence_lists_from_llm (str raw)
list[str] _as_str_list (Any value)
str llm_sentence_generation_error ()
Any chat_json_completion (Any client, **Any kwargs)

Function Documentation

◆ _as_str_list()

list[str] _as_str_list ( Any value)
protected

Definition at line 55 of file llm_json.py.

Referenced by sentence_lists_from_llm().

◆ chat_json_completion()

Any chat_json_completion ( Any client,
**Any kwargs )
Chat completion preferring JSON object mode, with a plain fallback.

Definition at line 69 of file llm_json.py.

◆ llm_sentence_generation_error()

str llm_sentence_generation_error ( )
User-facing message when LLM example generation fails.

Definition at line 61 of file llm_json.py.

◆ parse_llm_json_object()

dict[str, Any] parse_llm_json_object ( str raw)
Extract the first JSON object from an LLM reply (handles fences and trailing text).

Definition at line 14 of file llm_json.py.

Referenced by sentence_lists_from_llm().

◆ sentence_lists_from_llm()

tuple[list[str], list[str]] sentence_lists_from_llm ( str raw)
Parse positive/negative sentence lists from an LLM JSON reply.

Definition at line 45 of file llm_json.py.

References _as_str_list(), and parse_llm_json_object().