修改内容:

调整llm引用模式
添加对星火大模型的支持
在模型报错时可以人工输入
可以通过config直接全人工输入
This commit is contained in:
ziming 2023-09-05 21:52:13 +08:00
parent 206bc252de
commit 6046f9c942
18 changed files with 277 additions and 29 deletions

View file

@ -8,7 +8,7 @@
import pytest
from metagpt.actions.write_code import WriteCode
from metagpt.llm import LLM
import metagpt.llm as LLM
from metagpt.logs import logger
from tests.metagpt.actions.mock import TASKS_2, WRITE_CODE_PROMPT_SAMPLE
@ -29,6 +29,6 @@ async def test_write_code():
@pytest.mark.asyncio
async def test_write_code_directly():
prompt = WRITE_CODE_PROMPT_SAMPLE + '\n' + TASKS_2[0]
llm = LLM()
llm=LLM.DEFAULT_LLM
rsp = await llm.aask(prompt)
logger.info(rsp)

View file

@ -16,7 +16,7 @@ DETAIL_REQUIREMENT = """需求开发一个基于LLM大语言模型
3. 私有知识库支持pdfwordtxt等各种文件格式上传上传后可以在服务端解析为文本存储ES
资源
1. 大语言模型已经有前置的抽象部署可以通过 `from metagpt.llm import LLM`再使用`LLM().ask(prompt)`直接调用
1. 大语言模型已经有前置的抽象部署可以通过 `import metagpt.llm as LLM`再使用`LLM().ask(prompt)`直接调用
2. Elastic已有[部署](http://192.168.50.82:9200/)代码可以直接使用这个部署"""

View file

@ -8,7 +8,7 @@
import pytest
from metagpt.llm import LLM
import metagpt.llm as LLM
@pytest.fixture()