r"""Performs one step of the conversation by displaying options to the user, getting their input, and parsing their choice. Args: messages (Sequence[BaseMessage]): A list of BaseMessage objects. Returns: ChatAgentResponse: A `ChatAgentResponse` objec
(
self, messages: Sequence[BaseMessage]
)
| 113 | return content |
| 114 | |
| 115 | def reduce_step( |
| 116 | self, messages: Sequence[BaseMessage] |
| 117 | ) -> ChatAgentResponse: |
| 118 | r"""Performs one step of the conversation by displaying options to the |
| 119 | user, getting their input, and parsing their choice. |
| 120 | |
| 121 | Args: |
| 122 | messages (Sequence[BaseMessage]): A list of BaseMessage objects. |
| 123 | |
| 124 | Returns: |
| 125 | ChatAgentResponse: A `ChatAgentResponse` object representing the |
| 126 | user's choice. |
| 127 | """ |
| 128 | meta_chat_message = BaseMessage( |
| 129 | role_name=messages[0].role_name, |
| 130 | role_type=messages[0].role_type, |
| 131 | meta_dict=messages[0].meta_dict, |
| 132 | content="", |
| 133 | ) |
| 134 | self.display_options(messages) |
| 135 | human_input = self.get_input() |
| 136 | content = self.parse_input(human_input) |
| 137 | message = meta_chat_message.create_new_instance(content) |
| 138 | return ChatAgentResponse(msgs=[message], terminated=False, info={}) |
nothing calls this directly
no test coverage detected