-
Notifications
You must be signed in to change notification settings - Fork 115
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
base: main
Are you sure you want to change the base?
Conversation
from phoenix.otel import register | ||
|
||
# Set Environment Variables | ||
os.environ["GEMINI_API_KEY"] = "" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
os.environ["PHOENIX_CLIENT_HEADERS"] = "api_key=" | ||
os.environ["PHOENIX_COLLECTOR_ENDPOINT"] = "https://app.phoenix.arize.com" |
There was a problem hiding this comment.
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
os.environ["GEMINI_API_KEY"] = "" | ||
os.environ["PHOENIX_CLIENT_HEADERS"] = "api_key=" |
There was a problem hiding this comment.
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.
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.
No description provided.