Skip to content

Commit

Permalink
Clean.
Browse files Browse the repository at this point in the history
  • Loading branch information
joseplayero committed Oct 18, 2024
1 parent c6691f3 commit 78756b6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/components/Settings/LLMSettings/DefaultLLMSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ interface DefaultLLMSelectorProps {
const DefaultLLMSelector: React.FC<DefaultLLMSelectorProps> = ({ llmConfigs, defaultLLM, setDefaultLLM }) => {
const [selectedLLM, setSelectedLLM] = useState(defaultLLM)

const availableOllamaModels = llmConfigs.filter(({ apiName }) => apiName === 'ollama')

useEffect(() => {
setSelectedLLM(defaultLLM)
}, [defaultLLM])
Expand Down Expand Up @@ -48,15 +46,15 @@ const DefaultLLMSelector: React.FC<DefaultLLMSelectorProps> = ({ llmConfigs, def
<SelectContent>
{llmConfigs.map((config) => {
const { modelName } = config
const isOllamaModel = availableOllamaModels.some(({ modelName: ollamaModel }) => ollamaModel === modelName)

return (
<div key={modelName} className="flex w-full items-center justify-between">
<SelectItem className="cursor-pointer" value={modelName}>
{modelName}
</SelectItem>
{isOllamaModel && (
<FiTrash2 className="ml-2 cursor-pointer text-red-500" onClick={() => handleDeleteLLM(modelName)} />
{config.apiName === 'Ollama' && (
<div className="cursor-pointer text-red-500">
<FiTrash2 onClick={() => handleDeleteLLM(modelName)} />
</div>
)}
</div>
)
Expand Down

0 comments on commit 78756b6

Please sign in to comment.