Skip to content

Commit ebb632a

Browse files
feat(api): add agent_card_metadata parameter to agents list method
1 parent 0db6037 commit ebb632a

4 files changed

Lines changed: 32 additions & 2 deletions

File tree

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 75
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp/agentex-sdk-ee0c521f0612c31b874bd595b90cd9209545bab603983552a1a7a87f38ed931e.yml
3-
openapi_spec_hash: 917a1ffe9e353bed2740524dec786ed2
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp/agentex-sdk-fbc0683871d6abb03588f30d9468eeeeacb2b8538eb0c9002813e6df68c5802b.yml
3+
openapi_spec_hash: 4ecd8d496f056dccf80826264ddf8fe1
44
config_hash: 593e89b291976a5e84e4c3c3f8324354

‎src/agentex/resources/agents/agents.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def retrieve(
116116
def list(
117117
self,
118118
*,
119+
agent_card_metadata: Optional[str] | Omit = omit,
119120
limit: int | Omit = omit,
120121
order_by: Optional[str] | Omit = omit,
121122
order_direction: str | Omit = omit,
@@ -132,6 +133,13 @@ def list(
132133
List all registered agents, optionally filtered by query parameters.
133134
134135
Args:
136+
agent_card_metadata: JSON-encoded object used to filter agents on
137+
`registration_metadata.agent_card.metadata` via JSONB containment. Example:
138+
{"permits_capable": true}. Only matches cards published through the direct
139+
registration path: registrations that carry a `deployment_id` write the card to
140+
the deployment record instead of `registration_metadata`, so those agents never
141+
match this filter.
142+
135143
limit: Limit
136144
137145
order_by: Field to order by
@@ -159,6 +167,7 @@ def list(
159167
timeout=timeout,
160168
query=maybe_transform(
161169
{
170+
"agent_card_metadata": agent_card_metadata,
162171
"limit": limit,
163172
"order_by": order_by,
164173
"order_direction": order_direction,
@@ -777,6 +786,7 @@ async def retrieve(
777786
async def list(
778787
self,
779788
*,
789+
agent_card_metadata: Optional[str] | Omit = omit,
780790
limit: int | Omit = omit,
781791
order_by: Optional[str] | Omit = omit,
782792
order_direction: str | Omit = omit,
@@ -793,6 +803,13 @@ async def list(
793803
List all registered agents, optionally filtered by query parameters.
794804
795805
Args:
806+
agent_card_metadata: JSON-encoded object used to filter agents on
807+
`registration_metadata.agent_card.metadata` via JSONB containment. Example:
808+
{"permits_capable": true}. Only matches cards published through the direct
809+
registration path: registrations that carry a `deployment_id` write the card to
810+
the deployment record instead of `registration_metadata`, so those agents never
811+
match this filter.
812+
796813
limit: Limit
797814
798815
order_by: Field to order by
@@ -820,6 +837,7 @@ async def list(
820837
timeout=timeout,
821838
query=await async_maybe_transform(
822839
{
840+
"agent_card_metadata": agent_card_metadata,
823841
"limit": limit,
824842
"order_by": order_by,
825843
"order_direction": order_direction,

‎src/agentex/types/agent_list_params.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@
99

1010

1111
class AgentListParams(TypedDict, total=False):
12+
agent_card_metadata: Optional[str]
13+
"""
14+
JSON-encoded object used to filter agents on
15+
`registration_metadata.agent_card.metadata` via JSONB containment. Example:
16+
{"permits_capable": true}. Only matches cards published through the direct
17+
registration path: registrations that carry a `deployment_id` write the card to
18+
the deployment record instead of `registration_metadata`, so those agents never
19+
match this filter.
20+
"""
21+
1222
limit: int
1323
"""Limit"""
1424

‎tests/api_resources/test_agents.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def test_method_list(self, client: Agentex) -> None:
7575
@parametrize
7676
def test_method_list_with_all_params(self, client: Agentex) -> None:
7777
agent = client.agents.list(
78+
agent_card_metadata="agent_card_metadata",
7879
limit=1,
7980
order_by="order_by",
8081
order_direction="order_direction",
@@ -469,6 +470,7 @@ async def test_method_list(self, async_client: AsyncAgentex) -> None:
469470
@parametrize
470471
async def test_method_list_with_all_params(self, async_client: AsyncAgentex) -> None:
471472
agent = await async_client.agents.list(
473+
agent_card_metadata="agent_card_metadata",
472474
limit=1,
473475
order_by="order_by",
474476
order_direction="order_direction",

0 commit comments

Comments
 (0)