File tree 3 files changed +2
-10
lines changed
codegate_context_retriever
3 files changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ def get_last_user_message_block(
231
231
user_messages .append (txt )
232
232
last_idx = idx
233
233
234
- if user_messages == [] :
234
+ if not user_messages :
235
235
return None
236
236
return "\n " .join (reversed (user_messages )), last_idx
237
237
Original file line number Diff line number Diff line change @@ -136,9 +136,6 @@ async def process( # noqa: C901
136
136
137
137
logger .info (f"Adding { len (all_bad_packages )} bad packages to the context." )
138
138
139
- # Generate context string using the searched objects
140
- context_str = "CodeGate did not find any malicious or archived packages."
141
-
142
139
# Nothing to do if no bad packages are found
143
140
if len (all_bad_packages ) == 0 :
144
141
return PipelineResult (request = request , context = context )
Original file line number Diff line number Diff line change 24
24
CopilotPipeline ,
25
25
)
26
26
from codegate .providers .copilot .streaming import SSEProcessor
27
- from codegate .types .common import (
28
- Delta ,
29
- ModelResponse ,
30
- StreamingChoices ,
31
- )
32
27
from codegate .types .openai import StreamingChatCompletion
33
28
34
29
setup_logging ()
@@ -239,7 +234,7 @@ async def _body_through_pipeline(
239
234
path : str ,
240
235
headers : list [str ],
241
236
body : bytes ,
242
- ) -> Tuple [bytes , PipelineContext ]:
237
+ ) -> Tuple [bytes , PipelineContext | None ]:
243
238
strategy = self ._select_pipeline (method , path )
244
239
if len (body ) == 0 or strategy is None :
245
240
# if we didn't select any strategy that would change the request
You can’t perform that action at this time.
0 commit comments