Skip to content

Commit 0321722

Browse files
chore: lint
1 parent 72b2258 commit 0321722

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

posthog/ai/gemini/gemini_converter.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ def extract_gemini_tools(kwargs: Dict[str, Any]) -> Optional[Any]:
261261
return None
262262

263263

264-
def format_gemini_input_with_system(contents: Any, config: Any = None) -> List[FormattedMessage]:
264+
def format_gemini_input_with_system(
265+
contents: Any, config: Any = None
266+
) -> List[FormattedMessage]:
265267
"""
266268
Format Gemini input contents into standardized message format, including system instruction handling.
267269
@@ -273,17 +275,21 @@ def format_gemini_input_with_system(contents: Any, config: Any = None) -> List[F
273275
List of formatted messages with role and content fields, with system message prepended if needed
274276
"""
275277
formatted_messages = format_gemini_input(contents)
276-
278+
277279
# Check if system instruction is provided in config parameter
278280
system_instruction = extract_gemini_system_instruction(config)
279-
281+
280282
if system_instruction is not None:
281283
has_system = any(msg.get("role") == "system" for msg in formatted_messages)
282284
if not has_system:
283285
from posthog.ai.types import FormattedMessage
284-
system_message: FormattedMessage = {"role": "system", "content": system_instruction}
286+
287+
system_message: FormattedMessage = {
288+
"role": "system",
289+
"content": system_instruction,
290+
}
285291
formatted_messages = [system_message] + list(formatted_messages)
286-
292+
287293
return formatted_messages
288294

289295

0 commit comments

Comments
 (0)