AssistantAgent and
RetrieveUserProxyAgent, which is similar to the usage of
AssistantAgent and UserProxyAgent in other notebooks (e.g.,
Automated Task Solving with Code Generation, Execution &
Debugging).
Essentially, RetrieveUserProxyAgent implement a different auto-reply
mechanism corresponding to the RetrieveChat prompts.
Table of Contents
We’ll demonstrate six examples of using RetrieveChat for code generation and question answering:Some extra dependencies are needed for this notebook, which can be installed via pip:For more information, please refer to the installation guide.
Set your API Endpoint
Construct agents for RetrieveChat
We start by initializing theAssistantAgent and
RetrieveUserProxyAgent. The system message needs to be set to “You are
a helpful assistant.” for AssistantAgent. The detailed instructions are
given in the user message. Later we will use the
RetrieveUserProxyAgent.message_generator to combine the instructions
and a retrieval augmented generation task for an initial prompt to be
sent to the LLM assistant.