Skip to content

Instantly share code, notes, and snippets.

@achinta
Created February 22, 2025 04:28
Show Gist options
  • Save achinta/fc0f4c82ff2bd47856a7db8380b1e9fc to your computer and use it in GitHub Desktop.
Save achinta/fc0f4c82ff2bd47856a7db8380b1e9fc to your computer and use it in GitHub Desktop.
Create Langfuse span manually
from langfuse.callback import CallbackHandler
from langfuse import Langfuse
callback_handler = CallbackHandler()
langfuse = Langfuse()
span = langfuse.span(trace_id=trace_id, input=openai_messages, name=trace_span_name)
response = [] # LLM call here and get response
span.end(output=response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment