LocalAI/core/http
Ettore Di Giacinto 491e1d752b
feat(functions): relax mixedgrammars (#2365)
* feat(functions): relax mixedgrammars

Extend even more the functionalities and when mixed mode is enabled,
tolerate also both strings and JSON in the result - in this case we make
sure that the JSON can be correctly parsed.

This also updates the examples and the gallery model to configure the
grammar.

The changeset also breaks current function/grammar configuration as it
reserves now a stanza in the YAML config.

For example:

```yaml
function:
  grammar:
    # This allows the grammar to also return messages
    mixed_mode: true
    # Suffix to add to the grammar
    # prefix: '<tool_call>\n'
    # Force parallel calls in the grammar
    # parallel_calls: true
```

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

* refactor, add a way to disable mixed json and freestring

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

* Fix linting issues

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

---------

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
2024-05-22 00:14:16 +02:00
..
ctx Revert #1963 (#2056) 2024-04-17 23:33:49 +02:00
elements fix(ux): fix small glitches (#2265) 2024-05-08 19:34:33 +02:00
endpoints feat(functions): relax mixedgrammars (#2365) 2024-05-22 00:14:16 +02:00
routes feat(ui): display number of available models for installation (#2298) 2024-05-12 14:24:36 +02:00
static feat(webui): statically embed js/css assets (#2348) 2024-05-19 18:24:27 +02:00
views feat(webui): statically embed js/css assets (#2348) 2024-05-19 18:24:27 +02:00
app_test.go test: check the response URL during image gen in app_test.go (#2248) 2024-05-05 18:46:33 +00:00
app.go UI: flag trust_remote_code to users // favicon support (#2253) 2024-05-07 08:39:23 +02:00
http_suite_test.go fix: rename fiber entrypoint from http/api to http/app (#2096) 2024-04-21 22:39:28 +02:00
render.go fix: use bluemonday as recommended by blackfriday (#2142) 2024-04-26 10:34:50 +02:00