Fix mock server (#1392)

This commit is contained in:
Jim Su 2024-04-26 17:16:29 -04:00 committed by GitHub
parent e9a9186717
commit c0adb55bfa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,7 +33,7 @@ def read_root():
return {'message': 'This is a mock server'}
@app.get('/litellm-models')
@app.get('/api/litellm-models')
def read_llm_models():
return [
'gpt-4',
@ -43,7 +43,7 @@ def read_llm_models():
]
@app.get('/agents')
@app.get('/api/agents')
def read_llm_agents():
return [
'MonologueAgent',
@ -52,5 +52,25 @@ def read_llm_agents():
]
@app.get('/api/messages')
async def get_messages():
return {'messages': []}
@app.get('/api/messages/total')
async def get_message_total():
return {'msg_total': 0}
@app.get('/api/refresh-files')
def refresh_files():
return {
'name': 'workspace',
'children': [
{'name': 'hello_world.py', 'children': []},
],
}
if __name__ == '__main__':
uvicorn.run(app, host='127.0.0.1', port=3000)