mirror of
https://github.com/eyaltoledano/claude-task-master.git
synced 2026-01-30 06:12:05 +00:00
feat(models): add Gemini 3 Flash Preview and improve model search
- Add gemini-3-flash-preview to Google and Gemini CLI providers - Use name field from supported-models.json when available - Improve model search to match both display names and model IDs
This commit is contained in:
5
.changeset/floppy-books-feel.md
Normal file
5
.changeset/floppy-books-feel.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Improved model search in `task-master models --setup` to match both display names and model IDs
|
||||||
5
.changeset/frank-ears-remain.md
Normal file
5
.changeset/frank-ears-remain.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Added Gemini 3 Flash Preview model support for Google and Gemini CLI providers
|
||||||
@@ -158,9 +158,15 @@ export function createSearchSource(
|
|||||||
const filteredChoices = choices.filter((choice) => {
|
const filteredChoices = choices.filter((choice) => {
|
||||||
// Separators are always included
|
// Separators are always included
|
||||||
if (choice instanceof Separator) return true;
|
if (choice instanceof Separator) return true;
|
||||||
// Filter regular choices by search term
|
// Filter regular choices by search term (name and model ID)
|
||||||
const searchText = (choice as ModelChoice).name || '';
|
const mc = choice as ModelChoice;
|
||||||
return searchText.toLowerCase().includes(searchTerm.toLowerCase());
|
const displayText = mc.name || '';
|
||||||
|
const modelId =
|
||||||
|
typeof mc.value === 'object' && mc.value !== null && 'id' in mc.value
|
||||||
|
? mc.value.id
|
||||||
|
: '';
|
||||||
|
const searchText = `${displayText} ${modelId}`.toLowerCase();
|
||||||
|
return searchText.includes(searchTerm.toLowerCase());
|
||||||
});
|
});
|
||||||
// Map ModelChoice to the format inquirer expects
|
// Map ModelChoice to the format inquirer expects
|
||||||
return Promise.resolve(
|
return Promise.resolve(
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export interface ModelCost {
|
|||||||
|
|
||||||
export interface ModelData {
|
export interface ModelData {
|
||||||
id: string;
|
id: string;
|
||||||
|
name?: string;
|
||||||
provider?: string;
|
provider?: string;
|
||||||
swe_score?: number | null;
|
swe_score?: number | null;
|
||||||
cost_per_1m_tokens?: ModelCost | null;
|
cost_per_1m_tokens?: ModelCost | null;
|
||||||
|
|||||||
@@ -1044,16 +1044,19 @@ function getAvailableModels() {
|
|||||||
models
|
models
|
||||||
.filter((modelObj) => Boolean(modelObj.supported))
|
.filter((modelObj) => Boolean(modelObj.supported))
|
||||||
.forEach((modelObj) => {
|
.forEach((modelObj) => {
|
||||||
// Basic name generation - can be improved
|
|
||||||
const modelId = modelObj.id;
|
const modelId = modelObj.id;
|
||||||
const sweScore = modelObj.swe_score;
|
const sweScore = modelObj.swe_score;
|
||||||
const cost = modelObj.cost_per_1m_tokens;
|
const cost = modelObj.cost_per_1m_tokens;
|
||||||
const allowedRoles = modelObj.allowed_roles || ['main', 'fallback'];
|
const allowedRoles = modelObj.allowed_roles || ['main', 'fallback'];
|
||||||
|
|
||||||
|
// Use name from JSON if available, otherwise generate from ID
|
||||||
|
let name = modelObj.name;
|
||||||
|
if (!name) {
|
||||||
const nameParts = modelId
|
const nameParts = modelId
|
||||||
.split('-')
|
.split('-')
|
||||||
.map((p) => p.charAt(0).toUpperCase() + p.slice(1));
|
.map((p) => p.charAt(0).toUpperCase() + p.slice(1));
|
||||||
|
name = nameParts.join(' ');
|
||||||
// Handle specific known names better if needed
|
// Handle specific known names better if needed
|
||||||
let name = nameParts.join(' ');
|
|
||||||
if (modelId === 'claude-3.5-sonnet-20240620')
|
if (modelId === 'claude-3.5-sonnet-20240620')
|
||||||
name = 'Claude 3.5 Sonnet';
|
name = 'Claude 3.5 Sonnet';
|
||||||
if (modelId === 'claude-3-7-sonnet-20250219')
|
if (modelId === 'claude-3-7-sonnet-20250219')
|
||||||
@@ -1062,6 +1065,7 @@ function getAvailableModels() {
|
|||||||
if (modelId === 'gpt-4-turbo') name = 'GPT-4 Turbo';
|
if (modelId === 'gpt-4-turbo') name = 'GPT-4 Turbo';
|
||||||
if (modelId === 'sonar-pro') name = 'Perplexity Sonar Pro';
|
if (modelId === 'sonar-pro') name = 'Perplexity Sonar Pro';
|
||||||
if (modelId === 'sonar-mini') name = 'Perplexity Sonar Mini';
|
if (modelId === 'sonar-mini') name = 'Perplexity Sonar Mini';
|
||||||
|
}
|
||||||
|
|
||||||
available.push({
|
available.push({
|
||||||
id: modelId,
|
id: modelId,
|
||||||
|
|||||||
@@ -202,6 +202,18 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"gemini-cli": [
|
"gemini-cli": [
|
||||||
|
{
|
||||||
|
"id": "gemini-3-flash-preview",
|
||||||
|
"name": "Gemini 3 Flash",
|
||||||
|
"swe_score": 0,
|
||||||
|
"cost_per_1m_tokens": {
|
||||||
|
"input": 0,
|
||||||
|
"output": 0
|
||||||
|
},
|
||||||
|
"allowed_roles": ["main", "fallback", "research"],
|
||||||
|
"max_tokens": 1048576,
|
||||||
|
"supported": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "gemini-3-pro-preview",
|
"id": "gemini-3-pro-preview",
|
||||||
"swe_score": 0.762,
|
"swe_score": 0.762,
|
||||||
@@ -482,6 +494,18 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"google": [
|
"google": [
|
||||||
|
{
|
||||||
|
"id": "gemini-3-flash-preview",
|
||||||
|
"name": "Gemini 3 Flash",
|
||||||
|
"swe_score": 0,
|
||||||
|
"cost_per_1m_tokens": {
|
||||||
|
"input": 0.5,
|
||||||
|
"output": 3.0
|
||||||
|
},
|
||||||
|
"allowed_roles": ["main", "fallback"],
|
||||||
|
"max_tokens": 1048576,
|
||||||
|
"supported": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "gemini-3-pro-preview",
|
"id": "gemini-3-pro-preview",
|
||||||
"swe_score": 0.762,
|
"swe_score": 0.762,
|
||||||
|
|||||||
Reference in New Issue
Block a user