Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: simplification of two agent d&d simulation (langchain-ai#3550)
Simplifies the [Two Agent D&D](https://python.langchain.com/en/latest/use_cases/agent_simulations/two_player_dnd.html) example with a cleaner, simpler interface that is extensible for multiple agents. `DialogueAgent`: - `send()`: applies the chatmodel to the message history and returns the message string - `receive(name, message)`: adds the `message` spoken by `name` to message history The `DialogueSimulator` class takes a list of agents. At each step, it performs the following: 1. Select the next speaker 2. Calls the next speaker to send a message 3. Broadcasts the message to all other agents 4. Update the step counter. The selection of the next speaker can be implemented as any function, but in this case we simply loop through the agents.
- Loading branch information