uAgents
uAgents copied to clipboard
Extend logging capabilities and agent configurability
We need to improve logging throughout the whole framework and enable the user to configure verbosity as well as output of the logs.
- agent already has log level as property so we'll only need to provide the means for piping the logs to a file (or similar means)
- logging within the framework is mainly happening on the INFO level but under-the-hood actions should be logged as well to properly debug a running agent
Potential solution could be a config mapping which may be created by the user or generated and filled with default values on demand by running the agent with a CLI argument.
Agent instantiation
agent = Agent(
name="<your_name>",
seed="<your_seed>",
[...],
config=AgentConfig(
path="./my_agent.yaml",
**kwargs # maybe individual config values
)
)
my_agent.yaml
name: "bert"
port: 8000
seed: "..."
endpoint: "http://localhost:8000/submit"
enable_wallet_messaging: false
version: "v20.0.9"
log_level: "DEBUG"
log_file: "./${timestamp}_${agent_address}.log"
...
By using this approach it should also be easier to scale agent deployment if we can put every agent init argument inside the config map, enabling the developer to invoke:
configs= ["./config_a.yaml", "./config_b.yaml", ...] # list of config files
agents = []
for conf in configs:
agents.append(Agent(config=conf))
Add automatic logging of agent address on agent startup.
I think there are two main approaches when it comes to configuration files:
- simply loading the file (
.yamlin this case), create a dict of values to be used as a direct way of creating an agent, or - loading an
AgentConfigobject from a file which includes type validation to create agents from.
Both can coexist but we may want to force one of the usage of one over the other.
We can think about adding the AgentConfig object to the agent by default so that config handling will be more natively embedded in the framework.
Using yaml files makes handling of multiple agents very easy as the configs just need to be separated by --- for it to be loaded like this:
"""yaml contents
name: alice
seed: ...
---
name: bob
seed: ...
"""
confs = load_configs(PATH) # multiple configs in one file
bureau = Bureau()
for conf in confs:
bureau.add(Agent(**conf))
bureau.run()
Requirements
- after the process, one (or multiple of) working agent(s) needs to be instantiated
- the process should feel native, i.e. nothing should fundamentally change from a dev perspective apart from slight additions