mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 11:29:39 +08:00
feat: add logo for requesters (#1300)
This commit is contained in:
committed by
GitHub
parent
2fdb53efc9
commit
69435c04cc
@@ -4,7 +4,7 @@ import typing
|
||||
import importlib
|
||||
import os
|
||||
import inspect
|
||||
|
||||
import mimetypes
|
||||
import yaml
|
||||
import pydantic
|
||||
|
||||
@@ -154,6 +154,11 @@ class Component(pydantic.BaseModel):
|
||||
"""组件可执行文件信息"""
|
||||
return self._execution
|
||||
|
||||
@property
|
||||
def icon_rel_path(self) -> str:
|
||||
"""图标相对路径"""
|
||||
return os.path.join(self.rel_dir, self.metadata.icon) if self.metadata.icon is not None and self.metadata.icon.strip() != '' else None
|
||||
|
||||
def get_python_component_class(self) -> typing.Type[typing.Any]:
|
||||
"""获取Python组件类"""
|
||||
module_path = os.path.join(self.rel_dir, self.execution.python.path)
|
||||
|
||||
Reference in New Issue
Block a user