From 5b15527672e324d5c4e55ff4f3d891fb4774a89b Mon Sep 17 00:00:00 2001 From: ayush Date: Sat, 23 Nov 2024 16:25:29 +0000 Subject: [PATCH] done linting --- embeddings.go | 18 +++++++++--------- test.mp3 | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 test.mp3 diff --git a/embeddings.go b/embeddings.go index 127e910bd..f04f1a286 100644 --- a/embeddings.go +++ b/embeddings.go @@ -159,10 +159,10 @@ type EmbeddingRequest struct { EncodingFormat EmbeddingEncodingFormat `json:"encoding_format,omitempty"` // Dimensions The number of dimensions the resulting output embeddings should have. // Only supported in text-embedding-3 and later models. - Dimensions int `json:"dimensions,omitempty"` + Dimensions int `json:"dimensions,omitempty"` // The ExtraBody field allows for the inclusion of arbitrary key-value pairs // in the request body that may not be explicitly defined in this struct. - ExtraBody map[string]any `json:"extra_body,omitempty"` + ExtraBody map[string]any `json:"extra_body,omitempty"` } func (r EmbeddingRequest) Convert() EmbeddingRequest { @@ -189,10 +189,10 @@ type EmbeddingRequestStrings struct { EncodingFormat EmbeddingEncodingFormat `json:"encoding_format,omitempty"` // Dimensions The number of dimensions the resulting output embeddings should have. // Only supported in text-embedding-3 and later models. - Dimensions int `json:"dimensions,omitempty"` + Dimensions int `json:"dimensions,omitempty"` // The ExtraBody field allows for the inclusion of arbitrary key-value pairs // in the request body that may not be explicitly defined in this struct. - ExtraBody map[string]any `json:"extra_body,omitempty"` + ExtraBody map[string]any `json:"extra_body,omitempty"` } func (r EmbeddingRequestStrings) Convert() EmbeddingRequest { @@ -225,10 +225,10 @@ type EmbeddingRequestTokens struct { EncodingFormat EmbeddingEncodingFormat `json:"encoding_format,omitempty"` // Dimensions The number of dimensions the resulting output embeddings should have. // Only supported in text-embedding-3 and later models. - Dimensions int `json:"dimensions,omitempty"` + Dimensions int `json:"dimensions,omitempty"` // The ExtraBody field allows for the inclusion of arbitrary key-value pairs // in the request body that may not be explicitly defined in this struct. - ExtraBody map[string]any `json:"extra_body,omitempty"` + ExtraBody map[string]any `json:"extra_body,omitempty"` } func (r EmbeddingRequestTokens) Convert() EmbeddingRequest { @@ -254,8 +254,8 @@ func (c *Client) CreateEmbeddings( baseReq := conv.Convert() // Prepare the body with only the provided fields. - // The body map is used to dynamically construct the request payload for the embedding API. - // Instead of relying on a fixed struct, the body map allows for flexible inclusion of fields + // The body map is used to dynamically construct the request payload for the embedding API. + // Instead of relying on a fixed struct, the body map allows for flexible inclusion of fields // based on their presence, avoiding unnecessary or empty fields in the request. body := make(map[string]any) body["input"] = baseReq.Input @@ -273,7 +273,7 @@ func (c *Client) CreateEmbeddings( ctx, http.MethodPost, c.fullURL("/embeddings", withModel(string(baseReq.Model))), - withBody(body), // Main request body. + withBody(body), // Main request body. withExtraBody(baseReq.ExtraBody), // Merge ExtraBody fields. ) if err != nil { diff --git a/test.mp3 b/test.mp3 new file mode 100644 index 000000000..b6fc4c620 --- /dev/null +++ b/test.mp3 @@ -0,0 +1 @@ +hello \ No newline at end of file