mirror of
https://github.com/humanlayer/humanlayer.git
synced 2025-08-20 19:01:22 +03:00
Humanlayer Cookbooks and Examples
Basics and hello-world-y things
The most basic examples are:
- openai_client - basic example of HumanLayer using raw OpenAI client and function calling.
- langchain - basic langchain examples, includes the most complete set of examples including
human as toolandemailchannel features - controlflow - basic controlflow example
- crewai - basic crewai example
- fastapi - basic fastapi server showcasing
AsyncHumanLayerfor asyncio apps - curl - interact with the HumanLayer API using curl
More advanced examples
These examples include more end-to-end API examples, using webservers like flask and fastapi, and using some more advanced state management techniques.
- openai_client/03-imperative_fetch.py - showing how you can use lower-level SDK methods to interact with the HumanLayer API.
- fastapi-webhooks - fastapi server that leverage humanlayer webhooks (e.g. with ngrok locally) to fire-and-forget function calls, and handle human approval events as they are received
- fastapi-email - two end-to-end examples of a workflow designed to be initiated via email, where approvals and requests from the agents are sent as replies on the same email thread. Includes two versions:
- one where the fastapi server manages state
- one where the fastapi server leverages the
HumanLayerstate management to manage state
TypeScript examples
- ts_openai_client - basic example of HumanLayer using raw OpenAI client and function calling
- ts_vercel_ai_sdk - example showcasing HumanLayer + Vercel AI SDK
- ts_langchain - basic example of HumanLayer using LangchainJS
- ts_email_classifier - basic example of various classification/labeling workflows, using an llm to label emails and then providing sync or async mechanisms for human input on classifications