HumanLayer 今日发布
为AI代理注入人类审批工作流
产品简介
<div align="center">
</div>
HumanLayer: A python toolkit to enable AI agents to communicate with humans in tool-based and asynchronous workflows. By incorporating humans-in-the-loop, agentic tools can be given access to much more powerful and meaningful tool calls and tasks.
Bring your LLM (OpenAI, Llama, Claude, etc) and Framework (LangChain, CrewAI, etc) and start giving your AI agents safe access to the world.
<div align="center">
<h3>
Homepage | Get Started | Discord | Documentation | Examples
</h3>
</div>
**Table of contents
- Getting Started
- Why HumanLayer?
- Key Features
- Examples
- Roadmap
- Contributing
- License
**Getting Started
To get started, check out Getting Started, watch the Getting Started Video, or jump straight into one of the Examples:
- 🦜⛓️ LangChain
- 🚣 CrewAI
- 🦾 ControlFlow
- 🧠 Raw OpenAI Client
<div align="center"> <a target="_blank" href="https://www.loom.com/share/7c65d48d18d1421a864a1591ff37e2bf"><img width="60%" alt="video thumbnail showing editor" src="./docs/images/video-thumb.png"></a> </div>
**Example
pip install humanlayer
from humanlayer import HumanLayer
hl = HumanLayer()
@hl.require_approval()
def send_email(to: str, subject: str, body: str):
"""Send an email to the customer"""
...
**made up function, use whatever
**tool-calling framework you prefer
run_llm_task(
prompt="""Send an email welcoming the customer to
the platform and encouraging them to invite a team member.""",
tools=[send_email],
llm="gpt-4o"
)
<div align="center"><img style="width: 400px" alt="A screenshot of slack showing a human replying to the bot" src="./docs/images/slack_approval_response.png"></div>
Check out the framework specific examples or the Getting Started Guide to get hands on.
**Human as Tool
You can also use hl.human_as_tool() to bring a human into the loop for any reason. This can be useful for debugging, asking for advice, or just getting a human's opinion on something.
**human_as_tool.py
from humanlayer import HumanLayer
hl = HumanLayer()
contact_a_human = hl.human_as_tool()
def send_email(to: str, subject: str, body: str):
"""Send an email to the customer"""
...
**made up method, use whatever
**framework you prefer
run_llm_task(
prompt="""Send an email welcoming the customer to
the platform and encouraging them to invite a team member.
Contact a human for collaboration and feedback on your email
draft
""",
tools=[send_email, contact_a_human],
llm="gpt-4o"
)
See the examples for more advanced human as tool examples, and workflows that combine both concepts.
**Why HumanLayer?
Functions and tools are a key part of Agentic Workflows. They enable LLMs to interact meaningfully with the outside world and automate broad scopes of impactful work. Correct and accurate function calling is essential for AI a。
评论与建议
登录 后参与评论或提建议