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

This commit is contained in:
taylor
2024-10-13 19:12:52 +08:00
parent 9417a3c75c
commit b934cd399b
2 changed files with 2 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ system_prompt: ""
platforms: platforms:
local_ai: local_ai:
type: ollama type: ollama
url: http://localhost:11434 url: http://192.168.32.162:11434
api_key: api_key:
model: llama3.2 model: llama3.2
max_words: 1000 max_words: 1000

View File

@@ -47,7 +47,7 @@ class Ollama(Platform):
if response.status != 200: if response.status != 200:
return [] return []
response_data = await response.json() response_data = await response.json()
return [f"{i + 1}: {model['name']}" for i, model in response_data['models']] return [f"{i + 1}: {model['name']}" for i, model in enumerate(response_data['models'])]
def get_type(self) -> str: def get_type(self) -> str:
return "local_ai" return "local_ai"