chat

command
v1.164.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

A very, very basic chat client for `docker agent serve chat`.

PR #2510 (`feat: add docker agent serve chat command`) exposes any docker-agent agent through an OpenAI-compatible HTTP server. The whole point of that feature is that any tool already speaking OpenAI's /v1/chat/completions protocol can drive a docker-agent agent without custom integration. This example demonstrates exactly that: it uses the official github.com/openai/openai-go SDK, only repointed at the local chat server, to run an interactive REPL against an agent.

Prerequisites:

# Start an agent in chat mode (in another terminal):
./bin/docker-agent serve chat ./examples/42.yaml
# It listens on http://127.0.0.1:8083 by default.

Then run this client:

go run ./examples/chat
# or, to pin a specific agent in a multi-agent team:
go run ./examples/chat -model root
# or, to point at a different server:
go run ./examples/chat -base http://127.0.0.1:9090/v1

Type a message and press <Enter>. Type "exit" (or send EOF with ^D) to quit.

Jump to

Keyboard shortcuts

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