From c933cb5e069421757f012363e9f98a1b2625d16a Mon Sep 17 00:00:00 2001 From: Emanuele Morrone <67059270+Pingdred@users.noreply.github.com> Date: Thu, 19 Oct 2023 13:05:45 +0200 Subject: [PATCH] Fix `example` deprecation warning --- core/cat/routes/embedder.py | 2 +- core/cat/routes/llm.py | 2 +- core/cat/routes/plugins.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/cat/routes/embedder.py b/core/cat/routes/embedder.py index d7a69a90..089d5c05 100644 --- a/core/cat/routes/embedder.py +++ b/core/cat/routes/embedder.py @@ -91,7 +91,7 @@ def get_embedder_settings(request: Request, languageEmbedderName: str) -> Dict: def upsert_embedder_setting( request: Request, languageEmbedderName: str, - payload: Dict = Body(example={"openai_api_key": "your-key-here"}), + payload: Dict = Body(examples={"openai_api_key": "your-key-here"}), ) -> Dict: """Upsert the Embedder setting""" diff --git a/core/cat/routes/llm.py b/core/cat/routes/llm.py index fbde5dd2..5dfe96b1 100644 --- a/core/cat/routes/llm.py +++ b/core/cat/routes/llm.py @@ -85,7 +85,7 @@ def get_llm_settings(request: Request, languageModelName: str) -> Dict: def upsert_llm_setting( request: Request, languageModelName: str, - payload: Dict = Body(example={"openai_api_key": "your-key-here"}), + payload: Dict = Body(examples={"openai_api_key": "your-key-here"}), ) -> Dict: """Upsert the Large Language Model setting""" diff --git a/core/cat/routes/plugins.py b/core/cat/routes/plugins.py index 2edad4c6..db2d34ed 100644 --- a/core/cat/routes/plugins.py +++ b/core/cat/routes/plugins.py @@ -104,7 +104,7 @@ async def install_plugin( async def install_plugin_from_registry( request: Request, background_tasks: BackgroundTasks, - payload: Dict = Body(example={"url": "https://github.com/plugin-dev-account/plugin-repo"}) + payload: Dict = Body(examples={"url": "https://github.com/plugin-dev-account/plugin-repo"}) ) -> Dict: """Install a new plugin from registry""" @@ -267,7 +267,7 @@ async def get_plugin_settings(request: Request, plugin_id: str) -> Dict: async def upsert_plugin_settings( request: Request, plugin_id: str, - payload: Dict = Body(example={"setting_a": "some value", "setting_b": "another value"}), + payload: Dict = Body(examples={"setting_a": "some value", "setting_b": "another value"}), ) -> Dict: """Updates the settings of a specific plugin"""