Skip to content
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

Force agent to answer after maximum turn count #989

Merged
merged 1 commit into from
Sep 28, 2023
Merged

Conversation

calyptobai
Copy link
Contributor

Closes BLO-1650

@@ -181,6 +184,12 @@ impl Agent {
Action::Proc { query, paths } => self.process_files(query, paths).await?,
};

if self.exchanges.len() >= MAX_STEPS {
return Ok(Some(Action::Answer {
paths: self.paths().enumerate().map(|(i, _)| i).collect(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested the answer quality, but it might be better if we get bloop itself to choose which paths to answer w.r.t.

E.g. If we exceed MAX_STEPS we force the agent to call the none function: https://platform.openai.com/docs/api-reference/chat/create#function_call

@ggordonhall ggordonhall merged commit 540a04e into main Sep 28, 2023
1 check passed
@ggordonhall ggordonhall deleted the agent-max-n-turns branch September 28, 2023 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants