Provides API endpoints related to agents
Summary
Functions
Create an agent
Create an agent run and stream the response
Create an agent run and wait for the response
Edit an agent
Retrieve an agent
List an agent's schemas
Import an agent
Search agents
Functions
@spec create_agent( body :: Gleanex.Client.CreateWorkflowRequest.t(), opts :: keyword() ) :: {:ok, Gleanex.Client.CreateWorkflowResponse.t()} | {:error, Gleanex.Error.t()}
Create an agent
Create an agent.
Options
locale: The client's preferred locale in rfc5646 format (e.g.en,ja,pt-BR). If omitted, theAccept-Languagewill be used. If not present or not supported, defaults to the closest match oren.timezoneOffset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.
Request Body
Content Types: application/json
@spec create_and_stream_run( body :: Gleanex.Client.AgentRunCreate.t(), opts :: keyword() ) :: {:ok, String.t()} | {:error, Gleanex.Error.t()}
Create an agent run and stream the response
Executes an agent run and returns the result as a stream of server-sent events (SSE). Note: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the input object.
Request Body
Content Types: application/json
@spec create_and_wait_run( body :: Gleanex.Client.AgentRunCreate.t(), opts :: keyword() ) :: {:ok, Gleanex.Client.AgentRunWaitResponse.t()} | {:error, Gleanex.Error.t()}
Create an agent run and wait for the response
Executes an agent run and returns the final response. Note: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the input object.
Request Body
Content Types: application/json
@spec edit_agent( agent_id :: String.t(), body :: Gleanex.Client.EditWorkflowRequest.t(), opts :: keyword() ) :: :ok | {:error, Gleanex.Error.t()}
Edit an agent
Creates a draft or publishes an agent. Use isDraft=true to save a draft, or isDraft=false (or omit) to publish immediately. Only draft and publish modes are supported.
Options
locale: The client's preferred locale in rfc5646 format (e.g.en,ja,pt-BR). If omitted, theAccept-Languagewill be used. If not present or not supported, defaults to the closest match oren.timezoneOffset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.
Request Body
Content Types: application/json
@spec get_agent(agent_id :: String.t(), opts :: keyword()) :: {:ok, Gleanex.Client.Agent.t()} | {:error, Gleanex.Error.t()}
Retrieve an agent
Returns details of an agent created in the Agent Builder.
Options
locale: The client's preferred locale in rfc5646 format (e.g.en,ja,pt-BR). If omitted, theAccept-Languagewill be used. If not present or not supported, defaults to the closest match oren.timezoneOffset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.
@spec get_agent_schemas(agent_id :: String.t(), opts :: keyword()) :: {:ok, Gleanex.Client.AgentSchemas.t()} | {:error, Gleanex.Error.t()}
List an agent's schemas
Return agent's input and output schemas. You can use these schemas to detect changes to an agent's input or output structure.
Options
locale: The client's preferred locale in rfc5646 format (e.g.en,ja,pt-BR). If omitted, theAccept-Languagewill be used. If not present or not supported, defaults to the closest match oren.timezoneOffset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.
@spec import_agent( agent_id :: String.t(), body :: Gleanex.Client.ImportAgentRequest.t(), opts :: keyword() ) :: {:ok, Gleanex.Client.ImportAgentResponse.t()} | {:error, Gleanex.Error.t()}
Import an agent
Imports an agent from its on-disk folder representation (spec.yaml, instructions.md, skills/, subagents/) packaged as a zip, and creates or updates the agent. Inverse of the export flow: the folder-to-schema conversion runs server-side. The bundle must contain only regular files; symlinks are resolved by the caller at packaging time.
Options
locale: The client's preferred locale in rfc5646 format (e.g.en,ja,pt-BR). If omitted, theAccept-Languagewill be used. If not present or not supported, defaults to the closest match oren.timezoneOffset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.
Request Body
Content Types: multipart/form-data
@spec search_agents(body :: Gleanex.Client.SearchAgentsRequest.t(), opts :: keyword()) :: {:ok, Gleanex.Client.SearchAgentsResponse.t()} | {:error, Gleanex.Error.t()}
Search agents
Search for agents by agent name.
Request Body
Content Types: application/json