Skip to content

Commit 25667d4

Browse files
feat: Make OpenAPI spec usable by custom GPTs (#462)
1 parent d31910a commit 25667d4

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

.changeset/famous-snails-destroy.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-llama": patch
3+
---
4+
5+
Make OpenAPI spec usable by custom GPTs

templates/types/streaming/fastapi/app/api/routers/query.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ def get_query_engine() -> BaseQueryEngine:
1616
return index.as_query_engine()
1717

1818

19-
@r.get("/")
19+
@r.get(
20+
"/",
21+
summary="Get information from the knowledge base",
22+
description="Retrieves relevant information from the knowledge base based on the provided search query. Returns a text response containing the matched information.",
23+
)
2024
async def query_request(
2125
query: str,
2226
) -> str:

templates/types/streaming/fastapi/main.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
from fastapi.responses import RedirectResponse
1717
from fastapi.staticfiles import StaticFiles
1818

19-
app = FastAPI()
19+
servers = []
20+
app_name = os.getenv("FLY_APP_NAME")
21+
if app_name:
22+
servers = [{"url": f"https://{app_name}.fly.dev"}]
23+
app = FastAPI(servers=servers)
2024

2125
init_settings()
2226
init_observability()

0 commit comments

Comments
 (0)