fix(grammar): respect JSONmode and grammar from user input (#1935)

* fix(grammar): Fix JSON mode and custom grammar

* tests(aio): add jsonmode test

* tests(aio): add functioncall test

* fix(aio): use hermes-2-pro-mistral as llm for CPU profile

* add phi-2-orange
This commit is contained in:
Ettore Di Giacinto 2024-03-31 13:04:09 +02:00 committed by GitHub
parent 784657a652
commit 35290e146b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 139 additions and 5 deletions

View file

@ -185,6 +185,8 @@ func ChatEndpoint(cl *config.BackendConfigLoader, ml *model.ModelLoader, startup
input.Grammar = grammar.JSONBNF
}
config.Grammar = input.Grammar
// process functions if we have any defined or if we have a function call string
if len(input.Functions) > 0 && config.ShouldUseFunctions() {
log.Debug().Msgf("Response needs to process functions")