mirascope.integrations.langfuse | Mirascope
MirascopeLilypad

mirascope.integrations.langfuse

Alias with_langfuse

Wraps a Mirascope function with Langfuse.

Example:

from mirascope.core import anthropic, prompt_template
from mirascope.integrations.langfuse import with_langfuse


def format_book(title: str, author: str):
    return f"{title} by {author}"


@with_langfuse()
@anthropic.call(model="claude-3-5-sonnet-20240620", tools=[format_book])
def recommend_book(genre: str) -> str:
    return f"Recommend a {genre} book"


print(recommend_book("fantasy"))

Returns

TypeDescription
(() => _R) => () => _R-

Alias to: mirascope.integrations.langfuse._with_langfuse.with_langfuse