Ash
Ash
LLangfuse
Created by Ash on 8/27/2024 in #support
tags and metadata not visible in traces in langchain(crewai)
Hi everyone, I am using langfuse for monitoring my crewai agent calls. I am able to generate the traces using decorators, passing the tags with langfuse_context and passing that in callbacks. Below is my code example
from langfuse.decorators import langfuse_context, observe
@observe()
def question_extractor(self, llm_api):
langfuse_context.update_current_trace(
tags=["Question_Extracting_Agent"],
metadata={"agent_type": "question_extractor"},
)
langfuse_handler = langfuse_context.get_current_langchain_handler()
return Agent(
role="Question Agent",
goal="Extract key information ",
backstory="You analyze text to identify questions, concerns, and relevant details.",
llm=llm_api,
callbacks=[langfuse_handler]
)
from langfuse.decorators import langfuse_context, observe
@observe()
def question_extractor(self, llm_api):
langfuse_context.update_current_trace(
tags=["Question_Extracting_Agent"],
metadata={"agent_type": "question_extractor"},
)
langfuse_handler = langfuse_context.get_current_langchain_handler()
return Agent(
role="Question Agent",
goal="Extract key information ",
backstory="You analyze text to identify questions, concerns, and relevant details.",
llm=llm_api,
callbacks=[langfuse_handler]
)
But couldn't able to get any tags or metadata in my trace.
7 replies