mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-24 03:52:10 +00:00
core: Add ruff rules RET (#29384)
See https://docs.astral.sh/ruff/rules/#flake8-return-ret All auto-fixes
This commit is contained in:
committed by
GitHub
parent
9ae792f56c
commit
f241fd5c11
@@ -60,11 +60,9 @@ class ChatGeneration(Generation):
|
||||
if isinstance(block, str):
|
||||
text = block
|
||||
break
|
||||
elif isinstance(block, dict) and "text" in block:
|
||||
if isinstance(block, dict) and "text" in block:
|
||||
text = block["text"]
|
||||
break
|
||||
else:
|
||||
pass
|
||||
else:
|
||||
pass
|
||||
self.text = text
|
||||
@@ -104,7 +102,7 @@ class ChatGenerationChunk(ChatGeneration):
|
||||
message=self.message + other.message,
|
||||
generation_info=generation_info or None,
|
||||
)
|
||||
elif isinstance(other, list) and all(
|
||||
if isinstance(other, list) and all(
|
||||
isinstance(x, ChatGenerationChunk) for x in other
|
||||
):
|
||||
generation_info = merge_dicts(
|
||||
@@ -115,8 +113,5 @@ class ChatGenerationChunk(ChatGeneration):
|
||||
message=self.message + [chunk.message for chunk in other],
|
||||
generation_info=generation_info or None,
|
||||
)
|
||||
else:
|
||||
msg = (
|
||||
f"unsupported operand type(s) for +: '{type(self)}' and '{type(other)}'"
|
||||
)
|
||||
raise TypeError(msg)
|
||||
msg = f"unsupported operand type(s) for +: '{type(self)}' and '{type(other)}'"
|
||||
raise TypeError(msg)
|
||||
|
@@ -64,8 +64,5 @@ class GenerationChunk(Generation):
|
||||
text=self.text + other.text,
|
||||
generation_info=generation_info or None,
|
||||
)
|
||||
else:
|
||||
msg = (
|
||||
f"unsupported operand type(s) for +: '{type(self)}' and '{type(other)}'"
|
||||
)
|
||||
raise TypeError(msg)
|
||||
msg = f"unsupported operand type(s) for +: '{type(self)}' and '{type(other)}'"
|
||||
raise TypeError(msg)
|
||||
|
Reference in New Issue
Block a user