You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.2 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

LLM function calling 示例

功能介绍

安装

  1. clone 本项目
git clone http://1.14.96.249:3000/old-tom/llmFunctionCallDemo.git
  1. 创建虚拟环境
  • 这里使用的是pipenv,可以换成uv或者conda
  • python 版本为 3.10或以上稳定版即可
cd llmFunctionCallDemo clone的代码目录
pipenv install --python 3.10
  1. 安装依赖
pip install -r requirements.txt
  1. 向量库部署和初始化 (docker)
docker run --name marqo -it --privileged -p 8882:8882 --add-host host.docker.internal:host-gateway marqoai/marqo:latest

初始化:执行vector_db.py create_and_set_index()方法

测试:执行vector_db.py query_vector_db() 方法,参数为任意字符串

  1. 配置文件 env.toml
[base]
# 多轮对话历史存储类型memory内存
history_chat_store = 'memory'
# 相似度阈值
similarity_threshold = 0.93
# dev
dev = true
####### 模型配置 #######
[siliconflow]
# 硅基流动
# 密钥
api_key = ''
# 模型名称
model = ''
# API地址
base_url = ''
# 最大token数
max_tokens = 4096
# 温度系数
temperature = 0.6
# 是否流式返回
streaming = true

TestCase

TODO