mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-31 02:11:09 +00:00
Strip trailing whitespaces in agent's stop sequences (#1566)
Fixes #1489
This commit is contained in:
@@ -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]]
|
||||
|
Reference in New Issue
Block a user