Install

Usage

import 'dotenv/config'

import { createDexterFunctions } from '@agentic/dexter'
import { WeatherClient } from '@agentic/weather'
import { ChatModel, createAIRunner } from '@dexaai/dexter'

async function main() {
  const weather = new WeatherClient()

  const runner = createAIRunner({
    chatModel: new ChatModel({
      params: { model: 'gpt-4o-mini', temperature: 0 }
      // debug: true
    }),
    functions: createDexterFunctions(weather),
    systemMessage: 'You are a helpful assistant. Be as concise as possible.'
  })

  const result = await runner('What is the weather in San Francisco?')
  console.log(result)
}

await main()

Running this example

You’ll need a free API key from weatherapi.com to run this example. Store it in a local .env file as WEATHER_API_KEY.

You’ll need an OpenAI API key to run this example. Store it in a local .env file as OPENAI_API_KEY.

git clone git@github.com:transitive-bullshit/agentic.git
cd agentic
pnpm install
echo 'WEATHER_API_KEY=your-key' >> .env
echo 'OPENAI_API_KEY=your-key' >> .env
npx tsx examples/dexter/bin/weather.ts