diff --git a/search_with_lepton.py b/search_with_lepton.py index b1b4d99..09977fb 100644 --- a/search_with_lepton.py +++ b/search_with_lepton.py @@ -8,7 +8,7 @@ import requests import traceback from typing import Annotated, List, Generator, Optional -from fastapi.responses import HTMLResponse, StreamingResponse +from fastapi.responses import HTMLResponse, StreamingResponse, RedirectResponse import httpx from loguru import logger @@ -319,12 +319,10 @@ class RAG(Photon): "content": query, }, ], - tools=[ - { - "type": "function", - "function": tool.get_tools_spec(ask_related_questions), - } - ], + tools=[{ + "type": "function", + "function": tool.get_tools_spec(ask_related_questions), + }], max_tokens=512, ) related = response.choices[0].message.tool_calls[0].function.arguments @@ -478,6 +476,13 @@ class RAG(Photon): def ui(self): return StaticFiles(directory="ui") + @Photon.handler(method="GET", path="/") + def index(self) -> RedirectResponse: + """ + Redirects "/" to the ui page. + """ + return RedirectResponse(url="/ui/index.html") + if __name__ == "__main__": rag = RAG()