add dummy models

This commit is contained in:
Andrew Pareles 2024-12-11 21:30:13 -08:00
parent 9e583960ae
commit d809839530
3 changed files with 18 additions and 12 deletions

View file

@ -106,7 +106,7 @@ class VoidConfigStateService extends Disposable implements IVoidConfigStateServi
}
}
}
console.log('NEW STATE I', newState)
// console.log('NEW STATE I', JSON.stringify(newState, null, 2))
await this._storeVoidConfigState(newState)
this._setState(newState)
@ -120,7 +120,7 @@ class VoidConfigStateService extends Disposable implements IVoidConfigStateServi
[featureName]: newVal
}
}
console.log('NEW STATE II', newState)
// console.log('NEW STATE II', JSON.stringify(newState, null, 2))
await this._storeVoidConfigState(newState)
this._setState(newState)

View file

@ -45,6 +45,16 @@ export const voidProviderDefaults = {
} as const
export const dummyModelData = {
anthropic: ['claude 3.5'],
openAI: ['gpt 4o'],
ollama: ['llama 3.2'],
openRouter: ['qwen 2.5'],
}
export const voidInitModelOptions = {
anthropic: () => ({
// model: 'claude-3-5-sonnet-20240620',

View file

@ -4,15 +4,12 @@
*--------------------------------------------------------------------------------------------*/
import { useCallback, useEffect, useRef } from 'react'
import { FeatureName, featureNames, ProviderName, providerNames } from '../../../../../../../platform/void/common/voidConfigTypes.js'
import { dummyModelData, FeatureName, featureNames, ProviderName, providerNames } from '../../../../../../../platform/void/common/voidConfigTypes.js'
import { useConfigState, useService } from '../util/services.js'
import ErrorBoundary from './ErrorBoundary.js'
import { VoidSelectBox } from './inputs.js'
import { SelectBox } from '../../../../../../../base/browser/ui/selectBox/selectBox.js'
export const ModelSelectionOfFeature = ({ featureName }: { featureName: FeatureName }) => {
const voidConfigService = useService('configStateService')
@ -31,12 +28,11 @@ export const ModelSelectionOfFeature = ({ featureName }: { featureName: FeatureN
const isDummy = modelOptions.length === 0
if (isDummy) {
modelOptions.push(
{ text: 'claude 3.5 (anthropic)', value: ['dummy', 'dummy'] as [string, string] },
{ text: 'gpt 4o (openai)', value: ['dummy', 'dummy'] as [string, string] },
{ text: 'llama 3.2 (ollama)', value: ['dummy', 'dummy'] as [string, string] },
{ text: 'qwen 2.5 (openrouter)', value: ['dummy', 'dummy'] as [string, string] },
)
for (const [providerName, models] of Object.entries(dummyModelData)) {
for (let model of models) {
modelOptions.push({ text: `${model} (${providerName})`, value: ['dummy', 'dummy'] })
}
}
}
return <>