This commit is contained in:
ziming 2023-09-19 20:41:10 +08:00
parent 5709e48713
commit 6997ddc49c
2 changed files with 2 additions and 1 deletions

View file

@ -10,7 +10,7 @@ from metagpt.provider.anthropic_api import Claude2 as Claude
from metagpt.provider.openai_api import OpenAIGPTAPI as LLM
from metagpt.provider.spark_api import Spark
DEFAULT_LLM = LLM()
DEFAULT_LLM = Spark()
async def ai_func(prompt):
"""使用LLM进行QA

View file

@ -41,6 +41,7 @@ class Spark:
def _default_system_msg(self):
return self._system_msg(self.system_prompt)
def ask(self, msg: str):
message = [self._user_msg(msg)]
SparkApi.main(CONFIG.xinghuo_appid,CONFIG.xinghuo_api_key,CONFIG.xinghuo_api_secret,"ws://spark-api.xf-yun.com/v2.1/chat","generalv2",message)