HuggingFaceEndpoint
Wisej.AI.Endpoints.HuggingFaceEndpoint
Last updated
Wisej.AI.Endpoints.HuggingFaceEndpoint
Last updated
Namespace: Wisej.AI.Endpoints
Assembly: Wisej.AI (3.5.0.0)
Represents a connection to HuggingFace serverless endpoints for model inference and embeddings.
This class is used to interact with HuggingFace's API for model inference and embeddings. It provides methods to construct API URLs, add options and messages to requests, and read responses.
Initializes a new instance of the class with default settings.
Builds the payload for an embeddings request.
inputs
The input strings for which embeddings are requested.
This method constructs the payload for an embeddings request, including options such as wait_for_model.
Constructs the API URL for model inference.
Constructs the API URL for embeddings.
Reads the embeddings from the API response.
response
The API response containing the embeddings.
This method parses the response to extract the embeddings data.
: Gets or sets the model used for generating embeddings. (Default: "sentence-transformers/all-MiniLM-L6-v2"
)
: Gets or sets the maximum number of output tokens. (Default: 2048
)
: Gets or sets the model used for inference. (Default: "meta-llama/Llama-3.2-11B-Vision-Instruct"
)
: Gets or sets the base URL for the HuggingFace API. (Default: "https://api-inference.huggingface.co"
)
Returns: . The constructed payload object.
Returns: . The constructed API URL.
Returns: . The constructed embeddings URL.
Returns: . A two-dimensional array of floats representing the embeddings.