mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
feat: Use json schema for agent tool declaration when feature enabled
Co-authored-by: Xuan Yang <xygoogle@google.com> PiperOrigin-RevId: 854329254
This commit is contained in:
committed by
Copybara-Service
parent
86e7664006
commit
6b241f5ef2
@@ -13,9 +13,9 @@
|
||||
# limitations under the License.
|
||||
|
||||
from enum import Enum
|
||||
from unittest import mock
|
||||
|
||||
from google.adk.features import FeatureName
|
||||
from google.adk.features._feature_registry import temporary_feature_override
|
||||
from google.adk.tools import _automatic_function_calling_util
|
||||
from google.adk.tools.tool_context import ToolContext
|
||||
from google.adk.utils.variant_utils import GoogleLLMVariant
|
||||
@@ -435,11 +435,8 @@ class TestJsonSchemaFeatureFlagEnabled:
|
||||
@pytest.fixture(autouse=True)
|
||||
def enable_feature_flag(self):
|
||||
"""Enable the JSON_SCHEMA_FOR_FUNC_DECL feature flag for all tests."""
|
||||
with mock.patch.object(
|
||||
_automatic_function_calling_util,
|
||||
'is_feature_enabled',
|
||||
autospec=True,
|
||||
side_effect=lambda f: f == FeatureName.JSON_SCHEMA_FOR_FUNC_DECL,
|
||||
with temporary_feature_override(
|
||||
FeatureName.JSON_SCHEMA_FOR_FUNC_DECL, True
|
||||
):
|
||||
yield
|
||||
|
||||
|
||||
Reference in New Issue
Block a user