Skip to content

Commit

Permalink
fix lc placeholder with lcel (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
willydouhard authored Nov 26, 2023
1 parent 60c96f0 commit 3c44500
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/chainlit/langchain/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,12 @@ def build_template_messages() -> List[PromptMessage]:
if "placeholder" in class_name.lower():
variable_name = lc_message.get(
"variable_name"
) or message_kwargs.get(
"variable_name"
) # type: Optional[str]
variable = inputs.get(variable_name, [])
placeholder_size = len(variable)

if placeholder_size:
template_messages += [
PromptMessage(placeholder_size=placeholder_size)
Expand Down

0 comments on commit 3c44500

Please sign in to comment.