|
TT Client Library 1.0.0
C++ library for Tandem Tales clients.
|
This library provides the abstract classes tt::Client and tt::ClientFactory for implementing Tandem Tales agents in C++.
tt::Client handles connecting to the server and joining a session. A minimal subclass of tt::Client only needs to implement the tt::Client::onChoice method to choose what the agent will do on its turn.
tt::ClientFactory continuously creates new clients to connect to the server and wait for partners. A minimal subclass of tt::ClientFactory only needs to implement the tt::ClientFactory::create method to return a new Client instance.
Here is an example client and factory:
Both classes have other lifecycle methods that are meant to be overridden.
tt::Client has the following lifecycle methods:
tt::ClientFactory has the following lifecycle methods:
tt::Client also provides a way to call an external API for expensive operations like text embedding and text completion. It does so through its tt::Client::external member variable.
This more complete example shows you everything you need to download and run a Tandem Tales server and connect a custom C++ agent.