LeXtract.LLM.ReqLLM (lextract v0.1.3)

Copy Markdown View Source

Default LeXtract.LLM adapter, backed by the req_llm library.

Only compiled when the optional req_llm dependency is present.

Builds the "provider:model" model string from opts[:provider] and opts[:model], unwraps %ReqLLM.Response{} into plain text or maps, and applies OpenAI's strict JSON schema shaping when opts[:provider] == :openai. Translates the legacy opts[:timeout] key to ReqLLM's :receive_timeout (without clobbering an explicitly passed :receive_timeout).

This adapter makes exactly one ReqLLM call per invocation; concurrency is owned by LeXtract.Annotator.