From 6f10d99be58efde6958822203903503d50c51673 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 3 Jan 2024 20:12:02 -0700 Subject: [PATCH] #58: lint --- pkg/providers/octoml/chat.go | 22 +++++++++++----------- pkg/providers/octoml/config.go | 12 ++++++------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pkg/providers/octoml/chat.go b/pkg/providers/octoml/chat.go index 70c61e26..5dedf596 100644 --- a/pkg/providers/octoml/chat.go +++ b/pkg/providers/octoml/chat.go @@ -21,15 +21,15 @@ type ChatMessage struct { // ChatRequest is an octoml-specific request schema type ChatRequest struct { - Model string `json:"model"` - Messages []ChatMessage `json:"messages"` - Temperature float64 `json:"temperature,omitempty"` - TopP float64 `json:"top_p,omitempty"` - MaxTokens int `json:"max_tokens,omitempty"` - StopWords []string `json:"stop,omitempty"` - Stream bool `json:"stream,omitempty"` - FrequencyPenalty int `json:"frequency_penalty,omitempty"` - PresencePenalty int `json:"presence_penalty,omitempty"` + Model string `json:"model"` + Messages []ChatMessage `json:"messages"` + Temperature float64 `json:"temperature,omitempty"` + TopP float64 `json:"top_p,omitempty"` + MaxTokens int `json:"max_tokens,omitempty"` + StopWords []string `json:"stop,omitempty"` + Stream bool `json:"stream,omitempty"` + FrequencyPenalty int `json:"frequency_penalty,omitempty"` + PresencePenalty int `json:"presence_penalty,omitempty"` } // NewChatRequestFromConfig fills the struct from the config. Not using reflection because of performance penalty it gives @@ -174,9 +174,9 @@ func (c *Client) doChatRequest(ctx context.Context, payload *ChatRequest) (*sche response = schemas.UnifiedChatResponse{ ID: responseJSON["id"].(string), - Created: responseJSON["created"].(float64), + Created: responseJSON["created"].(float64), Provider: "octoml", - Router: "chat", //TODO: Update this with actual router + Router: "chat", // TODO: Update this with actual router Model: responseJSON["model"].(string), Cached: false, ProviderResponse: responsePayload, diff --git a/pkg/providers/octoml/config.go b/pkg/providers/octoml/config.go index f1c6dada..ed79fce5 100644 --- a/pkg/providers/octoml/config.go +++ b/pkg/providers/octoml/config.go @@ -7,12 +7,12 @@ import ( // Params defines OctoML-specific model params with the specific validation of values // TODO: Add validations type Params struct { - Temperature float64 `yaml:"temperature,omitempty" json:"temperature"` - TopP float64 `yaml:"top_p,omitempty" json:"top_p"` - MaxTokens int `yaml:"max_tokens,omitempty" json:"max_tokens"` - StopWords []string `yaml:"stop,omitempty" json:"stop"` - FrequencyPenalty int `yaml:"frequency_penalty,omitempty" json:"frequency_penalty"` - PresencePenalty int `yaml:"presence_penalty,omitempty" json:"presence_penalty"` + Temperature float64 `yaml:"temperature,omitempty" json:"temperature"` + TopP float64 `yaml:"top_p,omitempty" json:"top_p"` + MaxTokens int `yaml:"max_tokens,omitempty" json:"max_tokens"` + StopWords []string `yaml:"stop,omitempty" json:"stop"` + FrequencyPenalty int `yaml:"frequency_penalty,omitempty" json:"frequency_penalty"` + PresencePenalty int `yaml:"presence_penalty,omitempty" json:"presence_penalty"` // Stream bool `json:"stream,omitempty"` // TODO: we are not supporting this at the moment }