mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-01-09 22:38:10 -05:00
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:
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@@ -24,6 +24,7 @@
|
|||||||
"compadd",
|
"compadd",
|
||||||
"compdef",
|
"compdef",
|
||||||
"compinit",
|
"compinit",
|
||||||
|
"conceptmap",
|
||||||
"creatordate",
|
"creatordate",
|
||||||
"curcontext",
|
"curcontext",
|
||||||
"custompatterns",
|
"custompatterns",
|
||||||
|
|||||||
7
cmd/generate_changelog/incoming/1847.txt
Normal file
7
cmd/generate_changelog/incoming/1847.txt
Normal 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
|
||||||
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user