fix: Re-export DEFAULT_SKILL_SYSTEM_INSTRUCTION to skills and skill/prompt.py to avoid breaking current users

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 875407169
This commit is contained in:
Kathy Wu
2026-02-25 17:17:58 -08:00
committed by Copybara-Service
parent 5702a4b1f5
commit de4dee899c
2 changed files with 42 additions and 0 deletions
+22
View File
@@ -14,6 +14,9 @@
"""Agent Development Kit - Skills."""
from typing import Any
import warnings
from ._utils import _load_skill_from_dir as load_skill_from_dir
from .models import Frontmatter
from .models import Resources
@@ -21,9 +24,28 @@ from .models import Script
from .models import Skill
__all__ = [
"DEFAULT_SKILL_SYSTEM_INSTRUCTION",
"Frontmatter",
"Resources",
"Script",
"Skill",
"load_skill_from_dir",
]
def __getattr__(name: str) -> Any:
if name == "DEFAULT_SKILL_SYSTEM_INSTRUCTION":
from ..tools import skill_toolset
warnings.warn(
(
"Importing DEFAULT_SKILL_SYSTEM_INSTRUCTION from"
" google.adk.skills is deprecated."
" Please import it from google.adk.tools.skill_toolset instead."
),
DeprecationWarning,
stacklevel=2,
)
return skill_toolset.DEFAULT_SKILL_SYSTEM_INSTRUCTION
raise AttributeError(f"module {__name__} has no attribute {name}")
+20
View File
@@ -17,8 +17,10 @@
from __future__ import annotations
import html
from typing import Any
from typing import List
from typing import Union
import warnings
from . import models
@@ -54,3 +56,21 @@ def format_skills_as_xml(
lines.append("</available_skills>")
return "\n".join(lines)
def __getattr__(name: str) -> Any:
if name == "DEFAULT_SKILL_SYSTEM_INSTRUCTION":
from ..tools import skill_toolset
warnings.warn(
(
"Importing DEFAULT_SKILL_SYSTEM_INSTRUCTION from"
" google.adk.skills.prompt is deprecated."
" Please import it from google.adk.tools.skill_toolset instead."
),
DeprecationWarning,
stacklevel=2,
)
return skill_toolset.DEFAULT_SKILL_SYSTEM_INSTRUCTION
raise AttributeError(f"module {__name__} has no attribute {name}")