这是indexloc提供的服务,不要输入任何密码
Skip to content

[DOCS]: /v1/openai/embeddings has incorrect example body #2801

@scottybo

Description

@scottybo

Description

In the Swagger docs for the /v1/openai/embeddings it gives an example value for the input as:

{
  "input": [
    "This is my first string to embed",
    "This is my second string to embed"
  ],
  "model": null
}

However, the input should be plural inputs otherwise an error gets thrown. I.e.

{
  "inputs": [
    "This is my first string to embed",
    "This is my second string to embed"
  ],
  "model": "text-embedding-3-small"
}

In addition, it should be made clear that in order for this endpoint to work with the correct embedding engine (rather than the default NativeEmbedder), the environment variable EMBEDDING_ENGINE should be set (e.g. to openai) otherwise a 500 error gets thrown.

It would also be useful to give an example of the model, e.g. text-embedding-3-small.

Just for reference if anyone else comes across this issue, the options for the EMBEDDING_ENGINE are

  • openai
  • azure
  • localai
  • ollama
  • native
  • lmstudio
  • cohere
  • voyageai
  • litellm
  • mistral
  • generic-openai

And they can be seen in function getEmbeddingEngineSelection in server/utils/helpers/index.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions