Skip to content

Commit

Permalink
#58: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger12 committed Jan 4, 2024
1 parent c167d1f commit 6f10d99
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
22 changes: 11 additions & 11 deletions pkg/providers/octoml/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions pkg/providers/octoml/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 6f10d99

Please sign in to comment.