Merge pull request #940 from better629/feat_new_qianfan

Feat add qianfan and dashscope
This commit is contained in:
Alexander Wu 2024-02-28 13:57:00 +08:00 committed by GitHub
commit d3961a630e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 845 additions and 8 deletions

View file

@ -13,7 +13,18 @@ from metagpt.logs import logger
async def main():
llm = LLM()
logger.info(await llm.aask("hello world"))
# llm type check
question = "what's your name"
logger.info(f"{question}: ")
logger.info(await llm.aask(question))
logger.info("\n\n")
logger.info(
await llm.aask(
"who are you", system_msgs=["act as a robot, just answer 'I'am robot' if the question is 'who are you'"]
)
)
logger.info(await llm.aask_batch(["hi", "write python hello world."]))
hello_msg = [{"role": "user", "content": "count from 1 to 10. split by newline."}]