Strip trailing whitespaces in agent's stop sequences (#1566)

Fixes #1489
tool-patch
Ryan Dao 1 year ago committed by GitHub
parent 30383abb12
commit a950287206
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,7 +47,10 @@ class Agent(BaseModel):
@property
def _stop(self) -> List[str]:
return [f"\n{self.observation_prefix}", f"\n\t{self.observation_prefix}"]
return [
f"\n{self.observation_prefix.rstrip()}",
f"\n\t{self.observation_prefix.rstrip()}",
]
def _construct_scratchpad(
self, intermediate_steps: List[Tuple[AgentAction, str]]

Loading…
Cancel
Save