add: 添加命令ai model list的逻辑

This commit is contained in:
taylor
2024-10-13 19:01:15 +08:00
parent 3e8bf75f05
commit 6f957b155e

View File

@@ -46,8 +46,8 @@ class Ollama(Platform):
async with self.http.get(full_url) as response: async with self.http.get(full_url) as response:
if response.status != 200: if response.status != 200:
return [] return []
response_data = json.loads(await response.json()) response_data = await response.json()
return [model['name'] for model in response_data] return [model['name'] for model in response_data['models']]
def get_type(self) -> str: def get_type(self) -> str:
return "local_ai" return "local_ai"