Sycophant.EmbeddingWireProtocol behaviour (sycophant v0.4.2)

Copy Markdown

Behaviour for embedding wire protocol adapters.

Each adapter translates between Sycophant's canonical EmbeddingRequest and a provider-specific HTTP format.

Built-in Adapters

Summary

Callbacks

decode_response(body, headers)

@callback decode_response(body :: map(), headers :: [{String.t(), String.t()}]) ::
  {:ok, Sycophant.EmbeddingResponse.t()} | {:error, Splode.Error.t()}

encode_request(t)

@callback encode_request(Sycophant.EmbeddingRequest.t()) ::
  {:ok, map()} | {:error, Splode.Error.t()}

request_path(t)

@callback request_path(Sycophant.EmbeddingRequest.t()) :: String.t()