Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmd/test/final_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down Expand Up @@ -54,3 +56,4 @@ func main_final_test() {

fmt.Println("Comment posted successfully! Check GitLab to verify it's attached to the correct line.")
}

3 changes: 3 additions & 0 deletions cmd/test/test_line_comment.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down Expand Up @@ -55,3 +57,4 @@ func main_test_line_comment() {

fmt.Println("Comment posted successfully! Check GitLab to verify it's attached to the correct line.")
}

3 changes: 3 additions & 0 deletions cmd/test/verify_line_comment.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down Expand Up @@ -54,3 +56,4 @@ func main_verify_line_comment() {

fmt.Println("Comment posted successfully! Check GitLab to verify it's attached to the correct line.")
}

3 changes: 3 additions & 0 deletions debug/debug_json_repair.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down Expand Up @@ -32,3 +34,4 @@ func main() {
valid := json.Valid([]byte(repaired))
fmt.Printf("Parse valid: %v\n", valid)
}

3 changes: 3 additions & 0 deletions debug/debug_langchain.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down Expand Up @@ -191,3 +193,4 @@ func testChat(ctx context.Context, llm llms.Model) {
fmt.Printf("Total chunks received: %d\n", chunkCount)
fmt.Printf("Full response: %s\n", fullResponse)
}

3 changes: 3 additions & 0 deletions debug/debug_livereview_replica.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down Expand Up @@ -150,3 +152,4 @@ func main() {
fmt.Printf("ERROR: %v\n", err)
}
}

3 changes: 3 additions & 0 deletions debug/debug_raw_http.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down Expand Up @@ -102,3 +104,4 @@ func min(a, b int) int {
}
return b
}

3 changes: 3 additions & 0 deletions debug/test_ollama.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down Expand Up @@ -124,3 +126,4 @@ func testChat(ctx context.Context, llm llms.Model) {
fmt.Printf("Total chunks received: %d\n", chunkCount)
fmt.Printf("Full response: %s\n", fullResponse)
}

15 changes: 4 additions & 11 deletions internal/aiconnectors/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func trimTrailingSlash(s string) string {

// Helper functions to create models for specific providers

func createOpenAIModel(ctx context.Context, options ConnectorOptions) (llms.Model, error) {
func createOpenAIModel(_ context.Context, options ConnectorOptions) (llms.Model, error) {
// The OpenAI library doesn't have all the options we want to set directly as constructor options
// We'll just use the basic options available
opts := []openai.Option{
Expand All @@ -316,7 +316,7 @@ func createOpenAIModel(ctx context.Context, options ConnectorOptions) (llms.Mode
return openai.New(opts...)
}

func createDeepSeekModel(ctx context.Context, options ConnectorOptions) (llms.Model, error) {
func createDeepSeekModel(_ context.Context, options ConnectorOptions) (llms.Model, error) {
baseURL := ResolveBaseURL(ProviderDeepSeek, options.BaseURL)

opts := []openai.Option{
Expand Down Expand Up @@ -429,7 +429,7 @@ func createCohereModel(ctx context.Context, options ConnectorOptions) (llms.Mode
return cohere.New(opts...)
}

func createOllamaModel(ctx context.Context, options ConnectorOptions) (llms.Model, error) {
func createOllamaModel(_ context.Context, options ConnectorOptions) (llms.Model, error) {
// Set default server URL if not provided
if options.BaseURL == "" {
options.BaseURL = "http://localhost:11434"
Expand All @@ -446,7 +446,7 @@ func createOllamaModel(ctx context.Context, options ConnectorOptions) (llms.Mode
return ollama.New(opts...)
}

func createOpenRouterModel(ctx context.Context, options ConnectorOptions) (llms.Model, error) {
func createOpenRouterModel(_ context.Context, options ConnectorOptions) (llms.Model, error) {
baseURL := ResolveBaseURL(ProviderOpenRouter, options.BaseURL)

httpClient := networkaiconnectors.NewHTTPClient(5 * time.Minute)
Expand Down Expand Up @@ -619,13 +619,6 @@ func (c *Connector) GetModel() string {
return c.options.ModelConfig.Model
}

// Helper function to get minimum of two integers
func min(a, b int) int {
if a < b {
return a
}
return b
}

// truncateString limits string length for safe logging.
func truncateString(s string, maxLen int) string {
Expand Down
3 changes: 3 additions & 0 deletions scripts/create_live_plans.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down Expand Up @@ -59,3 +61,4 @@ func main() {
fmt.Printf("TeamMonthlyPlanID = \"%s\"\n", monthlyLive.ID)
fmt.Printf("TeamYearlyPlanID = \"%s\"\n", yearlyLive.ID)
}

3 changes: 3 additions & 0 deletions scripts/create_test_plans.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down Expand Up @@ -28,3 +30,4 @@ func main() {
fmt.Printf(" TeamMonthlyPlanIDTest = \"%s\"\n", monthlyPlan.ID)
fmt.Printf(" TeamYearlyPlanIDTest = \"%s\"\n", yearlyPlan.ID)
}

3 changes: 3 additions & 0 deletions tests/examples/final_line_comment.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down Expand Up @@ -54,3 +56,4 @@ func main() {

fmt.Println("Comment posted successfully! Check GitLab to verify it's attached to the correct line.")
}

3 changes: 3 additions & 0 deletions tests/examples/fix_gitlab_comments.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down Expand Up @@ -49,3 +51,4 @@ func main() {
fmt.Println("\nAfter running the tests, implement the specific fix in http_client.go")
fmt.Println("based on which approach was most successful in posting line comments.")
}

2 changes: 1 addition & 1 deletion tests/gitlab_comment_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package livereview
package livereview_test

import (
"context"
Expand Down
3 changes: 3 additions & 0 deletions tests/test_gitlab_note_webhook.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down Expand Up @@ -315,3 +317,4 @@ func sendTestWebhook(payload TestGitLabNotePayload, testName string) {
fmt.Printf(" Response: %s\n", responseBody.String())
}
}

3 changes: 3 additions & 0 deletions tests/verify_line_comment.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ignore

package main

import (
Expand Down Expand Up @@ -101,3 +103,4 @@ func main() {

fmt.Println("Comment posted successfully! Check GitLab to verify it's attached to the correct line.")
}

11 changes: 11 additions & 0 deletions ui/src/pages/AIProviders/AIProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ const popularAIProviders: AIProvider[] = [
apiKeyPlaceholder: 'sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
baseURLPlaceholder: 'https://openrouter.ai/api/v1'
},
{
id: 'cerebras',
name: 'Cerebras',
url: 'https://cerebras.ai/',
description: 'Lightning fast AI inference with Llama models.',
icon: <Icons.AI />,
apiKeyPlaceholder: 'csk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
models: ['llama3.1-8b', 'llama3.3-70b'],
defaultModel: 'llama3.1-8b',
baseURLPlaceholder: 'https://api.cerebras.ai/v1'
},
{
id: 'ollama',
name: 'Ollama',
Expand Down