Skip to content

Commit

Permalink
update passing moderations v3
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuszOssGit committed Nov 18, 2024
1 parent dc5f9a2 commit 2f89630
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libs/ibm/langchain_ibm/llms.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,11 @@ def _create_llm_result(self, response: List[dict]) -> LLMResult:
Generation(
text=result.get("generated_text", ""),
generation_info={"finish_reason": result.get("stop_reason")}
| {"moderations": moderations}
if (moderations := result.get("moderations"))
else {},
| (
{"moderations": moderations}
if (moderations := result.get("moderations"))
else {}
),
)
]
for res in response
Expand Down

0 comments on commit 2f89630

Please sign in to comment.