Skip to content

Commit

Permalink
🔧 fix empty system message
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Jan 25, 2024
1 parent 4aabde8 commit 44957aa
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/funcchain/backend/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,8 @@ def compile_chain(
Compile a signature to a runnable chain.
"""
system = (
[msg for msg in signature.history if isinstance(msg, SystemMessage)]
or [
SystemMessage(content=""),
]
).pop()
[msg for msg in signature.history if isinstance(msg, SystemMessage)] or [None] # type: ignore
)[0]

from ..utils.memory import ChatMessageHistory

Expand Down

0 comments on commit 44957aa

Please sign in to comment.