Initial Draft

This commit is contained in:
Roy Han
2024-06-25 13:29:47 -07:00
parent 0f87628b6d
commit ff191d7cba
5 changed files with 71 additions and 41 deletions

View File

@@ -210,7 +210,10 @@ type EmbeddingRequest struct {
Model string `json:"model"`
// Prompt is the textual prompt to embed.
Prompt string `json:"prompt"`
Prompt string `json:"prompt,omitempty"`
// PromptBatch is a list of prompts to embed.
PromptBatch []string `json:"prompt_batch,omitempty"`
// KeepAlive controls how long the model will stay loaded in memory following
// this request.
@@ -222,7 +225,8 @@ type EmbeddingRequest struct {
// EmbeddingResponse is the response from [Client.Embeddings].
type EmbeddingResponse struct {
Embedding []float64 `json:"embedding"`
Embedding []float64 `json:"embedding,omitempty"`
EmbeddingBatch [][]float64 `json:"embedding_batch,omitempty"`
}
// CreateRequest is the request passed to [Client.Create].