Skip to content

docs: create gemini_tracing.py #1456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

Jgilhuly
Copy link
Contributor

@Jgilhuly Jgilhuly commented Apr 1, 2025

No description provided.

@Jgilhuly Jgilhuly requested a review from a team as a code owner April 1, 2025 20:16
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 1, 2025
from phoenix.otel import register

# Set Environment Variables
os.environ["GEMINI_API_KEY"] = ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can just assert this at the top of a file rather than hard coding the assignment

import os

from langchain_google_genai import ChatGoogleGenerativeAI
from phoenix.otel import register
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if doing this we need this in the requirements.txt

Comment on lines +8 to +9
os.environ["PHOENIX_CLIENT_HEADERS"] = "api_key="
os.environ["PHOENIX_COLLECTOR_ENDPOINT"] = "https://app.phoenix.arize.com"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably not hard code these. users of OI probably don't necessarily use cloud

Comment on lines +7 to +8
os.environ["GEMINI_API_KEY"] = ""
os.environ["PHOENIX_CLIENT_HEADERS"] = "api_key="
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current code sets empty API keys which will cause authentication failures when executed. Consider replacing these lines with placeholder values that clearly indicate to users they need to insert their own API keys:

os.environ["GEMINI_API_KEY"] = "YOUR_GEMINI_API_KEY"
os.environ["PHOENIX_CLIENT_HEADERS"] = "api_key=YOUR_PHOENIX_API_KEY"

This makes it more obvious to users that they need to substitute their own credentials.

Suggested change
os.environ["GEMINI_API_KEY"] = ""
os.environ["PHOENIX_CLIENT_HEADERS"] = "api_key="
os.environ["GEMINI_API_KEY"] = "YOUR_GEMINI_API_KEY"
os.environ["PHOENIX_CLIENT_HEADERS"] = "api_key=YOUR_PHOENIX_API_KEY"

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:S This PR changes 10-29 lines, ignoring generated files.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants