-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from firstbatchxyz/gemini-models
gemini models
- Loading branch information
Showing
3 changed files
with
66 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package utils | ||
|
||
import "strings" | ||
|
||
// IsGeminiRequired checks if any of the picked models require Google Gemini by comparing them against a list of available Gemini models. | ||
// | ||
// Parameters: | ||
// - picked_models: A comma-separated string of model names selected by the user. | ||
// - gemini_models: A pointer to a slice of strings containing available Gemini model names. | ||
// | ||
// Returns: | ||
// - bool: Returns true if any of the picked models match Gemini models, indicating that Gemini is required, otherwise false. | ||
func IsGeminiRequired(picked_models string, gemini_models *[]string) bool { | ||
required := false | ||
for _, model := range strings.Split(picked_models, ",") { | ||
for _, gemini_model := range *gemini_models { | ||
if model == gemini_model { | ||
required = true | ||
break | ||
} | ||
} | ||
} | ||
return required | ||
} |