Skip to content

Commit

Permalink
Update autogen/oai/gemini.py
Browse files Browse the repository at this point in the history
Co-authored-by: Chi Wang <[email protected]>
  • Loading branch information
liminma and sonichi authored Feb 22, 2025
1 parent 86c33f9 commit 07892ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autogen/oai/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def create(self, params: dict) -> ChatCompletion:

def _extract_system_instruction(self, messages: list[dict]) -> str | None:
"""Extract system instruction if provided."""
if messages is None or len(messages) == 0 or messages[0]["role"] != "system":
if messages is None or len(messages) == 0 or messages[0].get("role") != "system":
return None

message = messages.pop(0)
Expand Down

0 comments on commit 07892ab

Please sign in to comment.