Skip to content

Commit

Permalink
Fix method name style check
Browse files Browse the repository at this point in the history
  • Loading branch information
santoshkal committed Jan 28, 2025
1 parent f674d27 commit 8d32a0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion finalDeployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
app: test
spec:
containers:
- image: nginx:1.21.6
- image: nginx:1.25.2
name: nginx
resources: {}
status: {}
13 changes: 7 additions & 6 deletions llm/llmbackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/intelops/genval/pkg/validate"
)

func generateOpenAIOptions(r *RequirementSpec) ([]openai.Option, error) {
func (r *RequirementSpec) generateOpenAIOptions() ([]openai.Option, error) {
var opts []openai.Option

for _, openAIConfig := range r.LLMSpec.OpenAIConfig {
Expand All @@ -33,7 +33,7 @@ func generateOpenAIOptions(r *RequirementSpec) ([]openai.Option, error) {

// NewOpenAIClient creates an OpenAI client.
func (r *RequirementSpec) NewOpenAIClient() (*openai.LLM, error) {
options, err := generateOpenAIOptions(r)
options, err := r.generateOpenAIOptions()
if err != nil {
return nil, err
}
Expand All @@ -45,11 +45,11 @@ func (r *RequirementSpec) NewOpenAIClient() (*openai.LLM, error) {
}

// createCallOptions creates CallOptions with LLM parameters.
func createCallOptions(c *OpenAIModel) (llms.CallOption, error) {
func createCallOptions(r *OpenAIModel) (llms.CallOption, error) {
options := []llms.CallOption{
llms.WithMaxTokens(c.MaxTokens),
llms.WithTemperature(c.Temperature),
llms.WithModel(c.Model),
llms.WithMaxTokens(r.MaxTokens),
llms.WithTemperature(r.Temperature),
llms.WithModel(r.Model),
}
return combineCallOptions(options), nil
}
Expand Down Expand Up @@ -115,6 +115,7 @@ func DefaultOllamaEndpoint() OllamaEndpoint {
}

// GenerateOllamaResponse generates a response using Ollama.
// nolint:stylecheck // Disabling ST1016 for receiver name consistency
func (r *RequirementSpec) GenerateOllamaResponse(ctx context.Context, systemPrompt, userPrompt string) (string, error) {
var ollamaConfig *OllamaModel
for _, config := range r.LLMSpec.OllamaSpec {
Expand Down

0 comments on commit 8d32a0c

Please sign in to comment.