@squidcloud/client
    Preparing search index...

    Class AiAgentReference

    AiAgentReference provides methods for managing AI agents, including retrieving, updating, and deleting agents, handling agent contexts, and interacting with chat or voice-based AI functionalities.

    Index

    Methods

    • Sends a prompt and receives a full string response.

      Type Parameters

      • T extends undefined | string = undefined

      Parameters

      • prompt: string

        The text prompt to send to the agent.

      • Optionaloptions: AiAskOptions<T>

        Optional parameters for the AI ask request.

      • OptionaljobId: string

        (Optional) A unique identifier for this request. Use it with squid.jobs().awaitJob(jobId) or squid.jobs().getJob(jobId) to track progress. Make sure each job ID is both unique and kept private—anyone who knows it can look up the job’s status.

      Returns Promise<string>

    • Sends a prompt and not wait for the result - the result can be tracked using the job ID (squid.jobs().awaitJob(jobId) or squid.jobs().getJob(jobId)). @param prompt The text prompt to send to the agent. @param jobId A unique identifier for this request. Use it with squid.jobs().awaitJob(jobId)or squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who knows it can look up the job’s status.

      Type Parameters

      • T extends undefined | string = undefined

      Parameters

      • prompt: string
      • jobId: string
      • Optionaloptions: AiAskOptions<T>

        Optional parameters for the AI ask request.

      Returns Promise<void>

    • Sends a prompt and gets both text and voice response from the agent.

      Type Parameters

      • T extends undefined | string

      Parameters

      • prompt: string

        The text prompt to send to the agent.

      • Optionaloptions: AiAskOptionsWithVoice<T>

        Optional parameters for the AI ask request.

      • OptionaljobId: string

        (Optional) A unique identifier for this request. Use it with squid.jobs().awaitJob(jobId) or squid.jobs().getJob(jobId) to track progress. Make sure each job ID is both unique and kept private—anyone who knows it can look up the job’s status.

      Returns Promise<AskWithVoiceResponse>

    • Sends a prompt to the agent and receives streamed text responses.

      Type Parameters

      • T extends undefined | string

      Parameters

      • prompt: string

        The text prompt to send to the agent.

      • Optionaloptions: AiChatOptionsWithoutVoice<T>

        Optional parameters for the AI ask request.

      • OptionaljobId: string

        (Optional) A unique identifier for this request. Use it with squid.jobs().awaitJob(jobId) or squid.jobs().getJob(jobId) to track progress. Make sure each job ID is both unique and kept private—anyone who knows it can look up the job’s status.

      Returns Observable<string>

    • Deletes the AI agent.

      Returns Promise<void>

    • Deletes a specific context by its ID.

      Parameters

      • contextId: string

      Returns Promise<void>

    • Deletes multiple agent contexts.

      Parameters

      • contextIds: string[]

      Returns Promise<void>

    • Deletes the custom guardrails for the agent.

      Returns Promise<void>

    • Retrieves metadata and configuration of the AI agent.

      Returns Promise<undefined | AiAgent<undefined>>

    • Retrieves a specific agent context by its ID.

      Parameters

      • contextId: string

      Returns Promise<undefined | AiAgentContext>

    • Sends user feedback to the agent.

      Parameters

      • feedback: string

      Returns Promise<void>

    • Resets any feedback previously provided to the agent.

      Returns Promise<void>

    • Transcribes audio and sends it to the agent for response.

      Type Parameters

      • T extends undefined | string

      Parameters

      • fileToTranscribe: File

        The audio file to transcribe and send to the agent.

      • Optionaloptions: AiAskOptions<T>

        Optional parameters for the AI ask request.

      • OptionaljobId: string

        (Optional) A unique identifier for this request. Use it with squid.jobs().awaitJob(jobId) or squid.jobs().getJob(jobId) to track progress. Make sure each job ID is both unique and kept private—anyone who knows it can look up the job’s status.

      Returns Promise<AiTranscribeAndAskResponse>

    • Transcribes audio and gets both text and voice response from the agent.

      Type Parameters

      • T extends undefined | string

      Parameters

      • fileToTranscribe: File

        The audio file to transcribe and send to the agent.

      • Optionaloptions: AiAskOptionsWithVoice<T>

        Optional parameters for the AI ask request.

      • OptionaljobId: string

        (Optional) A unique identifier for this request. Use it with squid.jobs().awaitJob(jobId) or squid.jobs().getJob(jobId) to track progress. Make sure each job ID is both unique and kept private—anyone who knows it can look up the job’s status.

      Returns Promise<TranscribeAndAskWithVoiceResponse>

    • Transcribes the given file and performs a chat interaction.

      Parameters

      • fileToTranscribe: File

        The audio file to transcribe and send to the agent.

      • Optionaloptions: AiChatOptionsWithoutVoice

        Optional parameters for the AI ask request.

      • OptionaljobId: string

        (Optional) A unique identifier for this request. Use it with squid.jobs().awaitJob(jobId) or squid.jobs().getJob(jobId) to track progress. Make sure each job ID is both unique and kept private—anyone who knows it can look up the job’s status.

      Returns Promise<TranscribeAndChatResponse>

    • Updates the agent's custom guardrails with the provided custom guardrail.

      Parameters

      • customGuardrail: string

      Returns Promise<void>

    • Updates the agent's guardrails with the provided options.

      Parameters

      Returns Promise<void>

    • Updates the agent's instruction prompt.

      Parameters

      • instructions: string

      Returns Promise<void>

    • Changes the AI model used by the agent.

      Parameters

      • model: string

      Returns Promise<void>

    • Adds or updates a single agent context.

      Parameters

      Returns Promise<void>

    • Adds or updates multiple agent contexts.

      Parameters

      Returns Promise<void>