You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I pass a Langfuse callback handler to CrewAI so that the traces are available on their web UI? Here's what I have so far
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model=self.model,
api_key=keys.openai_api_key.get_secret_value(),
temperature=0.0,
callbacks=[LangfuseCallbackHandler()],
)
# this produces traces on Langfuse Web UI - similarly, `llm.predict`, `chain.run` also do
llm.invoke("What are some theories about the relationship between unemployment and inflation?" )
# this does not produce traces
predictor = Agent(
role="Professional Gambler",
goal="XXX",
backstory="XXX",
llm=llm,
)
task_final_decision = Task(
description=MY_PROMPT,
agent=predictor,
)
crew = Crew(
agents=[predictor],
tasks=[task_final_decision],
verbose=2,
)
crew.kickoff()
Any guidance around this integration much appreciated.
The text was updated successfully, but these errors were encountered:
How can I pass a Langfuse callback handler to CrewAI so that the traces are available on their web UI? Here's what I have so far
Any guidance around this integration much appreciated.
The text was updated successfully, but these errors were encountered: