Skip to content

monks1975/function-calling-llm-patterns

Repository files navigation

Examples of LLM function calling

A collection of example patterns + implementations for function calling with Large Language Models (LLMs).

Quick Start

  1. Clone and install:
git clone https://github.com/yourusername/openai-node-tool-calls.git
cd openai-node-tool-calls
npm install
  1. Configure environment:
cp .env.example .env
# Edit .env with your API keys
  1. Run any example:
# ReAct pattern CLI
npm run react-cli

# ReWOO pattern CLI
npm run plan-cli

Example Modules

1. ReAct Pattern (src/react/)

  • Implements the ReAct (Reasoning and Acting) pattern
  • Interactive CLI and API server
  • Real-time streaming of thoughts and actions
  • Built-in error recovery and content moderation

2. ReWOO Pattern (src/rewoo/)

  • Implements the ReWOO (Reasoning Without Observation) pattern
  • Focuses on planning and execution phases
  • Efficient for complex multi-step tasks
  • Built-in progress tracking and optimization

Requirements

  • Node.js v18 or higher
  • npm or yarn
  • API keys for supported LLM providers (OpenAI, Anthropic, etc.)

License

ISC License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published