Skip to content

Commit 6c23c71

Browse files
authored
fix: lint/format (#31894)
1 parent 03e8327 commit 6c23c71

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

libs/langchain/langchain/memory/vectorstore_token_buffer_memory.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,15 @@ def save_remainder(self) -> None:
167167
self._pop_and_store_interaction(buffer)
168168

169169
def _pop_and_store_interaction(self, buffer: list[BaseMessage]) -> None:
170+
input_ = buffer.pop(0)
170171
output = buffer.pop(0)
171172
timestamp = self._timestamps.pop(0).strftime(TIMESTAMP_FORMAT)
172173
# Split AI output into smaller chunks to avoid creating documents
173174
# that will overflow the context window
174175
ai_chunks = self._split_long_ai_text(str(output.content))
175176
for index, chunk in enumerate(ai_chunks):
176177
self.memory_retriever.save_context(
177-
{"Human": f"<{timestamp}/00> {input.content!s}"},
178+
{"Human": f"<{timestamp}/00> {input_.content!s}"},
178179
{"AI": f"<{timestamp}/{index:02}> {chunk}"},
179180
)
180181

libs/langchain/langchain/output_parsers/fix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def parse(self, completion: str) -> T:
8282
try:
8383
completion = self.retry_chain.invoke(
8484
{
85-
"instructions": self.parser.get_format_instructions(), # noqa: E501
85+
"instructions": self.parser.get_format_instructions(),
8686
"completion": completion,
8787
"error": repr(e),
8888
}
@@ -119,7 +119,7 @@ async def aparse(self, completion: str) -> T:
119119
try:
120120
completion = await self.retry_chain.ainvoke(
121121
{
122-
"instructions": self.parser.get_format_instructions(), # noqa: E501
122+
"instructions": self.parser.get_format_instructions(),
123123
"completion": completion,
124124
"error": repr(e),
125125
}

0 commit comments

Comments
 (0)