Skip to content

Commit 1585602

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
fix: Fix SkillRevision state enum in Python SDK
PiperOrigin-RevId: 917434095
1 parent bc4be37 commit 1585602

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

agentplatform/_genai/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,7 @@
13131313
from .common import SkillRevision
13141314
from .common import SkillRevisionDict
13151315
from .common import SkillRevisionOrDict
1316+
from .common import SkillRevisionState
13161317
from .common import SkillState
13171318
from .common import State
13181319
from .common import Strategy
@@ -2736,6 +2737,7 @@
27362737
"OptimizeTarget",
27372738
"MemoryMetadataMergeStrategy",
27382739
"GenerateMemoriesResponseGeneratedMemoryAction",
2740+
"SkillRevisionState",
27392741
"PromptOptimizerMethod",
27402742
"OptimizationMethod",
27412743
"PromptData",

agentplatform/_genai/types/common.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,21 @@ class GenerateMemoriesResponseGeneratedMemoryAction(_common.CaseInSensitiveEnum)
478478
"""The memory was deleted."""
479479

480480

481+
class SkillRevisionState(_common.CaseInSensitiveEnum):
482+
"""State of the Skill Revision."""
483+
484+
STATE_UNSPECIFIED = "STATE_UNSPECIFIED"
485+
"""The state of the Skill Revision is unspecified."""
486+
ACTIVE = "ACTIVE"
487+
"""The Skill Revision is active."""
488+
CREATING = "CREATING"
489+
"""The Skill Revision is being created."""
490+
FAILED = "FAILED"
491+
"""The Skill Revision was created, but failed to process."""
492+
DELETING = "DELETING"
493+
"""The Skill Revision is being deleted."""
494+
495+
481496
class PromptOptimizerMethod(_common.CaseInSensitiveEnum):
482497
"""The method for data driven prompt optimization."""
483498

@@ -18722,7 +18737,7 @@ class SkillRevision(_common.BaseModel):
1872218737
default=None,
1872318738
description="""Output only. The state of the Skill at this revision. TODO(b/503772996) Use a different proto for skill data included in skill revision""",
1872418739
)
18725-
state: Optional[SkillState] = Field(
18740+
state: Optional[SkillRevisionState] = Field(
1872618741
default=None, description="""Output only. The state of the Skill Revision."""
1872718742
)
1872818743

@@ -18738,7 +18753,7 @@ class SkillRevisionDict(TypedDict, total=False):
1873818753
skill: Optional[SkillDict]
1873918754
"""Output only. The state of the Skill at this revision. TODO(b/503772996) Use a different proto for skill data included in skill revision"""
1874018755

18741-
state: Optional[SkillState]
18756+
state: Optional[SkillRevisionState]
1874218757
"""Output only. The state of the Skill Revision."""
1874318758

1874418759

tests/unit/agentplatform/genai/replays/test_skills_revisions_get.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_get_skill_revision(client, tmp_path):
5454

5555
assert isinstance(revision, types.SkillRevision)
5656
assert revision.name == first_revision.name
57-
assert revision.state == types.SkillState.ACTIVE
57+
assert revision.state == types.SkillRevisionState.ACTIVE
5858

5959
finally:
6060
# 4. Clean up the temporary skill

0 commit comments

Comments
 (0)