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

This commit is contained in:
taylor
2024-10-13 19:52:35 +08:00
parent cae9dc5c78
commit c5b8566d83
4 changed files with 13 additions and 15 deletions

View File

@@ -141,15 +141,15 @@ class AiBotPlugin(Plugin):
if use_platform == 'local_ai':
type = self.config['platforms']['local_ai']['type']
if type == 'ollama':
return Ollama(self.config, self.name, self.http)
return Ollama(self.config, self.http)
elif type == 'lmstudio':
return LmStudio(self.config, self.name, self.http)
return LmStudio(self.config, self.http)
else:
raise ValueError(f"not found platform type: {type}")
if use_platform == 'openai':
return OpenAi(self.config, self.name, self.http)
return OpenAi(self.config, self.http)
if use_platform == 'anthropic':
return Anthropic(self.config, self.name, self.http)
return Anthropic(self.config, self.http)
raise ValueError(f"unknown backend type {use_platform}")
"""