|
4 | 4 | AGENT_TIDE_SYSTEM_PROMPT, GET_CODE_IDENTIFIERS_SYSTEM_PROMPT, WRITE_PATCH_SYSTEM_PROMPT |
5 | 5 | ) |
6 | 6 | from .consts import AGENT_TIDE_ASCII_ART |
7 | | -from .utils import parse_xml_content |
| 7 | +from .utils import parse_patch_blocks |
8 | 8 |
|
9 | 9 | try: |
10 | 10 | from aicore.llm import Llm |
|
20 | 20 | from pydantic import BaseModel |
21 | 21 | from typing import Optional |
22 | 22 | from datetime import date |
23 | | -from tqdm import tqdm |
24 | 23 | import asyncio |
25 | 24 | import os |
26 | 25 |
|
@@ -66,24 +65,15 @@ async def agent_loop(self): |
66 | 65 | prefix_prompt=codeContext |
67 | 66 | ) |
68 | 67 |
|
69 | | - diffPatches = parse_xml_content(response, multiple=True) |
| 68 | + diffPatches = parse_patch_blocks(response, multiple=True) |
70 | 69 | if diffPatches: |
71 | | - diffPatches = [diffPatch.replace("\'", "'") for diffPatch in diffPatches] |
72 | | - diffPatches = [diffPatch.replace('\"', '"') for diffPatch in diffPatches] |
73 | | - for diffPatch in tqdm(diffPatches): |
74 | | - process_patch(diffPatch, open_file, write_file, remove_file, file_exists) |
| 70 | + |
| 71 | + for patch in diffPatches: |
| 72 | + patch = patch.replace("\'", "'").replace('\"', '"') |
| 73 | + process_patch(patch, open_file, write_file, remove_file, file_exists) |
| 74 | + |
75 | 75 |
|
76 | 76 | await self.tide.check_for_updates(serialize=True, include_cached_ids=True) |
77 | | - |
78 | | - # else: |
79 | | - # response = await self.llm.acomplete( |
80 | | - # self.history, |
81 | | - # system_prompt=[ |
82 | | - # AGENT_TIDE_SYSTEM_PROMPT.format(DATE=TODAY), |
83 | | - # ASSISTANT_SYSTEM_PROMPT.format(DATE=TODAY) |
84 | | - # ], |
85 | | - # prefix_prompt=repo_tree |
86 | | - # ) |
87 | 77 |
|
88 | 78 | self.history.append(response) |
89 | 79 |
|
|
0 commit comments