From 12135f6cd0608b4c8f2fecbd78e5b4d490d6d161 Mon Sep 17 00:00:00 2001 From: Emmett McFarlane Date: Fri, 3 Jan 2025 13:57:24 -0500 Subject: [PATCH] Added noqa back into utils.py --- instructor/utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/instructor/utils.py b/instructor/utils.py index b01ed3cfc..29effb9df 100644 --- a/instructor/utils.py +++ b/instructor/utils.py @@ -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): @@ -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: