yeah sure! doing python and here's my code
genai_client = genai.configure(
api_key=GEMINI_API_KEY,
client_options={"api_endpoint": "gateway.helicone.ai"},
default_metadata=[
('helicone-auth', f'Bearer {HELICONE_API_KEY}'),
('helicone-target-url', 'https://generativelanguage.googleapis.com'),
('Helicone-Posthog-Key', 'phc_Po7EZD7NU00cQbjso4HRPeHHAfzw2zfsONUJl0ZVQux'),
('Helicone-Posthog-Host', 'https://us.i.posthog.com'),
],
transport="rest"
)
model = genai.GenerativeModel("gemini-1.5-flash-002")
def call_gemini_flash(prompt: str):
response = model.generate_content(
prompt, generation_config=GenerationConfig(
max_output_tokens=8192,
temperature=0,
))
try:
return response.text.strip().__str__()
except Exception as e:
log_info(response)
return ""