Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func NewGeminiPRSummarizer(ctx context.Context, cfg *config.Config, trans *i18n.
func (gps *GeminiPRSummarizer) GeneratePRSummary(ctx context.Context, prContent string) (models.PRSummary, error) {
modelName := string(gps.config.AIConfig.Models[config.AIGemini])

// Envolver el contenido del PR en el template con instrucciones de formato JSON
prompt := gps.generatePRPrompt(prContent)

genConfig := &genai.GenerateContentConfig{
Expand Down Expand Up @@ -85,7 +84,6 @@ func (gps *GeminiPRSummarizer) GeneratePRSummary(ctx context.Context, prContent
return models.PRSummary{}, fmt.Errorf("error al parsear JSON de PR: %w", err)
}

// Validar que el título no esté vacío
if strings.TrimSpace(jsonSummary.Title) == "" {
respLen := len(responseText)
preview := responseText
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ import (
"google.golang.org/genai"
)

const (
prResponseJSON = `{
"title": "Fix image loading error in gallery component",
"body": "- Fixed memory leak in image loading process\n- Optimized cache usage to improve performance\n- Added error handling for network failures",
"labels": ["fix", "performance"]
}`
)

func TestGeminiPRSummarizer(t *testing.T) {
t.Run("NewGeminiPRSummarizer with empty API key", func(t *testing.T) {
// Arrange
Expand Down Expand Up @@ -64,7 +56,6 @@ func TestGeminiPRSummarizer(t *testing.T) {
assert.Error(t, err, "Debería retornar un error con prompt vacío")
})


t.Run("generatePRPrompt should format correctly", func(t *testing.T) {
// Arrange
ctx := context.Background()
Expand Down
Loading