mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-22 11:35:00 +00:00
Add a way to disable default action
This commit is contained in:
parent
bbc4468908
commit
b3f43ab938
2 changed files with 5 additions and 2 deletions
|
@ -42,6 +42,8 @@ type Config struct {
|
||||||
MainGPU string `yaml:"main_gpu"`
|
MainGPU string `yaml:"main_gpu"`
|
||||||
ImageGenerationAssets string `yaml:"asset_dir"`
|
ImageGenerationAssets string `yaml:"asset_dir"`
|
||||||
|
|
||||||
|
DisableDefaultAnswer bool `yaml:"disable_default_answer"`
|
||||||
|
|
||||||
PromptCachePath string `yaml:"prompt_cache_path"`
|
PromptCachePath string `yaml:"prompt_cache_path"`
|
||||||
PromptCacheAll bool `yaml:"prompt_cache_all"`
|
PromptCacheAll bool `yaml:"prompt_cache_all"`
|
||||||
PromptCacheRO bool `yaml:"prompt_cache_ro"`
|
PromptCacheRO bool `yaml:"prompt_cache_ro"`
|
||||||
|
@ -269,7 +271,6 @@ func updateConfig(config *Config, input *OpenAIRequest) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can be either a string or an object
|
// Can be either a string or an object
|
||||||
switch fnc := input.FunctionCall.(type) {
|
switch fnc := input.FunctionCall.(type) {
|
||||||
case string:
|
case string:
|
||||||
|
|
|
@ -425,7 +425,9 @@ func chatEndpoint(cm *ConfigMerger, o *Option) func(c *fiber.Ctx) error {
|
||||||
|
|
||||||
// Append the no action function
|
// Append the no action function
|
||||||
funcs = append(funcs, input.Functions...)
|
funcs = append(funcs, input.Functions...)
|
||||||
funcs = append(funcs, noActionGrammar)
|
if !config.DisableDefaultAnswer {
|
||||||
|
funcs = append(funcs, noActionGrammar)
|
||||||
|
}
|
||||||
|
|
||||||
// Force picking one of the functions by the request
|
// Force picking one of the functions by the request
|
||||||
if config.functionCallNameString != "" {
|
if config.functionCallNameString != "" {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue