POST
/
rest
/
api
/
v1
/
agents
/
runs
/
wait
from glean import Glean
import os


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

    res = g_client.client.agents.run()

    # Handle response
    print(res)
{
  "run": {
    "agent_id": "<string>",
    "input": {},
    "messages": [
      {
        "role": "<string>",
        "content": [
          {
            "text": "<string>",
            "type": "text"
          }
        ]
      }
    ],
    "status": "error"
  },
  "messages": [
    {
      "role": "<string>",
      "content": [
        {
          "text": "<string>",
          "type": "text"
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Payload for creating a run.

Response

200
application/json

Success

The response is of type object.