Skip to content

Commit

Permalink
feat: Update project name retrieval in LCModelComponent and CustomCom…
Browse files Browse the repository at this point in the history
…ponent

Return the project name using get_project_name method in both classes.
  • Loading branch information
ogabrielluiz committed Aug 22, 2024
1 parent b5116e6 commit f2a9ba5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/base/langflow/base/models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def get_chat_result(
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(),
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,3 +682,8 @@ def to_tool(self):
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"

0 comments on commit f2a9ba5

Please sign in to comment.