Releases: dymmond/lilya
Releases · dymmond/lilya
Version 0.26.1
Added
unique_identifierfield for UserInterface. This is required for tracking authenticated users in libraries.infer_bodycan now be passed in aLilyainstance directly and it will be applied globally to all the dependencies and handlers in the application. This allows you to have a global body inference without having to specify it in each dependency or handler.
Added
sanitize_clientipkeyword parameter forClientIPScopeOnlyMiddleware,ClientIPMiddlewareandget_ip.sanitize_proxyipkeyword parameter forClientIPScopeOnlyMiddleware,ClientIPMiddlewareandget_ip.
Changed
get_ip()uses now only scope as not keyword-only parameter. The rest did defacto already always use keyword arguments.
0.26.0
Added
- New provider-agnostic
lilya.contrib.aiintegration for building AI-powered Lilya applications. AIClientwith normalized prompt/chat APIs for non-streaming and streaming model interactions.- Typed AI configuration and response objects, including
ChatMessage,PromptRequest,AIResponse,AIResponseChunk, andAIUsage. - Built-in AI provider adapters for OpenAI-compatible APIs, including
OpenAIProvider,GroqProvider,MistralProvider, and the genericOpenAICompatibleProvider. - Built-in
AnthropicProvideradapter for Anthropic's Messages API. setup_ai()startup helper andAIdependency integration for wiring AI clients into Lilya applications throughapp.stateand dependency injection.- New AI contrib documentation with installation steps, full app examples, endpoint recipes, streaming patterns, testing strategies, and provider-switching how-tos.
Changed
- AI contrib documentation now includes more concrete endpoint integration examples, user-facing route patterns, and practical how-to recipes to make adoption clearer in real Lilya applications.
Version 0.25.0
Added
lilya/.agents/skills/SKILL.mdtemplate for creating reusable skills in the Lilya Agents framework.- Expose an alias
OpenAPIQueryforQueryinlilya.contrib.openapito allow using it directly in the OpenAPI documentation.
Changed
- Expose
is_class_and_subclassinlilya.compat. - Expose
import_stringinlilya.compat. - Reorganize internals to remove mypy and validations in favour of
ty. lilya.routingis now a submodule oflilyasplitting the responsibilities of the routing and the path definitions. This allows to have a cleaner separation of concerns and a better internal structure.
The public API is not affected and the imports are still the same but internally.
Version 0.24.3
Fixed
lilya.contrib.openapinow emitsrequestBodyfor writing methods (POST,PUT,PATCH) even whenresponsesare not explicitly declared.@openapi(request_body=...)now supports multipart upload request bodies correctly, including binary fields (format: binary) and propermultipart/form-datacontent generation.BaseTemplateController.render_template()now accepts **kwargs.
Version 0.24.2
Added
TestClient.authenticate(user)andAsyncTestClient.authenticate(user)to allow injecting an authenticated user directly into the ASGI scope during tests.TestClient.logout()andAsyncTestClient.logout()to clear any previously injected authenticated user.- Automatic injection of the authenticated user into both
scope["user"]andscope["state"]["user"]for HTTP and WebSocket connections, enabling clean authentication bypass in tests without monkeypatching.
Fixed
- Settings inheritance now preserves typed fields from parent classes when type hint resolution falls back, allowing child settings classes to override inherited values without re-annotating fields.
Version 0.24.1
Fixed
- Generation of deployment files with the new structure
Changed
- Generated pyproject.toml when using directives
Version 0.24.0
Added
- Performance improvements to the way the system behaves in a fast-path discovery.
Changed
LifespanGlobalContextMiddlewareis no longer activated by default. The reason for this is to avoid overhead in applications
where people do not require the use of theg. You will need to import it into your application now.
from lilya.middleware import DefineMiddleware
from lilya.middleware.global_context import LifespanGlobalContextMiddleware
DefineMiddleware(LifespanGlobalContextMiddleware),Fixed
from future import __annotations__was not being taken into account for the Encoders.- Remove overhead functions that are not used internally. This affected slightly the performance.
- Settings discovery with
settings_modulewas not respecting the hierarchy properly on ChildLilya.
Version 0.23.3
Added
lilya.datastructuresnow supports UploadFile as an alias to DataUpload.@openapidecorator now accepts therequest_bodyas parameter and fixes an issue of getting from responses.
Changed
- Lilya now using the
createprojectdirective instead of generating a requirements folder, generates apyproject.toml
instead. This follows the new Python requirements conventions.
Fixed
lilya createdeploymentdirective files (nginx and docker) updated to the latest stable versions.
Version 0.23.2
createprojectallows to pass multiple names instead of only one if you want to create multiple projects in one go.createappallows to pass multiple names instead of only one if you want to create multiple apps in one go.- Make
Routeavailable as alternative toPath. - Make
WebSocketRouteavailable as alternative toWebSocketPath.
Fixed
- The
createprojectdirective tests was not placing the right contents in conftest.py. - When using
EnvironLoader()it was causing a conflict with the types and not casting properly to the right type due
to thefrom future import __annotations__.
Version 0.23.1
Added
- Introspection graph accessible via
app.graph. This is particularly useful if you want to create any
visuals from your Lilya application or even for framework creators and developers that want to understand in a graph manner, the
state and internals of the current application. - CQRS (Command Query Responsibility Segregation) support under
lilya.contrib.cqrs. - New
CommandBusfor dispatching command messages that mutate application state. - New
QueryBusfor executing query messages that return data without side effects. - Explicit command and query handler registration with one-handler-per-message enforcement.
- Optional decorator-based handler registration for quick prototyping.
- CQRS-scoped middleware pipeline supporting logging, validation, mutation, auditing, and short-circuiting.
- Message envelopes with metadata support, fully compatible with Lilya encoders (
apply_structure,json_encode). - Seamless integration with Lilya endpoints, requests, responses, routing, and
TestClient.