Skip to content

Commit

Permalink
Added noqa back into utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
emcf authored Jan 3, 2025
1 parent eb79153 commit 12135f6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions instructor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def combine_system_messages(


def extract_system_messages(messages: list[dict[str, Any]]) -> list[SystemMessage]:
def convert_message(content: Union[str, dict[str, Any]]) -> SystemMessage:
def convert_message(content: Union[str, dict[str, Any]]) -> SystemMessage: # noqa: UP007
if isinstance(content, str):
return SystemMessage(type="text", text=content)
elif isinstance(content, dict):
Expand All @@ -457,9 +457,7 @@ def convert_message(content: Union[str, dict[str, Any]]) -> SystemMessage:
for m in messages:
if m["role"] == "system":
# System message must always be a string or list of dictionaries
content = cast(
Union[str, list[dict[str, Any]]], m["content"]
) # noqa: UP007
content = cast(Union[str, list[dict[str, Any]]], m["content"]) # noqa: UP007
if isinstance(content, list):
result.extend(convert_message(item) for item in content)
else:
Expand Down

0 comments on commit 12135f6

Please sign in to comment.