embeddings#

async PDDecodeServer.embeddings(request: EmbeddingRequest, raw_request_info: RawRequestInfo | None = None) AsyncGenerator[List[ErrorResponse] | EmbeddingResponse, None]#

Runs an embeddings request to the engine and returns the response.

Returns an AsyncGenerator over the EmbeddingResponse object. This is so that the caller can have a consistent interface across all the methods of chat, completions, embeddings and transcriptions.

Parameters:
  • request (EmbeddingRequest) – An EmbeddingRequest object.

  • raw_request_info (RawRequestInfo | None) – Optional RawRequestInfo containing data from the original HTTP request.

Returns:

An AsyncGenerator over the EmbeddingResponse object.

Return type:

AsyncGenerator[List[ErrorResponse] | EmbeddingResponse, None]