Skip to content

Commit

Permalink
Sanitize local-server name => local_server (openai#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-lindstrom authored May 15, 2023
1 parent 120ff44 commit 80e0155
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
scripts/
tests/
examples/
local-server/
local_server/
*.md
*.pyc
.dockerignore
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ Append `docs` to the URL shown in the terminal and open it in a browser to acces

### Testing a Localhost Plugin in ChatGPT

To test a localhost plugin in ChatGPT, use the provided [`local-server/main.py`](/local-server/main.py) file, which is specifically configured for localhost testing with CORS settings, no authentication and routes for the manifest, OpenAPI schema and logo.
To test a localhost plugin in ChatGPT, use the provided [`local_server/main.py`](/local_server/main.py) file, which is specifically configured for localhost testing with CORS settings, no authentication and routes for the manifest, OpenAPI schema and logo.

Follow these steps to test your localhost plugin:

Expand Down
File renamed without changes.
File renamed without changes
8 changes: 4 additions & 4 deletions local-server/main.py → local_server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@

@app.route("/.well-known/ai-plugin.json")
async def get_manifest(request):
file_path = "./local-server/ai-plugin.json"
file_path = "./local_server/ai-plugin.json"
return FileResponse(file_path, media_type="text/json")


@app.route("/.well-known/logo.png")
async def get_logo(request):
file_path = "./local-server/logo.png"
file_path = "./local_server/logo.png"
return FileResponse(file_path, media_type="text/json")


@app.route("/.well-known/openapi.yaml")
async def get_openapi(request):
file_path = "./local-server/openapi.yaml"
file_path = "./local_server/openapi.yaml"
return FileResponse(file_path, media_type="text/json")


Expand Down Expand Up @@ -142,4 +142,4 @@ async def startup():


def start():
uvicorn.run("local-server.main:app", host="localhost", port=PORT, reload=True)
uvicorn.run("local_server.main:app", host="localhost", port=PORT, reload=True)
File renamed without changes.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pgvector = "^0.1.7"

[tool.poetry.scripts]
start = "server.main:start"
dev = "local-server.main:start"
dev = "local_server.main:start"

[tool.poetry.group.dev.dependencies]
httpx = "^0.23.3"
Expand Down

0 comments on commit 80e0155

Please sign in to comment.