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 @@ -132,9 +132,6 @@ async def process( # noqa: C901
132
132
133
133
logger .info (f"Adding { len (all_bad_packages )} bad packages to the context." )
134
134
135
- # Generate context string using the searched objects
136
- context_str = "CodeGate did not find any malicious or archived packages."
137
-
138
135
# Nothing to do if no bad packages are found
139
136
if len (all_bad_packages ) == 0 :
140
137
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 ()
@@ -236,7 +231,7 @@ async def _body_through_pipeline(
236
231
path : str ,
237
232
headers : list [str ],
238
233
body : bytes ,
239
- ) -> Tuple [bytes , PipelineContext ]:
234
+ ) -> Tuple [bytes , PipelineContext | None ]:
240
235
strategy = self ._select_pipeline (method , path )
241
236
if len (body ) == 0 or strategy is None :
242
237
# if we didn't select any strategy that would change the request
You can’t perform that action at this time.
0 commit comments