Skip to content

Commit

Permalink
Fix missing chain classname in StdOutCallbackHandler.on_chain_start (l…
Browse files Browse the repository at this point in the history
…angchain-ai#6124)

Retrieves the name of the class from new location as of commit
18af149


Co-authored-by: Zander Chase <130414180+vowelparrot@users.noreply.github.com>
idoru and vowelparrot authored Jul 13, 2023
1 parent af3f401 commit 2241990
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion langchain/callbacks/stdout.py
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ def on_chain_start(
self, serialized: Dict[str, Any], inputs: Dict[str, Any], **kwargs: Any
) -> None:
"""Print out that we are entering a chain."""
class_name = serialized.get("name", "")
class_name = serialized.get("name", serialized.get("id", ["<unknown>"])[-1])
print(f"\n\n\033[1m> Entering new {class_name} chain...\033[0m")

def on_chain_end(self, outputs: Dict[str, Any], **kwargs: Any) -> None:

0 comments on commit 2241990

Please sign in to comment.