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 (#3506)

Return the project name using get_project_name method in both classes.
  • Loading branch information
ogabrielluiz committed Aug 27, 2024
1 parent 49f08a1 commit a2274a7
Show file tree
Hide file tree
Showing 2 changed files with 5 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 @@ -715,3 +715,7 @@ def log(self, message: LoggableType | list[LoggableType], name: Optional[str] =
data["output"] = self._current_output
data["component_id"] = self._id
self._log_callback(event_name, data)
def get_project_name(self):
if hasattr(self, "_tracing_service"):
return self._tracing_service.project_name
return "Langflow"

0 comments on commit a2274a7

Please sign in to comment.