AI Agent学习:MetaGPT之我的工作

ref: ‍⁠​‌​‌​‬‍​​​​‍​​​⁠⁠​⁠​​‬‍‍​​‌​​‬​​《MetaGPT智能体开发入门》教程 - 飞书云文档

【多Agent】MetaGPT学习教程 - 飞书云文档

一、配置本地部署的llm和embedding

llm的配置以及embedding配置:

bash 复制代码
# Full Example: https://github.com/geekan/MetaGPT/blob/main/config/config2.example.yaml
# Reflected Code: https://github.com/geekan/MetaGPT/blob/main/metagpt/config2.py
# Config Docs: https://docs.deepwisdom.ai/main/en/guide/get_started/configuration.html
llm:
  api_type: 'openai'
  base_url : 'http://0.0.0.0:8000/v1'
  model: 'llama'


# RAG Embedding.
# For backward compatibility, if the embedding is not set and the llm's api_type is either openai or azure, the llm's config will be used. 
embedding:
  api_type: "openai"  "ollama" # openai / azure / gemini / ollama etc. Check EmbeddingType for more options.
  base_url: "http://0.0.0.0:8011/"
  api_key: ""
  model: "bge-large-en-v1.5"
  api_version: "v1"
  embed_batch_size: 100
  dimensions: # output dimension of embedding model

对于llm 如果max_model_len不能承受更多的话,需要修改metagpt\provider\openrouter_reasoning.py

python 复制代码
    def _get_max_tokens(self, messages: list[dict]):
        if not self.auto_max_tokens:
            return 1024
            return self.config.max_token
        # FIXME
        # https://community.openai.com/t/why-is-gpt-3-5-turbo-1106-max-tokens-limited-to-4096/494973/3
        return min(get_max_completion_tokens(messages, self.model, self.config.max_token), 1024) #4096)

对于rag案例:

需要修改metagpt\rag\schema.py

python 复制代码
class FAISSRetrieverConfig(IndexRetrieverConfig):
    """Config for FAISS-based retrievers."""

    dimensions: int = Field(default=0, description="Dimensionality of the vectors for FAISS index construction.")

    _embedding_type_to_dimensions: ClassVar[dict[EmbeddingType, int]] = {
        EmbeddingType.GEMINI: 768,
        EmbeddingType.OLLAMA: 1024, #4096,
    }

做好配置

整个过程就是配置

bash 复制代码
export DISCORD_TOKEN=
export DISCORD_CHANNEL_ID=

三、用Discord 发送 github trending动态 进阶版

读取readme总结

对应whole_run2.py

四、用Discord发送 huggingface paper动态

对应whole_run-huggingface.py

五、用邮件发送github trending动态

对应whole_run-email.py

六、多智能体:你画我猜 multi-ones.py

相关推荐
向量引擎19 小时前
【万字硬核】解密GPT-5.2-Pro与Sora2底层架构:从Transformer到世界模型,手撸一个高并发AI中台(附Python源码+压测报告)
人工智能·gpt·ai·aigc·ai编程·ai写作·api调用
while(awake) code19 小时前
L1 书生大模型提示词实践
人工智能
俊哥V19 小时前
[笔记.AI]谷歌Gemini-Opal上手初探
人工智能·ai·gemini·opal
code bean19 小时前
【AI】AI大模型之流式传输(前后端技术实现)
人工智能·ai·大模型·流式传输
黑客思维者19 小时前
二次函数模型完整训练实战教程,理解非线性模型的拟合逻辑(超详细,零基础可懂)
人工智能·语言模型·非线性拟合·二次函数模型
小途软件19 小时前
ssm607家政公司服务平台的设计与实现+vue
java·人工智能·pytorch·python·深度学习·语言模型
星火开发设计19 小时前
二叉树详解及C++实现
java·数据结构·c++·学习·二叉树·知识·期末考试
WJSKad123519 小时前
传送带物体检测识别_基于YOLO11与RGCSPELAN改进算法_工业视觉检测系统
人工智能·算法·视觉检测
富唯智能19 小时前
重新定义“自动化搬运项目”:15分钟部署的复合机器人如何革新柔性生产
人工智能·机器人·自动化
zxy284722530119 小时前
利用C#对接BotSharp本地大模型AI Agent示例(2)
人工智能·c#·api·ai agent·botsharp