@nevermined-io/payments
    Preparing search index...

    Class AIQueryApi

    The AIQueryApi class provides methods to query AI Agents on Nevermined.

    This API is oriented for AI users who already purchased access to an AI Agent and want to start querying them.

    Hierarchy

    • AbstractHTTPClient
      • AIQueryApi
    Index

    Constructors

    Methods

    • Parameters

      • url: string
      • data: any
      • reqOptions: HTTPRequestOptions

      Returns Promise<AxiosResponse<any, any, {}>>

    • Parameters

      • url: string
      • reqOptions: HTTPRequestOptions = ...

      Returns Promise<AxiosResponse<any, any, {}>>

    • Parameters

      • requestHeaders: { [key: string]: string }
      • OptionalaccessToken: string

      Returns { Authorization?: string }

    • Parameters

      • urlRequested: string
      • reqOptions: HTTPRequestOptions

      Returns string

    post

    • post(
          url: string,
          data: any,
          reqOptions: HTTPRequestOptions,
      ): Promise<AxiosResponse<any, any, {}>>

      Parameters

      • url: string
      • data: any
      • reqOptions: HTTPRequestOptions

      Returns Promise<AxiosResponse<any, any, {}>>

    • Parameters

      • url: string
      • data: any
      • reqOptions: HTTPRequestOptions

      Returns Promise<AxiosResponse<any, any, {}>>

    • Parameters

      • method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH"
      • url: string
      • Optionaldata: any
      • reqOptions: HTTPRequestOptions = ...

      Returns Promise<AxiosResponse<any, any, {}>>

    • It sends a request to the AI Agent/Service.

      Parameters

      • accessCredentials: AgentAccessCredentials
      • method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH"

        The HTTP method to use when querying the Agent

      • url: string

        The URL of the endpoint to query the Agent/Service.

      • Optionaldata: any

        The data to send to the Agent/Service.

      • reqOptions: HTTPRequestOptions = ...

        The request options to use when querying the Agent/Service.

      Returns Promise<AxiosResponse<any, any, {}>>

      The result of query

      This method is used to query an existing AI Agent. It requires the user controlling the NVM API Key to have access to the agent.

      await payments.query.send(accessCredentials, 'POST', 'http://example.com/agent/prompt', {'input': 'Hello'})
      

      AxiosRequestConfig.method