feature(wren-ai-service): integrate Langfuse SDK to represent the evaluation result#395
Conversation
There was a problem hiding this comment.
should we call langfuse_context.flush() during the server shutdown event in the lifespan function in wren-ai-service/src/__main__.py?
Also in each pipeline, you call langfuse_context.flush() in the end, I wonder what would happen if langfuse is disabled then?
There was a problem hiding this comment.
I suppose we also need to add langfuse related env to .env.prod.example, wren-ai-service/docker/docker-compose.yml, docker/.env.example and docker/docker-compose-dev.yaml, docker/docker-compose.yaml?
There was a problem hiding this comment.
Maybe we can also setup thie environment variable in the future? LANGFUSE_DEBUG
There was a problem hiding this comment.
This can be added in the initialization part: Authentication check
There was a problem hiding this comment.
We should manually add input/output data if needed: https://langfuse.com/docs/sdk/python/decorators#large-inputoutput-data
|
Overall LGTM, I would like to discuss with you the |
|
After a discussion with @cyyeh, we decided not to capture the span input for all steps. Other suggestions, such as the Langfuse debug mode and authentication check, are interesting features. However, we will not include them in this PR as it is focused on the evaluation framework. |
…luation result (#395) * fix: phony demo folder (#394) * chore: upgrade the libs * chore: environment variables for Langfuse * feature: langfuse configuration initialize * feature: integrate the langfuse into pipelines * feature: don't capture the input and embedding output * feature: decorator on the concept pipelines * chore: add env variables into docker componse file
…luation result (#395) * fix: phony demo folder (#394) * chore: upgrade the libs * chore: environment variables for Langfuse * feature: langfuse configuration initialize * feature: integrate the langfuse into pipelines * feature: don't capture the input and embedding output * feature: decorator on the concept pipelines * chore: add env variables into docker componse file
This PR aims to integrate the decorator-based Langfuse SDK to collect data for the evaluation process. By default, the environment setup is disabled. To enable Langfuse, follow these steps:
Fill in the environment variables. You can generate the secret key, public key, and host by following the instructions at Langfuse Documentation.
Currently, we don't set the session ID. When implementing the main process for the evaluation, refer to the following code to set up the session ID.
Screenshots