Skip to content

ViktorQvarfordt/LLM-Agent-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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! 🎵❄️

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published