Added
DocumentLLM(strict_structured_output=True)sends the JSON schema of each extraction of aspects and concepts as a strict response format, so that the provider returns JSON that matches it. It is off by default, and needs a model whose provider supports strict JSON schemas. ContextGem still checks each answer, and never drops the schema from a request: with it, a request raisesValueErrorwhilelitellm.drop_paramsisTrue. JSON object concepts with arbitrary keys, e.g.dict[str, str], cannot be extracted with it. See "Strict Structured Output" in the documentation.- Decision models of Ollama and LM Studio can be used with the prefixes of their LLMs,
ollama/orollama_chat/andlm_studio/, e.g.ollama/nimble.strands_decider/still works. Withollama/andollama_chat/, if Ollama is not at its default address, setOLLAMA_API_BASEto its address too (see "Local Decision Models" of the decision models page). - Decision models of Parallel (
parallel_ai/), Nace (nace/), EU Jev (eu_jev/) and EmpirioLabs (empiriolabs/) are supported (see "Supported Providers and Models" of the decision models page).
Changed
- Upgraded pinned dependency versions:
litellm==1.110.3,openai==3.58.0,genai-prices==0.2.5. - An answer of a decision model without the probability of an option offered is now an invalid response, which is retried (
max_retries_invalid_data): thislitellmno longer fills in a missing probability with zero. - The message of
ModelExtractionErrorfor a decision model now also names the model, the aspect or concept, and what is wrong with the response, e.g. the options without a probability, which was only logged. - The error on
auto_pricing=Truefor a local or self-hosted model now names the model, and the error on the identifier of a decision model without a provider or a model name links to the providers of decision models.