Skip to content

Commit 8e06c16

Browse files
committed
fix: fix duplicate endpoint warning:
UserWarning: Duplicate Operation ID list_models_v1_models_get for function list_models at /app/openrag/routers/openai.py warnings.warn(message, stacklevel=1)
1 parent 708c5cf commit 8e06c16

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

openrag/api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,15 @@ def get_version():
214214

215215
app.include_router(tools_router, prefix="/v1", tags=[Tags.TOOLS])
216216

217-
if WITH_OPENAI_API:
218-
# Mount the openai router
217+
# Mount openai router if either OpenAI API or Chainlit UI is enabled (chainlit uses openai api endpoints)
218+
if WITH_OPENAI_API or WITH_CHAINLIT_UI:
219219
app.include_router(openai_router, prefix="/v1", tags=[Tags.OPENAI])
220220

221221
if WITH_CHAINLIT_UI:
222222
# Mount the default front
223223
from chainlit.utils import mount_chainlit
224224

225225
mount_chainlit(app, "./app_front.py", path="/chainlit")
226-
app.include_router(openai_router, prefix="/v1", tags=[Tags.OPENAI]) # cause chainlit uses openai api endpoints
227226

228227
if __name__ == "__main__":
229228
if config.ray.serve.enable:

0 commit comments

Comments
 (0)