Embeddings and reranking

Text embeddings

Up to 64 texts a request (GET: one or more text parameters; POST: JSON {"texts": [...], "type": ...}). Each comes back as 384 numbers scaled to length 1, so a dot product is the cosine similarity. Embed questions with type=query and the documents searched with type=passage, as the model was trained. Each text is read up to 512 tokens.

post/v1/embed

Request

  • Base URL: https://api.dharun.dev
  • URL: https://api.dharun.dev/v1/embed
  • Auth: none declared

Query parameters

type'query' | 'passage'

query (default) for questions, passage for the documents searched.

Request body

textstring required

JSON: {"texts": ["..."], "type": "query" or "passage"}, or {"text": "..."}.

type'query' | 'passage'

query (default) for questions, passage for the documents searched.

Response

Success

dataunknown required

Changes

No recorded changes to this operation across all 1 revision of this API.