fix: lint/format (#31894)

This commit is contained in:
Mason Daugherty 2025-07-07 13:11:06 -04:00 committed by GitHub
parent 03e8327e01
commit 6c23c711fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -167,6 +167,7 @@ class ConversationVectorStoreTokenBufferMemory(ConversationTokenBufferMemory):
self._pop_and_store_interaction(buffer) self._pop_and_store_interaction(buffer)
def _pop_and_store_interaction(self, buffer: list[BaseMessage]) -> None: def _pop_and_store_interaction(self, buffer: list[BaseMessage]) -> None:
input_ = buffer.pop(0)
output = buffer.pop(0) output = buffer.pop(0)
timestamp = self._timestamps.pop(0).strftime(TIMESTAMP_FORMAT) timestamp = self._timestamps.pop(0).strftime(TIMESTAMP_FORMAT)
# Split AI output into smaller chunks to avoid creating documents # Split AI output into smaller chunks to avoid creating documents
@ -174,7 +175,7 @@ class ConversationVectorStoreTokenBufferMemory(ConversationTokenBufferMemory):
ai_chunks = self._split_long_ai_text(str(output.content)) ai_chunks = self._split_long_ai_text(str(output.content))
for index, chunk in enumerate(ai_chunks): for index, chunk in enumerate(ai_chunks):
self.memory_retriever.save_context( self.memory_retriever.save_context(
{"Human": f"<{timestamp}/00> {input.content!s}"}, {"Human": f"<{timestamp}/00> {input_.content!s}"},
{"AI": f"<{timestamp}/{index:02}> {chunk}"}, {"AI": f"<{timestamp}/{index:02}> {chunk}"},
) )

View File

@ -82,7 +82,7 @@ class OutputFixingParser(BaseOutputParser[T]):
try: try:
completion = self.retry_chain.invoke( completion = self.retry_chain.invoke(
{ {
"instructions": self.parser.get_format_instructions(), # noqa: E501 "instructions": self.parser.get_format_instructions(),
"completion": completion, "completion": completion,
"error": repr(e), "error": repr(e),
} }
@ -119,7 +119,7 @@ class OutputFixingParser(BaseOutputParser[T]):
try: try:
completion = await self.retry_chain.ainvoke( completion = await self.retry_chain.ainvoke(
{ {
"instructions": self.parser.get_format_instructions(), # noqa: E501 "instructions": self.parser.get_format_instructions(),
"completion": completion, "completion": completion,
"error": repr(e), "error": repr(e),
} }