Selecting and authenticating bot services
llm
with two config options, model
and messages
, as well as their associated handlers.
Bots can define one or more services to a particular function. For example, we may want to run a pipeline that can be switched between different LLM providers e.g. OpenAI, Together, Anthropic etc.
"llm"
OpenAILLMService
services
object at startup that can be used to specify which provider to use for the specified service name.
In the above above example, we can configure a RTVI client to use Together like so:
api_keys
object, mapping them to the relevant service account. Here is an example server-side route
using NextJS:
config
references the service name that it was registered with in your bot file.services
specifies which provider / service account to use for a specific name-matched service in the registry (in this case, llm
.)api_keys
provides a key matched to the service account.