From 118ea4663fb6494a8c647ef9f2df4d61c6e01d62 Mon Sep 17 00:00:00 2001 From: Max Cembalest Date: Wed, 25 Sep 2024 17:24:50 -0400 Subject: [PATCH] explained references schema Signed-off-by: Max Cembalest --- .../python/docs/gpt4all_api_server/home.md | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/gpt4all-bindings/python/docs/gpt4all_api_server/home.md b/gpt4all-bindings/python/docs/gpt4all_api_server/home.md index 9bf5b368..d13740ec 100644 --- a/gpt4all-bindings/python/docs/gpt4all_api_server/home.md +++ b/gpt4all-bindings/python/docs/gpt4all_api_server/home.md @@ -32,7 +32,7 @@ The server only accepts HTTP connections (not HTTPS) and only listens on localho "model": "Phi-3 Mini Instruct", "messages": [{"role":"user","content":"Who is Lionel Messi?"}], "max_tokens": 50, - "temperature": 0.28, + "temperature": 0.28 }' ``` @@ -65,8 +65,22 @@ You can use LocalDocs with the API server: 3. Select the server chat (it has a different background color). 4. Activate LocalDocs collections in the right sidebar. -Now, your API calls to your local LLM will auto-retrieve relevant snippets from your LocalDocs collection to provide those snippets to the LLM for its response. - -The snippets can be accessed in the API response at `response.choices[0].references`. - (Note: LocalDocs can currently only be activated through the GPT4All UI, not via the API itself). + +Now, your API calls to your local LLM will have relevant references from your LocalDocs collection retrieved and placed in the input message for the LLM to respond to. + +The references retrieved for your API call can be accessed in the API response object at + +`response["choices"][0]["references"]` + +The data included in the `references` are: + +- `text`: the actual text content from the snippet that was extracted from the reference document + +- `author`: the author of the reference document (if available) + +- `date`: the date of creation of the reference document (if available) + +- `page`: the page number the snippet is from (only available for PDF documents for now) + +- `title`: the title of the reference document (if available)