geekan / MetaGPT

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
https://deepwisdom.ai/
MIT License
43.6k stars 5.19k forks source link

使用本地llama3.1模型,测试metagpt "创建一个 2048 游戏",无法找到本地llama3.1模型。 #1443

Open ws910616 opened 1 month ago

ws910616 commented 1 month ago

Bug description 使用本地的环境llama3.1模型进行对接提示无法找到该模型

Bug solved method root@sec-pc:~/.metagpt# metagpt "create a2048 game" 2024-08-08 15:40:18.664 | INFO | metagpt.const:get_metagpt_package_root:29 - Package root set to /root/.metagpt 2024-08-08 15:40:21.802 | INFO | metagpt.team:invest:90 - Investment: $3.0. 2024-08-08 15:40:21.804 | INFO | metagpt.roles.role:_act:391 - Alice(Product Manager): to do PrepareDocuments(PrepareDocuments) 2024-08-08 15:40:21.818 | INFO | metagpt.utils.file_repository:save:57 - save to: /root/.metagpt/workspace/20240808154021/docs/requirement.txt 2024-08-08 15:40:21.821 | INFO | metagpt.roles.role:_act:391 - Alice(Product Manager): to do WritePRD(WritePRD) 2024-08-08 15:40:21.822 | INFO | metagpt.actions.write_prd:run:86 - New requirement detected: create a2048 game Based on the provided context, I will follow the instructions to create the output in the specified format.

Project Name

Original Requirements

create a2048 game

Search Information

-


[CONTENT]

{ "Language": "en_us", "Programming Language": "Python", "Original Requirements": "Create a 2048 game", "Project Name": "game_2048", "Product Goals": [ "Create an engaging user experience", "Improve accessibility, be responsive", "More beautiful UI" ], "User Stories": [ "As a player, I want to be able to choose difficulty levels", "As a player, I want to see my score after each game", "As a player, I want to get restart button when I lose", "As a player, I want to see beautiful UI that make me feel good", "As a player, I want to play game via mobile phone" ], "Competitive Analysis": [ "2048 Game A: Simple interface, lacks responsive features", "play2048.co: Beautiful and responsive UI with my best score shown", "2048game.com: Responsive UI with my best score shown, but many ads" ], "Competitive Quadrant Chart": "", "Requirement Analysis": "", "Requirement Pool": [ [ "P0", "The main code ..." ], [ "P0", "The game algorithm ..." ] ], "UI Design draft": "Basic function description with a simple style and layout.", "Anything UNCLEAR": "" } [/CONTENT] 2024-08-08 15:40:35.039 | WARNING | metagpt.utils.cost_manager:update_cost:49 - Model llama3.1 not found in TOKEN_COSTS. 2024-08-08 15:40:35.045 | INFO | metagpt.utils.git_repository:rename_root:203 - Delete directory /root/.metagpt/workspace/game_2048 2024-08-08 15:40:35.048 | INFO | metagpt.utils.git_repository:rename_root:219 - Rename directory /root/.metagpt/workspace/20240808154021 to /root/.metagpt/workspace/game_2048 2024-08-08 15:40:35.049 | INFO | metagpt.utils.file_repository:save:57 - save to: /root/.metagpt/workspace/game_2048/docs/prd/20240808154035.json 2024-08-08 15:40:35.050 | INFO | metagpt.utils.file_repository:save:57 - save to: /root/.metagpt/workspace/game_2048/resources/prd/20240808154035.md 2024-08-08 15:40:35.052 | INFO | metagpt.roles.role:_act:391 - Bob(Architect): to do WriteDesign(WriteDesign) [CONTENT] { "Implementation approach": "We will utilize Python's built-in libraries and frameworks to create a responsive and engaging 2048 game. Specifically, we will use Tkinter for GUI development and Pygame for game logic implementation.", "File list": [ "main.py", "game.py", "ui.py" ], "Data structures and interfaces": "\nclassDiagram\n class Game {\n -Score score\n -Board board\n +init()\n +update_score()\n +check_game_over()\n }\n class UI {\n -Tkinter tk\n -Game game\n +create_widgets()\n +update_board()\n +handle_events()\n }\n class Board {\n -Grid grid\n +init()\n +insert_tile()\n +check_game_over()\n }\n Game --> UI\n UI --> Game\n Game --> Board\n", "Program call flow": "\nsequenceDiagram\n participant M as Main\n participant G as Game\n participant U as UI\n participant B as Board\n M->>G: init()\n G->>U: create_widgets()\n U->>B: update_board()\n B->>G: check_game_over()\n G->>M: return score\n G->>U: handle_events()\n U->>B: insert_tile()\n B-->>U: return updated board\n", "Anything UNCLEAR": "Clarification needed on implementing a restart button when the game is lost, and ensuring the UI remains responsive during gameplay." } [/CONTENT] 2024-08-08 15:40:45.289 | WARNING | metagpt.utils.cost_manager:update_cost:49 - Model llama3.1 not found in TOKEN_COSTS. 2024-08-08 15:40:45.293 | INFO | metagpt.utils.file_repository:save:57 - save to: /root/.metagpt/workspace/game_2048/docs/system_design/20240808154035.json 2024-08-08 15:40:45.294 | INFO | metagpt.utils.file_repository:save:62 - update dependency: /root/.metagpt/workspace/game_2048/docs/system_design/20240808154035.json:{'docs/prd/20240808154035.json'} no mermaid 2024-08-08 15:40:45.296 | WARNING | metagpt.utils.mermaid:mermaid_to_file:35 - RUN npm install -g @mermaid-js/mermaid-cli to install mmdc,or consider changing engine to playwright, pyppeteer, or ink. 2024-08-08 15:40:45.296 | INFO | metagpt.actions.design_api:_save_data_api_design:107 - Save class view to /root/.metagpt/workspace/game_2048/resources/data_api_design/20240808154035 no mermaid 2024-08-08 15:40:45.297 | WARNING | metagpt.utils.mermaid:mermaid_to_file:35 - RUN npm install -g @mermaid-js/mermaid-cli to install mmdc,or consider changing engine to playwright, pyppeteer, or ink. 2024-08-08 15:40:45.298 | INFO | metagpt.actions.design_api:_save_seq_flow:116 - Saving sequence flow to /root/.metagpt/workspace/game_2048/resources/seq_flow/20240808154035 2024-08-08 15:40:45.298 | INFO | metagpt.utils.file_repository:save:57 - save to: /root/.metagpt/workspace/game_2048/resources/system_design/20240808154035.md 2024-08-08 15:40:45.301 | INFO | metagpt.roles.role:_act:391 - Eve(Project Manager): to do WriteTasks(WriteTasks)

Environment information

System version:Ubuntu 22.04.3 Python version :Python 3.10.12 LLM type and model :Ollama llama3.1

Screenshots or logs llm: api_type: "ollama" # or azure / ollama / open_llm etc. Check LLMType for more options model: "llama3.1" # or gpt-3.5-turbo-1106 / gpt-4-1106-preview base_url: "http://127.0.0.1:11434/api" # or forward url / other llm url api_key: "None"

QQ_1723132986769

iorisa commented 1 month ago

这些都是模型的返回结果,说明模型是在工作了:

……
{
"Language": "en_us",
"Programming Language": "Python",
"Original Requirements": "Create a 2048 game",
"Project Name": "game_2048",
……

这个警告是因为llama3.1名字没有对应的费用套餐,没法帮你算成本。

2024-08-08 15:40:45.289 | WARNING | metagpt.utils.cost_manager:update_cost:49 - Model llama3.1 not found in TOKEN_COSTS.

你可以使用pricing_plan配置来用已有的等价套餐的名字来代替。比如下面的配置,是按 "llama3-70b-8192"的套餐计费的:

llm:
  base_url: "https://agent-store2.openai.azure.com/"
  api_type: "azure"
  model: "lama3.1"
  pricing_plan: "llama3-70b-8192"