Skip to content

Commit

Permalink
Send the include/exclude settings back to the front-end
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclotruc committed Dec 15, 2024
1 parent 7ed4f61 commit d7645e4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def should_include(path: str, base_path: str, include_patterns: List[str]) -> bo
for pattern in include_patterns:
if fnmatch(rel_path, pattern):
include = True
else:
include = False


return include

def should_exclude(path: str, base_path: str, ignore_patterns: List[str]) -> bool:
Expand Down
6 changes: 5 additions & 1 deletion src/process_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ async def process_query(request: Request, input_text: str, slider_position: int,
"error_message": f"Error: {e}",
"examples": EXAMPLE_REPOS if is_index else [],
"default_file_size": slider_position,
"pattern_type": pattern_type,
"pattern": pattern,
}
)

Expand All @@ -46,6 +48,8 @@ async def process_query(request: Request, input_text: str, slider_position: int,
"content": content,
"examples": EXAMPLE_REPOS if is_index else [],
"ingest_id": query['id'],
"default_file_size": slider_position,
"default_file_size": slider_position,
"pattern_type": pattern_type,
"pattern": pattern,
}
)
5 changes: 3 additions & 2 deletions src/templates/components/github_form.jinja.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<select id="pattern_type"
name="pattern_type"
class="w-21 py-2 pl-2 pr-6 appearance-none bg-gray-100 focus:outline-none border-r-[3px] border-gray-900">
<option value="exclude" selected>Exclude</option>
<option value="include">Include</option>
<option value="exclude" {% if pattern_type == 'exclude' or not pattern_type %}selected{% endif %}>Exclude</option>
<option value="include" {% if pattern_type == 'include' %}selected{% endif %}>Include</option>
</select>
<svg class="absolute right-2 w-4 h-4 pointer-events-none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 12 15 18 9"/>
Expand All @@ -45,6 +45,7 @@
id="pattern"
name="pattern"
placeholder="*.md, src/ "
value="{{ pattern if pattern else '' }}"
class=" py-2 px-2 bg-[#FFFDF8] focus:outline-none w-full">
</div>
</div>
Expand Down

0 comments on commit d7645e4

Please sign in to comment.