-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
different default engine/model for commands
- Loading branch information
Showing
10 changed files
with
156 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
dialog.editor header, dialog.editor main, dialog.editor footer { | ||
background-color: white; | ||
border: none; | ||
} | ||
|
||
dialog.editor header { | ||
font-size: 10pt; | ||
} | ||
|
||
dialog.editor main { | ||
padding-top: 0px; | ||
padding-bottom: 0px; | ||
} | ||
|
||
dialog.editor footer { | ||
justify-content: flex-start; | ||
flex-direction: row-reverse; | ||
} | ||
|
||
dialog.editor footer button { | ||
margin: 0px 4px; | ||
font-size: 9.5pt; | ||
} | ||
|
||
dialog.editor form .group label, | ||
dialog.editor form .group input, | ||
dialog.editor form .group textarea, | ||
dialog.editor form .group select { | ||
font-size: 9.5pt; | ||
} | ||
|
||
dialog.editor form .group label { | ||
min-width: 100px; | ||
} | ||
|
||
dialog.editor textarea { | ||
height: 120px; | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,76 @@ | ||
<template> | ||
<dialog class="editor"> | ||
<form method="dialog"> | ||
<header> | ||
<div class="title">Commands defaults</div> | ||
</header> | ||
<main> | ||
<div class="group"> | ||
<label>LLM Provider</label> | ||
<select v-model="engine" @change="onChangeEngine"> | ||
<option value="">Use global default</option> | ||
<option value="openai">OpenAI</option> | ||
<option value="ollama">Ollama</option> | ||
<option value="anthropic">Anthropic</option> | ||
<option value="mistralai">MistralAI</option> | ||
<option value="groq">Groq</option> | ||
</select> | ||
</div> | ||
<div class="group"> | ||
<label>LLM Model</label> | ||
<select v-model="model"> | ||
<option value="" v-if="!models.length">Use global default</option> | ||
<option v-for="m in models" :key="m.id" :value="m.id">{{ m.name }}</option> | ||
</select> | ||
</div> | ||
</main> | ||
<footer> | ||
<button @click="onSave" class="default">Save</button> | ||
<button @click="onCancel" formnovalidate>Cancel</button> | ||
</footer> | ||
</form> | ||
</dialog> | ||
</template> | ||
|
||
<script setup> | ||
import { ref, computed, watch } from 'vue' | ||
import { store } from '../services/store' | ||
const engine = ref(null) | ||
const model = ref(null) | ||
const models = computed(() => { | ||
if (!engine.value || engine.value == '') return [] | ||
return store.config.engines[engine.value].models.chat | ||
}) | ||
const load = () => { | ||
engine.value = store.config.commands?.engine || '' | ||
model.value = store.config.commands?.model || '' | ||
} | ||
const onChangeEngine = () => { | ||
if (engine.value == '') model.value = '' | ||
else model.value = store.config.engines[engine.value].models.chat?.[0]?.id | ||
} | ||
const onCancel = () => { | ||
load() | ||
} | ||
const onSave = (event) => { | ||
store.config.commands.engine = engine.value | ||
store.config.commands.model = model.value | ||
store.saveSettings() | ||
} | ||
defineExpose({ load }) | ||
</script> | ||
<style scoped> | ||
@import '../../css/dialog.css'; | ||
@import '../../css/form.css'; | ||
@import '../../css/editor.css'; | ||
</style> |
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