forked from trpc-group/trpc-agent-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_skill_list.py
More file actions
32 lines (25 loc) · 1.02 KB
/
Copy path_skill_list.py
File metadata and controls
32 lines (25 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Tencent is pleased to support the open source community by making tRPC-Agent-Python available.
#
# Copyright (C) 2026 Tencent. All rights reserved.
#
# tRPC-Agent-Python is licensed under Apache-2.0.
"""List all discovered skills, including disabled ones with their eligibility status.
"""
from __future__ import annotations
from typing import Literal
from typing import Optional
from trpc_agent_sdk.context import InvocationContext
from .._constants import SKILL_REPOSITORY_KEY
from .._repository import BaseSkillRepository
def skill_list(tool_context: InvocationContext, mode: Literal['all', 'available'] = 'all') -> list[str]:
"""List all discovered skills.
Args:
tool_context: The tool context.
mode: The mode to list skills.
Returns:
A list of skill names.
"""
repository: Optional[BaseSkillRepository] = tool_context.agent_context.get_metadata(SKILL_REPOSITORY_KEY)
if repository is None:
raise ValueError("repository not found")
return repository.skill_list(mode)