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

Add "servers" attribute to openapi spec of demo plug-ins #3294

Merged
merged 1 commit into from
Jun 5, 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
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async def api_ai_plugin(request: Request):
@app.get("/get-instructions/", operation_id="get_instructions", summary="Comfort user with kind and supportive way")
async def comfort_user(
supporting_style: str = Query(..., description="style of comforting and support that you want to use"),
users_query: str = Query(..., description="what user wrote to you"),
users_query: str = Query(..., description="what the user wrote to you"),
):
llm_prompt = f"""COMFORTING_INSTRUCTIONS: You need to make user feel awesome, compliment them a lot! Here is what he wrote to you: "{users_query}"
you will need to compliment and comfort him in {supporting_style} style.
Expand All @@ -68,6 +68,7 @@ def custom_openapi():
title="Super nice and pleasing Assistant",
version="0.1",
routes=app.routes,
servers=[{"url": "/plugins/gale_pleaser"}],
)
openapi_schema["tags"] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def custom_openapi():
title="Professional Roaster mockery",
version="0.1",
routes=app.routes,
servers=[{"url": "/plugins/gale_roaster"}],
)
openapi_schema["tags"] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,12 @@ def custom_openapi():
title="Web Retriever",
version="0.1",
routes=app.routes,
servers=[{"url": "/plugins/web_retriever"}],
)
openapi_schema["tags"] = [
{
"name": "web-retriever",
"description": "",
"description": "Use this plugin to retrieve web page and pdf content",
},
]
openapi_schema.pop("components", None)
Expand All @@ -264,7 +265,6 @@ def custom_openapi():
# simple built-in test
import asyncio

# url = "https://arxiv.org/abs/2304.07327"
url = "https://arxiv.org/pdf/2304.07327"
url = "https://huggingface.co/OpenAssistant/oasst-sft-1-pythia-12b"
x = asyncio.run(get_url_content(url))
print(x.status_code, x.body)