feat: Update project name retrieval in LCModelComponent and CustomComponent (#3506)

Return the project name using get_project_name method in both classes.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-08-22 16:13:22 -03:00 committed by GitHub
commit a98e07e1a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -166,7 +166,7 @@ class LCModelComponent(Component):
runnable = runnable.with_config( # type: ignore
{
"run_name": self.display_name,
"project_name": self._tracing_service.project_name, # type: ignore
"project_name": self.get_project_name(),
"callbacks": self.get_langchain_callbacks(),
}
)

View file

@ -682,3 +682,8 @@ class Component(CustomComponent):
from langflow.base.tools.component_tool import ComponentTool
return ComponentTool(component=self)
def get_project_name(self):
if hasattr(self, "_tracing_service"):
return self._tracing_service.project_name
return "Langflow"