Callback - Langfuse
Eino encapsulates langfuse’s trace capabilities based on Eino: Callback Manual capabilities (see https://langfuse.com/docs/get-started).
An example usage is as follows:
package main
import (
"github.com/cloudwego/eino-ext/callbacks/langfuse"
"github.com/cloudwego/eino/callbacks"
)
func main() {
cbh, flusher := NewLangfuseHandler(&_Config_{
Host: "https://cloud.langfuse.com",
PublicKey: "pk-xxx",
SecretKey: "sk-xxx",
})
**callbacks**.InitCallbackHandlers([]**callbacks**._Handler_{cbh}) // Set langfuse as a global callback
g := NewGraph[string,string]()
/*
* compose and run graph
*/
flusher() // Exit after all trace reporting is complete
}
You can view the trace in the Langfuse project:
Last modified
February 21, 2025
: doc: add eino english docs (#1255) (4f6a3bd)