Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FastAPI Body deprecation warning #504

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/cat/routes/embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand Down
2 changes: 1 addition & 1 deletion core/cat/routes/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand Down
4 changes: 2 additions & 2 deletions core/cat/routes/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand Down Expand Up @@ -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"""

Expand Down
Loading