From cce0e885eec6cd113a44fe05533f4aa0e43df1f2 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Thu, 6 Feb 2025 21:34:10 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20docs:=20`GOOGLE=5FEXCLUDE?= =?UTF-8?q?=5FSAFETY=5FSETTINGS`=20&=20`CONSOLE=5FJSON=5FSTRING=5FLENGTH`?= =?UTF-8?q?=20(#225)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 📘 docs: Update Google safety settings documentation and add exclusion option * 📘 docs: Add configuration option for console JSON string length truncation --- pages/docs/configuration/dotenv.mdx | 2 ++ pages/docs/configuration/logging.mdx | 8 ++++++++ pages/docs/configuration/pre_configured_ai/google.mdx | 10 ++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pages/docs/configuration/dotenv.mdx b/pages/docs/configuration/dotenv.mdx index 6f90ba7..31edcaa 100644 --- a/pages/docs/configuration/dotenv.mdx +++ b/pages/docs/configuration/dotenv.mdx @@ -152,6 +152,7 @@ LibreChat has built-in central logging, see [Logging System](/docs/configuration ['DEBUG_LOGGING', 'boolean', 'Keep debug logs active.','DEBUG_LOGGING=true'], ['DEBUG_CONSOLE', 'boolean', 'Enable verbose console/stdout logs in the same format as file debug logs.', 'DEBUG_CONSOLE=false'], ['CONSOLE_JSON', 'boolean', 'Enable verbose JSON console/stdout logs suitable for cloud deployments like GCP/AWS.', 'CONSOLE_JSON=false'], + ['CONSOLE_JSON_STRING_LENGTH', 'number', 'Configure the truncation size for console/stdout logs, defaults to 255', 'CONSOLE_JSON_STRING_LENGTH=1000'], ]} /> @@ -261,6 +262,7 @@ Follow these instructions to setup the [Google Endpoint](/docs/configuration/pre ['GOOGLE_MODELS', 'string', 'Available Vertex AI Google models, separated by commas.', 'GOOGLE_MODELS=gemini-1.5-pro-preview-0409,gemini-1.0-pro-vision-001,gemini-pro,gemini-pro-vision,chat-bison,chat-bison-32k,codechat-bison,codechat-bison-32k,text-bison,text-bison-32k,text-unicorn,code-gecko,code-bison,code-bison-32k'], ['GOOGLE_TITLE_MODEL', 'string', 'The model used for titling with Google.', 'GOOGLE_TITLE_MODEL=gemini-pro'], ['GOOGLE_LOC', 'string', 'Specifies the Google Cloud location for processing API requests', 'GOOGLE_LOC=us-central1'], + ['GOOGLE_EXCLUDE_SAFETY_SETTINGS', 'string', 'Completely omit the safety settings that are included by default, which will use provider defaults', 'GOOGLE_EXCLUDE_SAFETY_SETTINGS=true'], ['GOOGLE_SAFETY_SEXUALLY_EXPLICIT', 'string', 'Safety setting for sexually explicit content. Options are BLOCK_ALL, BLOCK_ONLY_HIGH, WARN_ONLY, and OFF.', 'GOOGLE_SAFETY_SEXUALLY_EXPLICIT=BLOCK_ONLY_HIGH'], ['GOOGLE_SAFETY_HATE_SPEECH', 'string', 'Safety setting for hate speech content. Options are BLOCK_ALL, BLOCK_ONLY_HIGH, WARN_ONLY, and OFF.', 'GOOGLE_SAFETY_HATE_SPEECH=BLOCK_ONLY_HIGH'], ['GOOGLE_SAFETY_HARASSMENT', 'string', 'Safety setting for harassment content. Options are BLOCK_ALL, BLOCK_ONLY_HIGH, WARN_ONLY, and OFF.', 'GOOGLE_SAFETY_HARASSMENT=BLOCK_ONLY_HIGH'], diff --git a/pages/docs/configuration/logging.mdx b/pages/docs/configuration/logging.mdx index 5360e39..2805a70 100644 --- a/pages/docs/configuration/logging.mdx +++ b/pages/docs/configuration/logging.mdx @@ -75,3 +75,11 @@ This is not recommended however, as the outputs can be quite verbose. It's disab ['CONSOLE_JSON', 'boolean', 'Enable verbose JSON console/stdout logs suitable for cloud deployments like GCP/AWS.', 'CONSOLE_JSON=false'], ]} /> + +By default, the JSON string length is truncated to 255 characters. You can configure this with the following environment variable: + + diff --git a/pages/docs/configuration/pre_configured_ai/google.mdx b/pages/docs/configuration/pre_configured_ai/google.mdx index 0c4a874..0d02f44 100644 --- a/pages/docs/configuration/pre_configured_ai/google.mdx +++ b/pages/docs/configuration/pre_configured_ai/google.mdx @@ -117,9 +117,9 @@ services: ``` -## Vertex AI Safety Settings +## Google Safety Settings -To set safety settings for Vertex AI, you can set the following in your .env file: +To set safety settings for both Vertex AI and Generative Language API, you can set the following in your .env file: ```bash filename=".env" GOOGLE_SAFETY_SEXUALLY_EXPLICIT=BLOCK_ONLY_HIGH @@ -128,6 +128,12 @@ GOOGLE_SAFETY_HARASSMENT=BLOCK_ONLY_HIGH GOOGLE_SAFETY_DANGEROUS_CONTENT=BLOCK_ONLY_HIGH ``` +You can also exclude safety settings by setting the following in your .env file, which will use the provider defaults. This can be helpful if you are having issues with specific safety settings. + +```bash filename=".env" +GOOGLE_EXCLUDE_SAFETY_SETTINGS=true +``` + NOTE: You do not have access to the BLOCK_NONE setting by default. To use this restricted `HarmBlockThreshold` setting, you will need to either: - (a) Get access through an allowlist via your Google account team