Refactor imports and remove duplicate code in main.py

This commit is contained in:
bobo 2024-05-11 16:51:53 +08:00
parent 1b4540a7a8
commit 13ac7c466a
3 changed files with 6 additions and 7 deletions

View File

@ -2,6 +2,7 @@ import os
import re
import sys
from lib.ide_service import IDEService
from devchat.llm import chat
from devchat.memory import FixSizeChatMemory
@ -34,7 +35,7 @@ To add comments, you need to follow the following rules:
5. don't change string value in code block;
there are a examples with correct outputs:
input:
input:
file: a1.py
```
# print("hello")
@ -191,8 +192,6 @@ file: t2.ts
},
]
from lib.ide_service import IDEService
def get_selected_code():
"""Retrieves the selected lines of code from the user's selection."""

View File

@ -2,6 +2,8 @@ import os
import re
import sys
from lib.ide_service import IDEService
from devchat.llm import chat
from devchat.memory import FixSizeChatMemory
@ -142,8 +144,6 @@ def content_to_json(content):
},
]
from lib.ide_service import IDEService
def get_selected_code():
"""

View File

@ -2,8 +2,8 @@ import os
import re
import sys
from devchat.ide.service import IDEService
from devchat.ide.vscode_services import selected_lines, visible_lines
from lib.ide_service import IDEService
from devchat.llm import chat
from devchat.memory import FixSizeChatMemory