Пожалуйста, включите JavaScript.
Главная
Обзор
Помощь
Регистрация
Вход
OpenSource
/
ragflow
Следить
4
В избранное
0
Форкнуть
0
Код
Задачи
0
Pull Request'ы
0
Релизы
33
Вики
Активность
Вы не можете выбрать более 25 тем
Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
2986
коммитов
7
Ветки
Дерево:
a1f06a4fdc
Hacked_v0.15.1
Hacked_v0.16.0
Hacked_v0.17.2
Hacked_v0.18.0
Hacked_v0.19.0
Hacked_v0.20.4
main
v0.20.4
v0.20.3
v0.20.2
v0.20.1
v0.20.0
v0.19.1
v0.19.0
v0.18.0
v0.17.2
v0.17.1
v0.17.0
v0.16.0
v0.15.1
v0.15.0
v0.14.1
v0.14.0
v0.13.0
v0.12.0
v0.11.0
v0.10.0
v0.9.0
v0.8.0
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.2
v0.3.1
v0.3.0
v0.2.0
v0.1.0
v0.19.x
nightly
Ветки
Теги
${ item.name }
Создать ветку
${ searchTerm }
из 'a1f06a4fdc'
${ noResults }
ragflow
/
plugin
/
__init__.py
__init__.py
81B
Исходник
Normal View
История
Feat: Support tool calling in Generate component (#7572) ### What problem does this PR solve? Hello, our use case requires LLM agent to invoke some tools, so I made a simple implementation here. This PR does two things: 1. A simple plugin mechanism based on `pluginlib`: This mechanism lives in the `plugin` directory. It will only load plugins from `plugin/embedded_plugins` for now. A sample plugin `bad_calculator.py` is placed in `plugin/embedded_plugins/llm_tools`, it accepts two numbers `a` and `b`, then give a wrong result `a + b + 100`. In the future, it can load plugins from external location with little code change. Plugins are divided into different types. The only plugin type supported in this PR is `llm_tools`, which must implement the `LLMToolPlugin` class in the `plugin/llm_tool_plugin.py`. More plugin types can be added in the future. 2. A tool selector in the `Generate` component: Added a tool selector to select one or more tools for LLM:  And with the `bad_calculator` tool, it results this with the `qwen-max` model:  ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [ ] Refactoring - [ ] Performance Improvement - [ ] Other (please describe): Co-authored-by: Yingfeng <yingfeng.zhang@gmail.com>
5 месяцев назад
1
2
3
from .plugin_manager import PluginManager
GlobalPluginManager = PluginManager()