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

Does main example (server/main.py) generate proper OpenAPI specs? Seems like it would not. #201

Open
totalhack opened this issue Apr 17, 2023 · 1 comment

Comments

@totalhack
Copy link

Given the code used in main.py it looks like an improper OpenAPI spec would be generated by the sub app, and the static one put in the .well-known directory also seems wrong potentially since it doesn't have the /sub base path.

The following code doesn't have root_in_path_servers set (see docs) so FastAPI would automatically add an additional OpenAPI servers entry with "/sub" as a value and that makes the ChatGPT plugin integration complain. Is that part of why a static one was put in .well-known vs letting FastAPI automatically handle it?

Additionally the OpenAPI spec in .well-known shows a path for /query which is not the proper sub-app path of /sub/query. Was the sub-app generated purely to generate an OpenAPI spec that just had one endpoint to show ChatGPT, but the intent is to have it hit the /query endpoint on the main app? That seems to be what it's doing but can't tell if that is working accidentally.

sub_app = FastAPI(
    title="Retrieval Plugin API",
    description="A retrieval API for querying and filtering documents based on natural language queries and metadata",
    version="1.0.0",
    servers=[{"url": "https://your-app-url.com"}],
    dependencies=[Depends(validate_token)],
)
app.mount("/sub", sub_app)

Thanks for taking a look.

@onsimon
Copy link

onsimon commented May 31, 2023

Also noticed that servers: is under info: while I believe it should be a root element (it is in the quckstart repo)

https://github.com/openai/chatgpt-retrieval-plugin/blob/main/.well-known/openapi.yaml#L6-L7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants