Skip to content

v3.2.6

Choose a tag to compare

@zzstoatzz zzstoatzz released this 22 Jan 18:01
· 45 commits to main since this release
377d08d

What's New

OpenAI Observability Integration (Beta)

Added marvin.beta.observability.openai module that enables tracing Marvin agent calls to OpenAI's observability dashboard. When running inside Prefect flows/tasks, it automatically captures runtime context (flow_run_id, task_run_id, deployment info) and sends it as request metadata.

Usage:

from prefect import flow, task
import marvin
from marvin.beta.observability.openai import observable

agent = marvin.Agent(name="analyst", model="openai:gpt-4o")

@task
async def summarize(text: str) -> str:
    return await observable(agent).run_async(f"Summarize: {text}")

@flow
async def my_pipeline(document: str):
    return await summarize(document)

View requests at https://platform.openai.com/logs and filter by prefect.flow_run.id to see all AI calls from one flow run.

Installation:

uv add "marvin[prefect]"

Full Changelog

v3.2.5...v3.2.6