mellea.backends
Backends (e.g., ollama, huggingface, openai-compatible) communicate with LLMs.
Classes
Backend
An abstract Backend.
Methods:
generate_from_context
action: The last item of the context should be passed in as anactioninstead of as part of thectx. Seedocs/dev/generate_signature_decisions.md.ctx: The rest of the context.format: A response format to used for structured outputs / constrained decoding.model_options: Any model options to upsert into the defaults for this call.tool_calls: IfTrue, then tool calls are extracts from theactionComponent. Assumption: if tool_calls is enabled, then the actionComponenthas a TemplateRepresentation
- a tuple of (ModelOutputThunk, Context) where the Context is the new context after the generation has been completed.