From 9fe44a9b569c8ddb037c2c773f4b25236de6f26f Mon Sep 17 00:00:00 2001 From: Kye Gomez Date: Wed, 26 Jun 2024 11:44:46 -0700 Subject: [PATCH] [CLEANUP][Model Routews] --- servers/agent/api.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/servers/agent/api.py b/servers/agent/api.py index 199c1cb..a408a0d 100644 --- a/servers/agent/api.py +++ b/servers/agent/api.py @@ -107,16 +107,14 @@ def model_router(model_name: str): ) -# @app.get("/v1/models", response_model=ModelList) -# async def list_models(): -# """ -# An endpoint to list available models. It returns a list of model cards. -# This is useful for clients to query and understand what models are available for use. -# """ -# model_card = ModelCard( -# id="cogvlm-chat-17b" -# ) # can be replaced by your model id like cogagent-chat-18b -# return ModelList(data=[model_card]) +@app.get("/v1/models", response_model=List[str]) +async def list_models(): + """ + An endpoint to list available models. It returns a list of model names. + This is useful for clients to query and understand what models are available for use. + """ + model_names = ["OpenAIChat", "GPT4o", "GPT4VisionAPI", "Anthropic"] + return model_names @app.post("v1/agent/completions", response_model=AgentOutput)