-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config / CLI refactoring #72
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@pmeier First, thanks - I like this change. :) Quick question: What's the difference between the |
The demo config is the bare minimum. No requirements other than the default The builtin config includes all builtin components that |
Yet another major refactoring PR, but hopefully the last one. Closes #50 and helps #71. Highlights:
Instead of using a
.py
file as configuration, we now use a TOML file. To configure Python objects, i.e. adding custom source storages or assistants, we now require them to be put into the configuration as a importable path, e.g.my_module.MyAssistant
. For that, the user has to movemy_module
on thePYTHONPATH
.The config internally is now handled by
pydantic-settings
to eliminate the need for us to implement any type checking or add functionality to pull values from env vars.Instead of having
ragna.demo_config
andragna.builtin_config
as "constants", they are now class methods on the config itself, i.e.ragna.Config.demo()
andragna.Config.builtin()
. The latter at least removes the long import overhead detailed in Unify embedding model / tokenizer for builtin source storages? #71, since we now only perform the availability check if the user actually wants to use the config anyway.Update
pydantic
to>=2
. This was previously blocked bychroma
, but was resolved for>=0.4.13
.Fix our document handler story, which has been bugging me for a while:
ragna/ragna/core/_document.py
Lines 30 to 35 in bd38bfb
Functionality is not much different, but is properly implemented now. I pondered on the question if we should make the document handlers configurable as well, but found no good use case. Why would someone deselect the PDF handler for example? Maybe there is a use case for this, but if so we can go for this later.
I've added an
s
to builtin component namespaces, i.eragna.source_storage
->ragna.source_storages
andragna.assistant
->ragna.assistants
to better reflect their nature.The CLI got a new
ragna config
command that is used to create and check config TOML files. I'm planning to have an interactive wizard there, but this is lower prio. Will open for this.Remove logging, since we don't have a good story on that yet