mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-14 00:47:27 +00:00
fix: lint/format (#31894)
This commit is contained in:
parent
03e8327e01
commit
6c23c711fb
@ -167,6 +167,7 @@ class ConversationVectorStoreTokenBufferMemory(ConversationTokenBufferMemory):
|
||||
self._pop_and_store_interaction(buffer)
|
||||
|
||||
def _pop_and_store_interaction(self, buffer: list[BaseMessage]) -> None:
|
||||
input_ = buffer.pop(0)
|
||||
output = buffer.pop(0)
|
||||
timestamp = self._timestamps.pop(0).strftime(TIMESTAMP_FORMAT)
|
||||
# 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))
|
||||
for index, chunk in enumerate(ai_chunks):
|
||||
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}"},
|
||||
)
|
||||
|
||||
|
@ -82,7 +82,7 @@ class OutputFixingParser(BaseOutputParser[T]):
|
||||
try:
|
||||
completion = self.retry_chain.invoke(
|
||||
{
|
||||
"instructions": self.parser.get_format_instructions(), # noqa: E501
|
||||
"instructions": self.parser.get_format_instructions(),
|
||||
"completion": completion,
|
||||
"error": repr(e),
|
||||
}
|
||||
@ -119,7 +119,7 @@ class OutputFixingParser(BaseOutputParser[T]):
|
||||
try:
|
||||
completion = await self.retry_chain.ainvoke(
|
||||
{
|
||||
"instructions": self.parser.get_format_instructions(), # noqa: E501
|
||||
"instructions": self.parser.get_format_instructions(),
|
||||
"completion": completion,
|
||||
"error": repr(e),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user