YoMo LLM Function Calling Examples

June 18, 2026 ยท View on GitHub

This repository contains TypeScript and Go examples for YoMo LLM function calling.

Examples are grouped by language:

  • ts/: TypeScript tools
  • go/: Go tools

Each example exports a description, typed arguments, and a handler that YoMo can expose as an LLM callable tool.

Examples

Weather and Location

ExampleLanguageDescription
get-weatherTypeScriptGet current weather by city and coordinates with OpenWeatherMap.
get-weather-google-apiTypeScriptGet current weather for an address with Google Geocoding and Weather APIs.
get-weatherGoGet current weather by city and coordinates with OpenWeatherMap.
get-utc-timeTypeScriptReturn the current UTC time.
get-utc-timeGoReturn the current UTC time.
timezone-calculatorGoConvert a time between IANA time zones.

Finance and Data

ExampleLanguageDescription
currency-converterTypeScriptConvert USD to another currency with ExchangeRate API.
currency-converterGoConvert USD to another currency with Open Exchange Rates.

Web Search and Network

ExampleLanguageDescription
exa-web-searchTypeScriptSearch the web with Exa.
google-web-searchTypeScriptSearch with Google Custom Search and extract page content.
tavily-web-searchTypeScriptSearch current web content with Tavily.
duckduckgo-web-searchTypeScriptSearch current web content with DuckDuckGo.
get-ip-and-latencyTypeScriptResolve a domain and measure latency.
get-ip-and-latencyGoResolve a domain and measure latency with ping.

Communication

ExampleLanguageDescription
autosendTypeScriptSend text, HTML, or template email with AutoSend.
send-mail-smtpTypeScriptSend email with SMTP and nodemailer.
send-mail-resendTypeScriptSend email with Resend.
send-mail-smtpGoSend email with SMTP.
send-mail-resendGoSend email with Resend.

Database

ExampleLanguageDescription
postgres-dbTypeScriptQuery and manage PostgreSQL tables.

YoMo Usage

1. Install YoMo CLI

curl -fsSL https://get.yomo.run | sh

Detailed CLI usage is available in the YoMo CLI documentation: https://yomo.run/docs/cli

2. Configure the LLM Bridge

Create a yomo.yml file:

zipper:
  host: "127.0.0.1"
  port: 9000
  tls: {}

http_api:
  host: "127.0.0.1"
  port: 9001
  enable_tool_api: false

llm_providers:
  - type: "openai-compatible"
    model_id: "gpt-5.4-nano"
    default: true
    params:
      model: "gpt-5.4-nano"
      api_key: "<YOUR_API_KEY>"
      base_url: "https://api.openai.com/v1"

3. Start the LLM Bridge

Run this from the directory that contains yomo.yml:

yomo serve -c ./yomo.yml

4. Run a Function

Open another terminal, enter one example directory, set any environment variables required by that example, and run it:

cd ts/get-weather
OPENWEATHERMAP_API_KEY=<your-openweathermap-api-key> yomo run -n get-weather

For Go examples, use the same pattern:

cd go/get-weather
OPENWEATHERMAP_API_KEY=<your-openweathermap-api-key> yomo run -n get-weather

Each subdirectory README lists only the environment variables required by that specific example.

5. Send a Chat Completion Request

Call the local HTTP API exposed by yomo serve:

curl http://127.0.0.1:9001/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {
        "role": "user",
        "content": "Is it raining in Paris and Sydney?"
      }
    ]
  }'

YoMo routes the request to the LLM provider, exposes the running functions as tools, invokes the matching function, and returns the final assistant response.

Function Shape

TypeScript examples use this shape:

export const description = 'Get current weather for a city'

export type Argument = {
  city: string
  latitude: number
  longitude: number
}

export async function handler(args: Argument) {
  return weatherData
}

Go examples use this shape:

const Description = "Get current weather for a city"

type Arguments struct {
	City      string  `json:"city"`
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type Result struct {
	Weather any `json:"weather"`
}

func Handler(args Arguments) (Result, error) {
	return Result{Weather: weatherData}, nil
}