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

[BUG]: /v1/openai/embeddings is not compatible with openai spec / sdk #3312

@miraculixx

Description

@miraculixx

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

Currently

  • The /v1/openai/embeddings endpoint requires the "inputs" key, and it needs to be a list
  • this is not compatible with the OpenAI Embedding REST API Specs, which requires the "input" key
  • in consequence, the AnythingLLM embeddings REST API cannot be used with the openai sdk. Using the openai sdk, AnythingLLM returns HTTP 500

Expected

  • make the /v1/openai/embeddings endpoint compatible to OpenAI's

Are there known steps to reproduce?

  1. Download & install AnythingLLM Desktop
  2. Add an API Key
  3. Use the OpenAI Python SDK
client = OpenAI(api_key=api_key, base_url='http://localhost:3001/api/v1/openai')
embeddings = client.embeddings.create(
            model=None,
            input=[ "some text" ],
            encoding_format="float"
        ) 

Environment

  • OS: Linux
  • AnythingLLM Version: v1.7.4

Metadata

Metadata

Assignees

Labels

possible bugBug was reported but is not confirmed or is unable to be replicated.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions