PrefectHQ / marvin

✨ Build AI interfaces that spark joy
https://askmarvin.ai
Apache License 2.0
5.34k stars 348 forks source link

Is there a way to integrate observability tools like Helicone/Vellum? #935

Closed sgondala closed 5 months ago

sgondala commented 6 months ago

Is there a way to integrate observability tools like Helicone?

Steps to integrate these are by changing OpenAI's base URL and headers

client = OpenAI(
  api_key="your-api-key-here",  # Replace with your OpenAI API key
  base_url="https://oai.hconeai.com/v1",  # Set the API endpoint
  default_headers= {  # Optionally set default headers or set per request (see below)
    "Helicone-Auth": f"Bearer {HELICONE_API_KEY}",
  }
)

I couldn't find a way to do this in marvin as the opeani client isn't exposed

zzstoatzz commented 5 months ago

hi @sgondala

all the the main functions like fn, cast, extract etc accept a client in the decorator kwargs like this

if there's a place where you can't pass it through and would like to, let us know!