auto-coder 0.1.195__py3-none-any.whl → 0.1.197__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of auto-coder might be problematic. Click here for more details.

@@ -11,6 +11,9 @@ from autocoder.common.search import Search, SearchEngine
11
11
  from loguru import logger
12
12
  import re
13
13
  from pydantic import BaseModel, Field
14
+ from rich.console import Console
15
+ import json
16
+ from autocoder.utils.queue_communicate import queue_communicate, CommunicateEvent, CommunicateEventType
14
17
 
15
18
 
16
19
  class RegPattern(BaseModel):
@@ -163,7 +166,7 @@ class TSProject:
163
166
  return SourceCode(module_name=module_name, source_code=source_code)
164
167
 
165
168
  def get_source_codes(self) -> Generator[SourceCode, None, None]:
166
- for root, dirs, files in os.walk(self.directory):
169
+ for root, dirs, files in os.walk(self.directory,followlinks=True):
167
170
  dirs[:] = [d for d in dirs if d not in self.default_exclude_dirs]
168
171
  for file in files:
169
172
  file_path = os.path.join(root, file)
@@ -188,11 +191,37 @@ class TSProject:
188
191
  def get_rag_source_codes(self):
189
192
  if not self.args.enable_rag_search and not self.args.enable_rag_context:
190
193
  return []
194
+
195
+ if self.args.request_id and not self.args.skip_events:
196
+ _ = queue_communicate.send_event(
197
+ request_id=self.args.request_id,
198
+ event=CommunicateEvent(
199
+ event_type=CommunicateEventType.CODE_RAG_SEARCH_START.value,
200
+ data=json.dumps({},ensure_ascii=False)
201
+ )
202
+ )
203
+ else:
204
+ console = Console()
205
+ console.print(f"\n[bold blue]Starting RAG search for:[/bold blue] {self.args.query}")
206
+
191
207
  from autocoder.rag.rag_entry import RAGFactory
192
208
  rag = RAGFactory.get_rag(self.llm, self.args, "")
193
209
  docs = rag.search(self.args.query)
194
210
  for doc in docs:
195
211
  doc.tag = "RAG"
212
+
213
+ if self.args.request_id and not self.args.skip_events:
214
+ _ = queue_communicate.send_event(
215
+ request_id=self.args.request_id,
216
+ event=CommunicateEvent(
217
+ event_type=CommunicateEventType.CODE_RAG_SEARCH_END.value,
218
+ data=json.dumps({},ensure_ascii=False)
219
+ )
220
+ )
221
+ else:
222
+ console = Console()
223
+ console.print(f"[bold green]Found {len(docs)} relevant documents[/bold green]")
224
+
196
225
  return docs
197
226
 
198
227
  @byzerllm.prompt()
@@ -11,11 +11,19 @@ class CommunicateEventType(Enum):
11
11
  CODE_MERGE = "code_merge"
12
12
  CODE_GENERATE = "code_generate"
13
13
  CODE_MERGE_RESULT = "code_merge_result"
14
+ CODE_UNMERGE_RESULT = "code_unmerge_result"
14
15
  CODE_START = "code_start"
15
16
  CODE_END = "code_end"
16
17
  CODE_HUMAN_AS_MODEL = "code_human_as_model"
17
18
  ASK_HUMAN = "ask_human"
18
19
  CODE_ERROR = "code_error"
20
+ CODE_INDEX_BUILD_START = "code_index_build_start"
21
+ CODE_INDEX_BUILD_END = "code_index_build_end"
22
+ CODE_INDEX_FILTER_START = "code_index_filter_start"
23
+ CODE_INDEX_FILTER_END = "code_index_filter_end"
24
+ CODE_INDEX_FILTER_FILE_SELECTED = "code_index_filter_file_selected"
25
+ CODE_RAG_SEARCH_START = "code_rag_search_start"
26
+ CODE_RAG_SEARCH_END = "code_rag_search_end"
19
27
 
20
28
  TIMEOUT = 600*3
21
29
  @dataclass(eq=True, frozen=True)
autocoder/utils/rest.py CHANGED
@@ -120,7 +120,7 @@ class HttpDoc:
120
120
  return temp_documents
121
121
 
122
122
  if os.path.isdir(url):
123
- for root, dirs, files in os.walk(url):
123
+ for root, dirs, files in os.walk(url,followlinks=True):
124
124
  dirs[:] = [d for d in dirs if d not in ['.git',"node_modules"]] # Exclude .git directory
125
125
  for file in files:
126
126
  file_path = os.path.join(root, file)
autocoder/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.195"
1
+ __version__ = "0.1.197"