mirror of
https://github.com/hwchase17/langchain
synced 2024-10-29 17:07:25 +00:00
628e93a9a0
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. |
||
---|---|---|
.. | ||
camel_role_playing.ipynb | ||
characters.ipynb | ||
two_player_dnd.ipynb |