Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 1.22 KB

README.md

File metadata and controls

39 lines (25 loc) · 1.22 KB

LLM Agent Demo

Agent = LLM + State + Tools

See this article for an overview of LLM agents.

Run code

This demo agent is a terminal-based chat interface to an agent that has some basic tools/actions.

Setup

  1. Clone the repo: https://github.com/ViktorQvarfordt/LLM-Agent-Demo
  2. Make sure you have node ≥18 and pnpm installed
  3. Run pnpm install
  4. Get an OpenAI API key: https://platform.openai.com/api-keys

Start

OPENAI_API_KEY='OMITTED' pnpm start

Example output

> Play music that fits the mood of the weather

<< Agent requests function calls: [ getCurrentLocation({}) ]
>> Submitting function outputs: [ "Stockholm, SE" ]

<< Agent requests function calls: [ getCurrentWeather({"location":"Stockholm, SE"}) ]
>> Submitting function outputs: [ "🌨  -7°C" ]

<< Agent requests function calls: [ playMusic({"songName":"Winter Winds","artistName":"Mumford & Sons"}) ]
>> Submitting function outputs: [ "Playing Winter Winds by Mumford & Sons" ]

< I've set "Winter Winds" by Mumford & Sons to play, which should match the chilly and snowy mood of the weather in Stockholm. Enjoy the music! 🎵❄️