models(gallery): add mistral-0.3 and command-r, update functions (#2388)

* models(gallery): add mistral-0.3 and command-r, update functions

Add also disable_parallel_new_lines to disable newlines in the JSON
output when forcing parallel tools. Some models (like mistral) might be
very sensible to that when being used for function calling.

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* models(gallery): add aya-23-8b

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

---------

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2024-05-23 19:16:08 +02:00 committed by GitHub
parent eb11a46a73
commit ea330d452d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 266 additions and 9 deletions

View file

@ -427,5 +427,22 @@ var _ = Describe("JSON schema grammar tests", func() {
}
Expect(len(results)).To(Equal(len(strings.Split(grammar, "\n"))), grammar)
})
It("generates parallel tools without newlines in JSON", func() {
structuredGrammar := JSONFunctionStructureName{
OneOf: testFunctionsName}
content := `arr ::=
"[" (
realvalue
("," realvalue)*
)? "]"`
grammar := structuredGrammar.Grammar(functions.EnableMaybeString, functions.EnableMaybeArray, functions.DisableParallelNewLines)
results := strings.Split(content, "\n")
for _, r := range results {
if r != "" {
Expect(grammar).To(ContainSubstring(r))
}
}
})
})
})