Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClassificationModel ¶
type ClassificationModel struct {
// contains filtered or unexported fields
}
A model that returns classification results for a list of text strings.
NOTE: This model interface is experimental and may change in the future. It is primarily intended for use with with classification models hosted on Hypermode.
func (*ClassificationModel) CreateInput ¶
func (m *ClassificationModel) CreateInput(content ...string) (*ClassificationModelInput, error)
Creates an input object for the classification model.
The content parameter is a list of one or more text strings to classify.
type ClassificationModelInput ¶
type ClassificationModelInput struct {
// A list of one or more text strings to classify.
Instances []string `json:"instances"`
}
The input object for the classification model.
type ClassificationModelOutput ¶
type ClassificationModelOutput struct {
// A list of prediction results that correspond to each input text string.
Predictions []ClassifierResult `json:"predictions"`
}
The output object for the classification model.
type ClassifierLabel ¶
type ClassifierLabel struct {
// The classification label.
Label string `json:"label"`
// The probability value.
Probability float32 `json:"probability"`
}
A classification label with its corresponding probability.
type ClassifierResult ¶
type ClassifierResult struct {
// The classification label with the highest confidence.
Label string `json:"label"`
// The confidence score for the classification label.
Confidence float32 `json:"confidence"`
// The list of all classification labels with their corresponding probabilities.
Probabilities []ClassifierLabel `json:"probabilities"`
}
A classification result for a single text string.
type EmbeddingsModel ¶
type EmbeddingsModel struct {
// contains filtered or unexported fields
}
A model that returns embeddings for a list of text strings.
NOTE: This model interface is experimental and may change in the future. It is primarily intended for use with with embedding models hosted on Hypermode.
func (*EmbeddingsModel) CreateInput ¶
func (m *EmbeddingsModel) CreateInput(content ...string) (*EmbeddingsModelInput, error)
Creates an input object for the embeddings model.
The content parameter is a list of one or more text strings to create vector embeddings for.
type EmbeddingsModelInput ¶
type EmbeddingsModelInput struct {
// A list of one or more text strings to create vector embeddings for.
Instances []string `json:"instances"`
}
The input object for the embeddings model.
type EmbeddingsModelOutput ¶
type EmbeddingsModelOutput struct {
// A list of vector embeddings that correspond to each input text string.
Predictions [][]float32 `json:"predictions"`
}
The output object for the embeddings model.