Skip to content

Latest commit

 

History

History
52 lines (33 loc) · 10.7 KB

README.md

File metadata and controls

52 lines (33 loc) · 10.7 KB

Admin.Agents

Overview

Available Operations

  • list - List all agents

list

List every agent in the workspace, ordered by display_name and then by agent_id. Unlike agent search, the list does not depend on who an agent is shared with, so it includes private and disabled agents. Deleted agents are inactive and are left out unless an is_active filter includes the value "false". Use the agent_id of an active agent with other Platform APIs, for example as a usage limit target. A deleted agent is not a valid usage limit target. The caller must be able to read all agents, administer agents, or read workspace billing.

Example Usage

from glean.api_client import Glean
import os


with Glean(
    api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:

    res = glean.admin.agents.list(page_size=50)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
page_size Optional[int] ➖ Maximum number of agents to return. Defaults to 50. Maximum is 100.
cursor Optional[str] ➖ Opaque pagination cursor from a previous response. Send the same filters that the previous request used.
filters List[models.PlatformAdminAgentFilter] ➖ JSON-encoded filters that choose which agents are returned. The only supported field is is_active, with the values "true" and "false" and the operator EQUALS. Multiple values OR within a filter. Multiple filters AND together. Without an is_active filter, only active agents are returned. To return active and deleted agents, send [{"field":"is_active","values":["true","false"]}].
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.PlatformListAdminAgentsResponse

Errors

Error Type Status Code Content Type
errors.PlatformProblemDetailError 400, 401, 403, 404, 408, 429 application/problem+json
errors.PlatformProblemDetailError 500, 503 application/problem+json
errors.GleanError 4XX, 5XX */*