LLMMiddleware#
LLMMiddlewareChain#
- class council.llm.LLMMiddlewareChain(llm: LLMBase, middlewares: Sequence[LLMMiddleware] | None = None)[source]#
Bases:
object
Manages a chain of LLM middlewares and executes requests through them.
- add_middleware(middleware: LLMMiddleware) None [source]#
Add middleware to a chain.
- execute(request: LLMRequest) LLMResponse [source]#
Execute middleware chain.
LLMLoggingMiddleware#
LLMFileLoggingMiddleware#
LLMRetryMiddleware#
LLMRequest#
- class council.llm.LLMRequest(context: LLMContext, messages: Sequence[LLMMessage], **kwargs: Any)[source]#
Bases:
object
- static default(messages: Sequence[LLMMessage], **kwargs: Any) LLMRequest [source]#
Creates a default LLMRequest with an empty context.
LLMResponse#
- class council.llm.LLMResponse(request: LLMRequest, result: LLMResult | None, duration: float)[source]#
Bases:
object
- static empty(request: LLMRequest) LLMResponse [source]#
Creates an empty LLMResponse for a given request.