fix: stuff
This commit is contained in:
parent
6e1251b136
commit
39143e1998
5 changed files with 69 additions and 12 deletions
12
src/agent.rs
12
src/agent.rs
|
|
@ -71,8 +71,16 @@ impl Agent {
|
|||
pub async fn run(&mut self) -> Result<(String, Option<String>), Box<dyn std::error::Error>> {
|
||||
let mut finished = false;
|
||||
let start_time = Instant::now();
|
||||
let max_duration = Duration::from_secs(120);
|
||||
let max_turns = 20;
|
||||
let max_duration_secs = std::env::var("AGENT_MAX_DURATION_SECS")
|
||||
.ok()
|
||||
.and_then(|s| s.parse().ok())
|
||||
.unwrap_or(120);
|
||||
let max_duration = Duration::from_secs(max_duration_secs);
|
||||
|
||||
let max_turns = std::env::var("AGENT_MAX_TURNS")
|
||||
.ok()
|
||||
.and_then(|s| s.parse().ok())
|
||||
.unwrap_or(20);
|
||||
let mut turns = 0;
|
||||
|
||||
while !finished {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue