Skip to content

Commit 86e65d2

Browse files
Refactor: Simplify Gemini tracing docstring
Co-authored-by: vinicius <[email protected]>
1 parent ffd0d01 commit 86e65d2

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

src/openlayer/lib/__init__.py

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -240,33 +240,7 @@ def unpatch_google_adk():
240240

241241
# -------------------------------- Google Gemini --------------------------------- #
242242
def trace_gemini(client):
243-
"""Trace Google Gemini chat completions.
244-
245-
This function patches a Google GenerativeModel client to automatically trace
246-
all generate_content calls, including both streaming and non-streaming requests.
247-
248-
Parameters
249-
----------
250-
client : google.generativeai.GenerativeModel
251-
The Gemini GenerativeModel to patch.
252-
253-
Returns
254-
-------
255-
google.generativeai.GenerativeModel
256-
The patched Gemini client.
257-
258-
Example
259-
-------
260-
>>> import google.generativeai as genai
261-
>>> from openlayer.lib import trace_gemini
262-
>>> # Configure Gemini
263-
>>> genai.configure(api_key="your-api-key")
264-
>>> model = genai.GenerativeModel("gemini-pro")
265-
>>> # Enable tracing
266-
>>> traced_model = trace_gemini(model)
267-
>>> # Use normally - tracing happens automatically
268-
>>> response = traced_model.generate_content("Hello!")
269-
"""
243+
"""Trace Google Gemini chat completions."""
270244
# pylint: disable=import-outside-toplevel
271245
try:
272246
import google.generativeai as genai

0 commit comments

Comments
 (0)