FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cecli/cecli/coders/context_coder.py at main · cecli-dev/cecli · GitHub
cecli-dev
cecli
Repository navigation
Code
Issues
11
(11)
Pull requests
8
(8)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cecli
/
cecli
/
coders
/
context_coder.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
52 lines (36 loc) · 1.49 KB
Breadcrumbs
cecli
/
cecli
/
coders
/
context_coder.py
Copy path
File metadata and controls
52 lines (36 loc) · 1.49 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from
.
base_coder
import
Coder
class
ContextCoder
(
Coder
):
"""Identify which files need to be edited for a given request."""
edit_format
=
"context"
prompt_format
=
"context"
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
().
__init__
(
*
args
,
**
kwargs
)
if
not
self
.
repo_map
:
return
self
.
repo_map
.
refresh
=
"always"
self
.
repo_map
.
max_map_tokens
*=
self
.
repo_map
.
map_mul_no_files
self
.
repo_map
.
map_mul_no_files
=
1.0
async
def
reply_completed
(
self
):
content
=
self
.
partial_response_content
if
not
content
or
not
content
.
strip
():
return
True
# dump(repr(content))
current_rel_fnames
=
set
(
self
.
get_inchat_relative_files
())
mentioned_rel_fnames
=
set
(
self
.
get_file_mentions
(
content
,
ignore_current
=
True
))
# dump(current_rel_fnames)
# dump(mentioned_rel_fnames)
# dump(current_rel_fnames == mentioned_rel_fnames)
if
mentioned_rel_fnames
==
current_rel_fnames
:
return
True
if
self
.
num_reflections
>=
self
.
max_reflections
-
1
:
return
True
self
.
abs_fnames
=
set
()
for
fname
in
mentioned_rel_fnames
:
self
.
add_rel_fname
(
fname
)
# dump(self.get_inchat_relative_files())
self
.
reflected_message
=
self
.
gpt_prompts
.
try_again
# mentioned_idents = self.get_ident_mentions(cur_msg_text)
# if mentioned_idents:
return
True
def
check_for_file_mentions
(
self
,
content
):
pass
Back
|
FazBrowse Home
|
New Git URL