fix: minor bugs and typos

This commit is contained in:
GareArc 2024-08-19 23:47:11 -04:00
parent 33ead9f459
commit ceb444bd22
4 changed files with 3 additions and 6 deletions

View File

@ -1,3 +0,0 @@
# Used to mark a position as excluded.
# See api/core/helper/position_helper.py for more details.
POSITION_EXCLUDED = -999

View File

@ -76,7 +76,7 @@ def is_filtered(
exclude_set: set[str],
data: Any,
name_func: Callable[[Any], str],
) -> list[Any]:
) -> bool:
"""
Chcek if the object should be filtered out.
:param include_set: the set of names to be included

View File

@ -402,7 +402,7 @@ class ToolManager:
db_builtin_providers: list[BuiltinToolProvider] = db.session.query(BuiltinToolProvider). \
filter(BuiltinToolProvider.tenant_id == tenant_id).all()
def find_db_builtin_provider(provider): return next(
find_db_builtin_provider = lambda provider: next(
(x for x in db_builtin_providers if x.provider == provider),
None
)

View File

@ -198,7 +198,7 @@ class BuiltinToolManageService:
).all() or []
# find provider
def find_provider(provider): return next(filter(lambda db_provider: db_provider.provider == provider, db_providers), None)
find_provider = lambda provider: next(filter(lambda db_provider: db_provider.provider == provider, db_providers), None)
result: list[UserToolProvider] = []