Skip to content

Commit

Permalink
fix pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
PCSwingle committed Jul 25, 2024
1 parent bf3b05a commit d756363
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spice/wrapped_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,12 @@ def _convert_messages(
) -> Tuple[str, List[MessageParam]]:
# Anthropic handles both images and system messages different from OpenAI, only allows alternating user / assistant messages,
# and doesn't support tools / function calling (still in beta, and doesn't support streaming)
messages = [m for m in messages if m.get("content", "").strip()]
new_messages = []
for m in messages:
content = m.get("content", "")
if (not isinstance(content, str)) or content.strip():
new_messages.append(m)
messages = new_messages

system = ""
converted_messages: List[MessageParam] = []
Expand Down

0 comments on commit d756363

Please sign in to comment.