API7 Docs

AI RAG Configuration

Plugin Parameters

See plugin common configurations for configuration options available to all plugins.

  • embeddings_providerobject · required

    Embedding model provider configurations.

    • azure_openaiobject · required

      Azure OpenAI embedding model configurations.

      • endpointstring · required

        Azure OpenAI embedding model endpoint.

      • api_keystring · required

        Azure OpenAI API key. The value is encrypted with AES before being stored in etcd.

  • vector_search_providerobject · required

    Vector search provider configurations.

    • azure_ai_searchobject · required

      Configurations of Azure AI Search.

      • endpointstring · required

        Azure AI Search endpoint.

      • api_keystring · required

        Azure AI Search API key. The value is encrypted with AES before being stored in etcd.

  • ssl_verifyboolean · optional · default: true

    If true, verify TLS certificates when calling the embedding and vector search endpoints. Available in API7 Enterprise from version 3.9.10 and APISIX from version 3.17.0.

Request Body Parameters

The request body should follow the below configurations.

  • ai_ragobject · required

    Request body RAG specifications.

    • embeddingsobject · required

      Embedding specifications.

      The following parameters are available if you are working with Azure OpenAI.

      • inputstring · required

        Input prompt to the LLM, which will be used to compute embeddings and generate a RAG-enhanced response.

      • userstring · optional

        A unique identifier representing your end user, which helps in monitoring and detecting abuse.

      • encoding_formatstring · optional · default: float

        Valid values: float or base64

        Data type of the returned embeddings.

      • dimensionsinteger · optional

        Dimensions limit of the embedding model used to output the vectors. It should match the dimension of your embedding model. For instance, the dimensions for text-embedding-ada-002 are fixed at 1536. For text-embedding-3-small or text-embedding-3-large, dimensions range from 1 to 1536 and 3072, respectively.

    • vector_searchobject · required

      Vector search specifications.

      The following parameter is available if you are working with Azure AI Search.

      • fieldsstring · required

        Fields for the vector search.