当前位置: 首页 > news >正文

AutoGen agent使用;调用本地LLM

参考:
https://microsoft.github.io/autogen

安装:

pip install pyautogen

代码

本地LLM部署可以用fastchat、vllm等框架部署openai接口:

from autogen import AssistantAgent, UserProxyAgent, oai
## 调用本地模型对外的openai接口
config_list=[{"model": "/mnt/data/loong/AquilaChat2-7B","api_base": "http://localhost:10860/v1","api_type": "open_ai","api_key": "NULL", # just a placeholder}
]response = oai.Completion.create(config_list=config_list, prompt="Hi")
##构建agentassistant = AssistantAgent("assistant",llm_config={"config_list": config_list})
user_proxy = UserProxyAgent("user_proxy")##任务
user_proxy.initiate_chat(assistant, message="计算下2的10次方等于多少", config_list=config_list)

在这里插入图片描述

http://www.lryc.cn/news/216385.html

相关文章:

  • Docker安装matomo
  • 副对角线以上和以下都为0的行列式求解
  • DSP开发例程(4): logbuf_print_to_uart
  • 计算机毕业设计选题推荐-超市售货微信小程序/安卓APP-项目实战
  • Azure 机器学习 - 使用 Visual Studio Code训练图像分类 TensorFlow 模型
  • Vue 创建自定义 ref 函数
  • [2016-2018]phpstudy的exp制作
  • 服务器数据恢复—Zfs文件系统下文件被误删除的如何恢复数据?
  • 关于嵌入式rtthread系统与单片机芯片
  • 在Ubuntu上安装Redis并学习使用get、set和keys命令
  • Ubuntu更换镜像源
  • Sulfo-CY5 NHS荧光染料的生物应用2230212-27-6星戈瑞
  • Python Django 之模板继承详解(extends)
  • 混合式ANC主动降噪耳机系统设计(含C源代码)
  • Linux查看磁盘、内存、cpu信息
  • C语言 强制类型转换的各种代码示例
  • python 二维码使用
  • uniapp的启动页、开屏广告
  • 基于人工势场法的航线规划
  • 在紫光同创盘古50K开发板上进行DDR读写测试
  • MySQL BinLog实战应用之二
  • Visual Studio Code 快 捷 键
  • 有色金属冶炼VR虚拟场景互动教学有何优势
  • Python将知网导出的endnote题录转为Refworks模式
  • 单元测试反射注解
  • Android 交叉编译openssl 、libxml2静态库
  • 神经网络气温预测
  • 体验SOLIDWORKS钣金切口工具增强 硕迪科技
  • (八)Flask之app.route装饰器函数的参数
  • ES6.8集群配置注意点