"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.Agents = void 0;
const agentsCreate_js_1 = require("../funcs/agentsCreate.js");
const agentsDelete_js_1 = require("../funcs/agentsDelete.js");
const agentsInvoke_js_1 = require("../funcs/agentsInvoke.js");
const agentsList_js_1 = require("../funcs/agentsList.js");
const agentsListActions_js_1 = require("../funcs/agentsListActions.js");
const agentsListTasks_js_1 = require("../funcs/agentsListTasks.js");
const agentsRetrieve_js_1 = require("../funcs/agentsRetrieve.js");
const agentsRetrieveAction_js_1 = require("../funcs/agentsRetrieveAction.js");
const agentsRetrieveTask_js_1 = require("../funcs/agentsRetrieveTask.js");
const agentsRun_js_1 = require("../funcs/agentsRun.js");
const agentsStream_js_1 = require("../funcs/agentsStream.js");
const agentsStreamRun_js_1 = require("../funcs/agentsStreamRun.js");
const agentsUpdate_js_1 = require("../funcs/agentsUpdate.js");
const sdks_js_1 = require("../lib/sdks.js");
const fp_js_1 = require("../types/fp.js");
class Agents extends sdks_js_1.ClientSDK {
    /**
     * Retrieve a specific agent task
     *
     * @remarks
     * Retrieves detailed information about a specific task for a given agent, including execution status and results.
     */
    async retrieveTask(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsRetrieveTask_js_1.agentsRetrieveTask)(this, request, options));
    }
    /**
     * Create a new agent
     *
     * @remarks
     * Creates a new AI agent with specified configuration. Agents can be configured with a primary model and an optional fallback model that will be used automatically if the primary model fails.
     */
    async create(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsCreate_js_1.agentsCreate)(this, request, options));
    }
    /**
     * List all agents
     *
     * @remarks
     * Retrieves a paginated list of all agents in your workspace. Each agent includes its configuration, primary model, and optional fallback model settings.
     */
    async list(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsList_js_1.agentsList)(this, request, options));
    }
    /**
     * Delete an agent
     *
     * @remarks
     * Permanently deletes an agent and all its configuration, including primary and fallback model settings.
     */
    async delete(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsDelete_js_1.agentsDelete)(this, request, options));
    }
    /**
     * Get an agent
     *
     * @remarks
     * Retrieves a single agent by its unique key, including its full configuration with primary and fallback model settings.
     */
    async retrieve(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsRetrieve_js_1.agentsRetrieve)(this, request, options));
    }
    /**
     * Update an agent
     *
     * @remarks
     * Updates an existing agent's configuration. You can update various fields including the model configuration and fallback model settings.
     */
    async update(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsUpdate_js_1.agentsUpdate)(this, request, options));
    }
    /**
     * Invoke an agent
     *
     * @remarks
     * Executes an existing agent with the provided input. The agent uses its pre-configured primary model and will automatically fall back to its configured fallback model if the primary model fails. Fallback models are configured at the agent level, not during execution.
     */
    async invoke(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsInvoke_js_1.agentsInvoke)(this, request, options));
    }
    /**
     * List all tasks for an agent
     *
     * @remarks
     * Retrieves a paginated list of all tasks associated with a specific agent, optionally filtered by status.
     */
    async listTasks(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsListTasks_js_1.agentsListTasks)(this, request, options));
    }
    /**
     * Run an agent
     *
     * @remarks
     * Executes an agent with the provided configuration using A2A message format. If the agent already exists with the same configuration, it will be reused. If the configuration differs, a new version is created. The fallback model is configured at the agent level and will be used automatically if the primary model fails during execution.
     */
    async run(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsRun_js_1.agentsRun)(this, request, options));
    }
    /**
     * Run and stream agent execution
     *
     * @remarks
     * Creates or updates an agent with the provided configuration, then streams execution events via Server-Sent Events (SSE). If the agent already exists with the same configuration, it will be reused. If the configuration differs, a new version is created. The stream will continue until the agent completes, errors, or reaches the configured timeout.
     */
    async streamRun(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsStreamRun_js_1.agentsStreamRun)(this, request, options));
    }
    /**
     * Stream agent execution events
     *
     * @remarks
     * Executes an agent and streams events via Server-Sent Events (SSE). The stream will continue until the agent completes, errors, or reaches the configured timeout.
     */
    async stream(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsStream_js_1.agentsStream)(this, request, options));
    }
    /**
     * List all actions
     */
    async listActions(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsListActions_js_1.agentsListActions)(this, request, options));
    }
    /**
     * Retrieve an action executed by an agent task.
     */
    async retrieveAction(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsRetrieveAction_js_1.agentsRetrieveAction)(this, request, options));
    }
}
exports.Agents = Agents;
//# sourceMappingURL=agents.js.map