Skip to content

Commit f9dd82c

Browse files
authored
fix: correctly strip llm responses in langchain (#359)
1 parent 7739144 commit f9dd82c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

langfuse/callback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ def on_llm_end(
730730
else response.llm_output["token_usage"]
731731
)
732732

733-
extracted_response = self._extract_response(last_response)
733+
extracted_response = _extract_response(last_response)
734734

735735
self.runs[run_id] = self.runs[run_id].end(
736736
output=extracted_response, usage=llm_usage, version=self.version

tests/test_langchain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ def _identifying_params(self) -> Mapping[str, Any]:
13001300
)
13011301
)[0]
13021302

1303-
assert custom_generation.output == "This is a "
1303+
assert custom_generation.output == "This is a"
13041304
assert custom_generation.model is None
13051305

13061306

0 commit comments

Comments
 (0)