Skip to content

Latest commit

 

History

History
52 lines (33 loc) · 9.68 KB

README.md

File metadata and controls

52 lines (33 loc) · 9.68 KB

Admin.Agents

Overview

Available Operations

  • list - List all agents

list

List every agent in the workspace, ordered by name and then by agent_id. Each agent has the same shape that Get agent returns. 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 left out. Use the agent_id with other Platform APIs, for example as a 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 supported fields are name and description, with the operator EQUALS. Multiple values OR within a filter. Multiple filters AND together, and each field can appear in only one filter. For example, to return agents whose name contains "HR", send [{"field":"name","values":["HR"]}].
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 */*