Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 7.1.0 - 2025-11-26

Add support for the async version of Gemini.

# 7.0.2 - 2025-11-18

Add support for Python 3.14.
Expand Down
3 changes: 3 additions & 0 deletions posthog/ai/gemini/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .gemini import Client
from .gemini_async import AsyncClient
from .gemini_converter import (
format_gemini_input,
format_gemini_response,
Expand All @@ -9,12 +10,14 @@
# Create a genai-like module for perfect drop-in replacement
class _GenAI:
Client = Client
AsyncClient = AsyncClient


genai = _GenAI()

__all__ = [
"Client",
"AsyncClient",
"genai",
"format_gemini_input",
"format_gemini_response",
Expand Down
2 changes: 1 addition & 1 deletion posthog/ai/gemini/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def _generate_content_streaming(

def generator():
nonlocal usage_stats
nonlocal accumulated_content # noqa: F824
nonlocal accumulated_content
try:
for chunk in response:
# Extract usage stats from chunk
Expand Down
Loading
Loading