(self)
| 326 | st.dict(msg) |
| 327 | |
| 328 | def initialize_state(self): |
| 329 | messages = [ |
| 330 | dict(role="info", content=self.announce()), |
| 331 | dict(role="assistant", content="How can I help you?"), |
| 332 | ] |
| 333 | |
| 334 | self.state.init("messages", messages) |
| 335 | self.state.init("last_aider_commit_hash", self.coder.last_aider_commit_hash) |
| 336 | self.state.init("last_undone_commit_hash") |
| 337 | self.state.init("recent_msgs_num", 0) |
| 338 | self.state.init("web_content_num", 0) |
| 339 | self.state.init("prompt") |
| 340 | self.state.init("scraper") |
| 341 | |
| 342 | self.state.init("initial_inchat_files", self.coder.get_inchat_relative_files()) |
| 343 | |
| 344 | if "input_history" not in self.state.keys: |
| 345 | input_history = list(self.coder.io.get_input_history()) |
| 346 | seen = set() |
| 347 | input_history = [x for x in input_history if not (x in seen or seen.add(x))] |
| 348 | self.state.input_history = input_history |
| 349 | self.state.keys.add("input_history") |
| 350 | |
| 351 | def button(self, args, **kwargs): |
| 352 | "Create a button, disabled if prompt pending" |
no test coverage detected