Add endpoints for model listing and legacy model retrieval
Build and Push Agent API / build (push) Successful in 6s
Build and Push Agent API / build (push) Successful in 6s
This commit is contained in:
@@ -43,6 +43,25 @@ def chat(req: ChatRequest):
|
||||
"session_id": req.session_id
|
||||
}
|
||||
|
||||
|
||||
@app.get("/v1/models")
|
||||
def list_models():
|
||||
return {
|
||||
"object": "list",
|
||||
"data": [
|
||||
{
|
||||
"id": "agent-model",
|
||||
"object": "model",
|
||||
"created": 0,
|
||||
"owned_by": "local-agent"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@app.get("/models")
|
||||
def legacy_models():
|
||||
return list_models()
|
||||
|
||||
@app.post("/v1/chat/completions")
|
||||
def chat_completions(req: dict):
|
||||
messages = req["messages"]
|
||||
|
||||
Reference in New Issue
Block a user