| 1759 | return mentioned_rel_fnames |
| 1760 | |
| 1761 | def check_for_file_mentions(self, content): |
| 1762 | mentioned_rel_fnames = self.get_file_mentions(content) |
| 1763 | |
| 1764 | new_mentions = mentioned_rel_fnames - self.ignore_mentions |
| 1765 | |
| 1766 | if not new_mentions: |
| 1767 | return |
| 1768 | |
| 1769 | added_fnames = [] |
| 1770 | group = ConfirmGroup(new_mentions) |
| 1771 | for rel_fname in sorted(new_mentions): |
| 1772 | if self.io.confirm_ask( |
| 1773 | "Add file to the chat?", subject=rel_fname, group=group, allow_never=True |
| 1774 | ): |
| 1775 | self.add_rel_fname(rel_fname) |
| 1776 | added_fnames.append(rel_fname) |
| 1777 | else: |
| 1778 | self.ignore_mentions.add(rel_fname) |
| 1779 | |
| 1780 | if added_fnames: |
| 1781 | return prompts.added_files.format(fnames=", ".join(added_fnames)) |
| 1782 | |
| 1783 | def send(self, messages, model=None, functions=None): |
| 1784 | self.got_reasoning_content = False |