langchain-weather-demo

command
v0.5.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

LangChain-Style Weather Tool (Automatic)

A minimal example showing LangChain-like simplicity in AgenticGoKit.

Quick Start

cd examples/langchain-weather-demo
# Make sure ollama is running and model available
# ollama pull gemma3:1b
GO111MODULE=on go run .

What it does

  • Defines a single tool check_weather
  • Registers it via RegisterInternalTool
  • Builds an agent with WithPreset(vnext.ChatAgent) so tools are auto-used
  • Runs a couple of queries; agent decides when to call the tool

Code highlights

  • Tool: WeatherTool implements Name, Description, Execute
  • Registration: in init() with RegisterInternalTool
  • Agent: built with WithPreset (no custom handler needed)

Files

  • main.go — everything in one file

Change model/provider

Update in main.go:

LLM: vnext.LLMConfig{
    Provider: "ollama", // change if needed
    Model:    "gemma3:1b",
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL