feat: improve model name matching in Ollama plugin

- Add "conceptmap" to VSCode dictionary settings
- Rename `ollamaPrefixes` variable to `ollamaSearchStrings`
- Replace `HasPrefix` with `Contains` for model matching
- Enable substring matching for Ollama model names
- chore: incoming 1847 changelog entry
This commit is contained in:
Kayvan Sylvan
2025-11-28 09:53:51 +08:00
parent 895ca1ad99
commit 42fabab352
3 changed files with 11 additions and 3 deletions

View File

@@ -24,6 +24,7 @@
"compadd", "compadd",
"compdef", "compdef",
"compinit", "compinit",
"conceptmap",
"creatordate", "creatordate",
"curcontext", "curcontext",
"custompatterns", "custompatterns",

View File

@@ -0,0 +1,7 @@
### PR [#1847](https://github.com/danielmiessler/Fabric/pull/1847) by [ksylvan](https://github.com/ksylvan): Improve model name matching for NeedsRaw in Ollama plugin
- Improved model name matching in Ollama plugin by replacing prefix-based matching with substring matching
- Enhanced NeedsRaw functionality to support more flexible model name detection
- Renamed `ollamaPrefixes` variable to `ollamaSearchStrings` for better code clarity
- Replaced `HasPrefix` function with `Contains` for more comprehensive model matching
- Added "conceptmap" to VSCode dictionary settings

View File

@@ -163,13 +163,13 @@ func (o *Client) createChatRequest(msgs []*chat.ChatCompletionMessage, opts *dom
} }
func (o *Client) NeedsRawMode(modelName string) bool { func (o *Client) NeedsRawMode(modelName string) bool {
ollamaPrefixes := []string{ ollamaSearchStrings := []string{
"llama3", "llama3",
"llama2", "llama2",
"mistral", "mistral",
} }
for _, prefix := range ollamaPrefixes { for _, searchString := range ollamaSearchStrings {
if strings.HasPrefix(modelName, prefix) { if strings.Contains(modelName, searchString) {
return true return true
} }
} }