Execute Lit Agent from run file with passable config based on pydantic settings#28
Conversation
|
I think instead of creating the new settings class for each tool in the config, maybe we could import the config and create those objects like: class SomeSettings(BaseSettings):
model_settings: ...
search_settings: SearxNgToolConfig(...)
scraper_settings: SearxNgToolConfig(...)etc. This way, we will have config for each tool and agents tightly coupled with their module scope. What do you think. I liked the toml way of loading as well. It's neat. Maybe we can find some common grounds for this? But yours look better with global scope. |
|
Yes, I was actually thinking of whether to use the config object in the settings class directly, vs. going from purely settings parameters which are then passed into the config object at a later point. I think this simplifies it a bit and has the benefit that all of the agent/tool settings will be instantiated in one place. I can refactor to incorporate this change. Glad you think the toml approach might work -- yes we can discuss some approaches to handle passing different parameters when running the agent, and try to find some common ground between approaches. |
|
I updated the I'm not 100% sure on the file names etc. but I think the general idea of the PR is that the There is now a |
|
Thanks. I will have a look at this once I merge the factreasoner PR. |
|
We might have to pin down pyproject pydantic deps to: |
Summary 📝
This PR enables running an agent from a python file and passing dynamic configs at run time.
Details
Introduces
scriptsandconfigfolders to store run scripts and associated configs.Uses pydantic settings to create settings/config objects which can have various levels of abstractions, e.g. project settings, or lit agent settings.
The idea is top-level project settings will be passed to /extracted from
ProjectSettingsand agent-specific settings inLitAgentSettings, for example.ProjectSettingstakes in values from a .env file using model_config.LitAgentSettingsis initialised via a toml file, which can be changed between runs.