simonmesmith/agentflow
关于
Complex LLM Workflows from Simple JSON.
人工智能与机器学习实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- -1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Agentflow: Complex LLM Workflows from Simple JSON
Agentflow is a powerful yet user-friendly tool to run workflows powered by LLMs. You can:
- Write workflows in plain English in human-readable JSON files.
- Use variables for dynamic outputs that change based on user input.
- Build and execute custom functions to go beyond text generation.
Why Agentflow?
Agentflow fills the gap between chat and autonomous interfaces:
- Chat (e.g. ChatGPT) can't run workflows because they're conversational.
- Autonomous (e.g. Auto-GPT) run them unreliably because they have too much freedom.
Agentflow offers a balanced solution: Workflows that LLMs follow step-by-step.
Install and Use
Agentflow is currently in development. To try it:
- Sign up for the OpenAI API and get an API key
- Clone or download this repository.
- Create a
.envfile from example.env and add your OpenAI API key. - Run
pip install -r requirements.txtto install dependencies.
Now you can run flows from the command line, like this:
python -m run --flow=example
Optional Arguments
Use variables to pass variables to your flow
python -m run --flow=example_with_variables --variables 'market=college students' 'price_point=$50'
Use v (verbose) to see task completion in real-time
python -m run --flow=example -v
Create New Flows
Copy example.json or example_with_variables.json or create a flow from scratch in this format:
{
"system_message": "An optional message that guides the model's behavior.",
"tasks": [
{
"action": "Instruct the LLM here!"
},
{
"action": "Actions can have settings, including function calls and temperature, like so:",
"settings": {
"function_call": "save_file",
"temperature": 0.5
}
},
{
"action": "..."
}
]
}
Create New Functions
Copy save_file.py and modify it, or follow these instructions (replace "function_name" with your function name):
- Create
function_name.pyin the functions folder. - Create a class within called
FunctionNamethat inherits fromBaseFunction. - Add
get_definition()andexecute()in the class. See descriptions of these inBaseFunction.
That's it! You can now use your function in function_call as shown above. However, you should probably:
- Add tests in tests! Then you'll know if workflows are failing because of your function.
License
Agentflow is licensed under the MIT License.
探索相关项目
加载中…