langfuser add view button (#7571)

This commit is contained in:
Charlie.Wei
2024-08-23 15:53:49 +08:00
committed by GitHub
parent 6025002971
commit 9864b35465
8 changed files with 61 additions and 9 deletions

View File

@ -419,3 +419,11 @@ class LangFuseDataTrace(BaseTraceInstance):
except Exception as e:
logger.debug(f"LangFuse API check failed: {str(e)}")
raise ValueError(f"LangFuse API check failed: {str(e)}")
def get_project_key(self):
try:
projects = self.langfuse_client.client.projects.get()
return projects.data[0].id
except Exception as e:
logger.debug(f"LangFuse get project key failed: {str(e)}")
raise ValueError(f"LangFuse get project key failed: {str(e)}")