Skip to content

Moderating a conversation (LLMs and humans)

Vivian Tsai edited this page Oct 4, 2024 · 2 revisions

In this group chat, there is a LLM-based "Mediator" tasked with keeping the conversation on topic, and Mr. Ratburn, an experimenter.

image

LLM agents

Setting up an agent

  1. Go to ⚙️ Settings > Add a Gemini API key.
  2. Create a new experiment. Add a "Chat" stage.
  3. Add a "mediator," any LLM agent you'd like to participate in the conversation.

Mediator configuration for chat

Here, we enable JSON parsing, which allows us to extract an additional explanation from the API. This is rendered below the mediator's responses in the screenshot above.

Without JSON parsing, you could do a prompt like:

Chime in if you think that the conversation is not about apples, to steer the conversation to apples. Otherwise, return with an empty string.

You can add as many agents as you'd like. Agents are called after every update to the conversation. If multiple agents would like to respond at the same time, one will be chosen randomly.

Experimenter moderation

When previewing and monitoring an experiment, experimenters have access to an experimenter-only panel on the right.

Manual chat

Use the "manual chat" tab to directly interact with the participants.

Manual chat message sent to participants

API key

Use the "API key" tab to update your Gemini API key.

LLM config

Use the "LLM config" tab to update your mediator prompt(s); if you click "Save," your old prompt will be overwritten, and the new prompt will be used for all mediator responses moving forward (note that this will update across all your experiments).

NOTE: If the mediator repeatedly fails to respond, it may be due to a JSON parsing error. Try troubleshooting by adjusting the prompt or changing the prompt to non-JSON (where all non-empty string responses become chat messages).

Debug mode

Experimenters can also toggle "debug mode" (top right corner of the top banner) to view mediator response explanations (if JSON is enabled) in chat.

Chat mediation debug mode