mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-06 05:08:20 +00:00
Strip trailing whitespaces in agent's stop sequences (#1566)
Fixes #1489
This commit is contained in:
parent
30383abb12
commit
a950287206
@ -47,7 +47,10 @@ class Agent(BaseModel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def _stop(self) -> List[str]:
|
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(
|
def _construct_scratchpad(
|
||||||
self, intermediate_steps: List[Tuple[AgentAction, str]]
|
self, intermediate_steps: List[Tuple[AgentAction, str]]
|
||||||
|
Loading…
Reference in New Issue
Block a user