From dcaf51bc9e09ae02c5719aea7f9232d7c6dd2c9e Mon Sep 17 00:00:00 2001 From: iFurySt Date: Fri, 5 Apr 2024 11:21:17 +0800 Subject: [PATCH] fix: add the community-maintained model list (#654) --- opendevin/server/listen.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/opendevin/server/listen.py b/opendevin/server/listen.py index c9d11621fa..5631381415 100644 --- a/opendevin/server/listen.py +++ b/opendevin/server/listen.py @@ -1,8 +1,8 @@ from opendevin.server.session import Session from fastapi import FastAPI, WebSocket from fastapi.middleware.cors import CORSMiddleware -import agenthub # noqa F401 (we import this to get the agents registered) -import litellm +import agenthub # noqa F401 (we import this to get the agents registered) +import litellm from opendevin.agent import Agent from opendevin import config @@ -16,6 +16,7 @@ app.add_middleware( allow_headers=["*"], ) + # This endpoint receives events from the client (i.e. the browser) @app.websocket("/ws") async def websocket_endpoint(websocket: WebSocket): @@ -24,12 +25,14 @@ async def websocket_endpoint(websocket: WebSocket): # TODO: should this use asyncio instead of await? await session.start_listening() + @app.get("/litellm-models") async def get_litellm_models(): """ Get all models supported by LiteLLM. """ - return litellm.model_list + return list(set(litellm.model_list + list(litellm.model_cost.keys()))) + @app.get("/litellm-agents") async def get_litellm_agents():