|
23 | 23 | from openai import OpenAI |
24 | 24 | import tiktoken |
25 | 25 | import requests |
26 | | -from ai_agent_toolbox import MarkdownParser, MarkdownPromptFormatter, Toolbox, FlatXMLParser, FlatXMLPromptFormatter |
| 26 | +from ai_agent_toolbox import Toolbox, XMLParser, XMLPromptFormatter |
27 | 27 | from .applydiff import apply_diff, parse_diff_per_file |
28 | 28 |
|
29 | 29 | VERBOSE = False |
@@ -348,8 +348,8 @@ def call_llm_for_diff(system_prompt, user_prompt, files_content, model, temperat |
348 | 348 | reset = "\033[0m" |
349 | 349 | start_time = time.time() |
350 | 350 |
|
351 | | - parser = MarkdownParser() |
352 | | - formatter = MarkdownPromptFormatter() |
| 351 | + parser = XMLParser() |
| 352 | + formatter = XMLPromptFormatter() |
353 | 353 | toolbox = create_diff_toolbox() |
354 | 354 | #tool_prompt = formatter.usage_prompt(toolbox) |
355 | 355 | tool_prompt="""Save the calculated diff as used in 'git apply'. Should include the file and line number. For example: |
@@ -616,8 +616,8 @@ def colorize_warning_warning(message): |
616 | 616 | return f"\033[91m\033[1m{message}\033[0m" |
617 | 617 |
|
618 | 618 | def call_llm_for_apply_with_think_tool_available(file_path, original_content, file_diff, model, api_key=None, base_url=None, extra_prompt=None, max_tokens=30000): |
619 | | - parser = FlatXMLParser("think") |
620 | | - formatter = FlatXMLPromptFormatter(tag="think") |
| 619 | + parser = XMLParser("think") |
| 620 | + formatter = XMLPromptFormatter(tag="think") |
621 | 621 | toolbox = create_think_toolbox() |
622 | 622 | full_response = call_llm_for_apply(file_path, original_content, file_diff, model, api_key=api_key, base_url=base_url, extra_prompt=extra_prompt, max_tokens=max_tokens) |
623 | 623 | full_response, reasoning = swallow_reasoning(full_response) |
|
0 commit comments