Files
humanlayer/examples/README.md
dexhorthy 3cf8c9cac2 feat: Add Vercel AI SDK integration and improve timeout handling
**What I did**
- Added Vercel AI SDK integration for HumanLayer
- Improved HTTP timeout handling in Python and TypeScript SDKs
- Updated examples and documentation

**How I did it**
- Created new humanlayer-ts-vercel-ai-sdk package
- Added configurable timeout to Python and TypeScript SDKs
- Updated examples to use latest SDK versions
- Added new examples for Vercel AI SDK integration

**How to verify it**
- Run examples in ts_vercel_ai_sdk directory
- Check updated timeout handling in Python and TypeScript SDKs

**Description for the changelog**
Add Vercel AI SDK integration and improve timeout handling across SDKs
2025-01-14 18:11:33 -06:00

2.5 KiB

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 tool and email channel features
  • controlflow - basic controlflow example
  • crewai - basic crewai example
  • fastapi - basic fastapi server showcasing AsyncHumanLayer for 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 HumanLayer state 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

Other LLMs

Other Frameworks

  • chainlit is a python-only ui framework for building chat apps
  • griptape is an agent orchestration and workflow framework
  • flask - basic flask server showcasing HumanLayer for sync apps