@@ -149,10 +149,14 @@ export class Agents extends APIResource {
149149 }
150150
151151 /**
152- * Get the total number of agents.
152+ * Get the total number of agents with optional filtering. Supports the same
153+ * filters as list_agents for consistent querying.
153154 */
154- count ( options ?: RequestOptions ) : APIPromise < AgentCountResponse > {
155- return this . _client . get ( '/v1/agents/count' , options ) ;
155+ count (
156+ query : AgentCountParams | null | undefined = { } ,
157+ options ?: RequestOptions ,
158+ ) : APIPromise < AgentCountResponse > {
159+ return this . _client . get ( '/v1/agents/count' , { query, ...options } ) ;
156160 }
157161
158162 /**
@@ -1491,6 +1495,59 @@ export interface AgentListParams extends ArrayPageParams {
14911495 template_id ?: string | null ;
14921496}
14931497
1498+ export interface AgentCountParams {
1499+ /**
1500+ * Search agents by base template ID
1501+ */
1502+ base_template_id ?: string | null ;
1503+
1504+ /**
1505+ * Search agents by identifier keys
1506+ */
1507+ identifier_keys ?: Array < string > | null ;
1508+
1509+ /**
1510+ * Search agents by identity ID
1511+ */
1512+ identity_id ?: string | null ;
1513+
1514+ /**
1515+ * Filter agents by their last stop reason.
1516+ */
1517+ last_stop_reason ?: RunsAPI . StopReasonType | null ;
1518+
1519+ /**
1520+ * If True, only counts agents that match ALL given tags. Otherwise, counts agents
1521+ * that have ANY of the passed-in tags.
1522+ */
1523+ match_all_tags ?: boolean ;
1524+
1525+ /**
1526+ * Name of the agent
1527+ */
1528+ name ?: string | null ;
1529+
1530+ /**
1531+ * Search agents by project ID - this will default to your default project on cloud
1532+ */
1533+ project_id ?: string | null ;
1534+
1535+ /**
1536+ * Search agents by name
1537+ */
1538+ query_text ?: string | null ;
1539+
1540+ /**
1541+ * List of tags to filter agents by
1542+ */
1543+ tags ?: Array < string > | null ;
1544+
1545+ /**
1546+ * Search agents by template ID
1547+ */
1548+ template_id ?: string | null ;
1549+ }
1550+
14941551export interface AgentExportFileParams {
14951552 /**
14961553 * @deprecated
@@ -1811,6 +1868,7 @@ export declare namespace Agents {
18111868 type AgentCreateParams as AgentCreateParams ,
18121869 type AgentRetrieveParams as AgentRetrieveParams ,
18131870 type AgentListParams as AgentListParams ,
1871+ type AgentCountParams as AgentCountParams ,
18141872 type AgentExportFileParams as AgentExportFileParams ,
18151873 type AgentImportFileParams as AgentImportFileParams ,
18161874 type AgentModifyParams as AgentModifyParams ,
0 commit comments