Chore: linter complaints
This commit is contained in:
@@ -154,17 +154,19 @@ func (m RoleMsg) ToText(i int) string {
|
|||||||
contentStr = m.Content
|
contentStr = m.Content
|
||||||
} else {
|
} else {
|
||||||
// For structured content, just take the text parts
|
// For structured content, just take the text parts
|
||||||
|
var textParts []string
|
||||||
for _, part := range m.ContentParts {
|
for _, part := range m.ContentParts {
|
||||||
if partMap, ok := part.(map[string]interface{}); ok {
|
if partMap, ok := part.(map[string]interface{}); ok {
|
||||||
if partType, exists := partMap["type"]; exists && partType == "text" {
|
if partType, exists := partMap["type"]; exists && partType == "text" {
|
||||||
if textVal, textExists := partMap["text"]; textExists {
|
if textVal, textExists := partMap["text"]; textExists {
|
||||||
if textStr, isStr := textVal.(string); isStr {
|
if textStr, isStr := textVal.(string); isStr {
|
||||||
contentStr += textStr + " "
|
textParts = append(textParts, textStr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
contentStr = strings.Join(textParts, " ") + " "
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if already has role annotation (/completion makes them)
|
// check if already has role annotation (/completion makes them)
|
||||||
@@ -181,17 +183,19 @@ func (m RoleMsg) ToPrompt() string {
|
|||||||
contentStr = m.Content
|
contentStr = m.Content
|
||||||
} else {
|
} else {
|
||||||
// For structured content, just take the text parts
|
// For structured content, just take the text parts
|
||||||
|
var textParts []string
|
||||||
for _, part := range m.ContentParts {
|
for _, part := range m.ContentParts {
|
||||||
if partMap, ok := part.(map[string]interface{}); ok {
|
if partMap, ok := part.(map[string]interface{}); ok {
|
||||||
if partType, exists := partMap["type"]; exists && partType == "text" {
|
if partType, exists := partMap["type"]; exists && partType == "text" {
|
||||||
if textVal, textExists := partMap["text"]; textExists {
|
if textVal, textExists := partMap["text"]; textExists {
|
||||||
if textStr, isStr := textVal.(string); isStr {
|
if textStr, isStr := textVal.(string); isStr {
|
||||||
contentStr += textStr + " "
|
textParts = append(textParts, textStr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
contentStr = strings.Join(textParts, " ") + " "
|
||||||
}
|
}
|
||||||
return strings.ReplaceAll(fmt.Sprintf("%s:\n%s", m.Role, contentStr), "\n\n", "\n")
|
return strings.ReplaceAll(fmt.Sprintf("%s:\n%s", m.Role, contentStr), "\n\n", "\n")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -561,7 +561,7 @@ func makeFilePicker() *tview.Flex {
|
|||||||
var selectedFile string
|
var selectedFile string
|
||||||
|
|
||||||
// Track currently displayed directory (changes as user navigates)
|
// Track currently displayed directory (changes as user navigates)
|
||||||
var currentDisplayDir string = startDir
|
currentDisplayDir := startDir
|
||||||
|
|
||||||
// Helper function to check if a file is an image
|
// Helper function to check if a file is an image
|
||||||
isImageFile := func(filename string) bool {
|
isImageFile := func(filename string) bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user