File tree 4 files changed +5
-9
lines changed
codegate_context_retriever
4 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ async def process(
111
111
if args :
112
112
context .shortcut_response = True
113
113
cmd_out = await codegate_cli (args [1 :])
114
- if base_tool and base_tool == "cline" :
114
+ if base_tool in [ "cline" , "kodu" ] :
115
115
cmd_out = (
116
116
f"<attempt_completion><result>{ cmd_out } </result></attempt_completion>\n "
117
117
)
Original file line number Diff line number Diff line change @@ -153,4 +153,4 @@ async def process(
153
153
154
154
logger .debug ("Final context message" , context_message = context_msg )
155
155
156
- return PipelineResult (request = new_request , context = context )
156
+ return PipelineResult (request = new_request , context = context )
Original file line number Diff line number Diff line change 17
17
from codegate .providers .formatting .input_pipeline import PipelineResponseFormatter
18
18
from codegate .providers .normalizer .base import ModelInputNormalizer , ModelOutputNormalizer
19
19
from codegate .providers .normalizer .completion import CompletionNormalizer
20
+ from codegate .utils .utils import get_tool_name_from_messages
20
21
21
22
logger = structlog .get_logger ("codegate" )
22
23
@@ -233,12 +234,7 @@ async def complete(
233
234
# Execute the completion and translate the response
234
235
# This gives us either a single response or a stream of responses
235
236
# based on the streaming flag
236
- is_cline_client = any (
237
- "Cline" in str (message .get ("content" , "" )) for message in data .get ("messages" , [])
238
- )
239
- base_tool = ""
240
- if is_cline_client :
241
- base_tool = "cline"
237
+ base_tool = get_tool_name_from_messages (data )
242
238
243
239
model_response = await self ._completion_handler .execute_completion (
244
240
provider_request ,
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ def get_tool_name_from_messages(data):
46
46
str: The name of the tool found in the messages, or None if no match is found.
47
47
"""
48
48
tools = [
49
- "Cline" ,
49
+ "Cline" , "Kodu"
50
50
]
51
51
for message in data .get ("messages" , []):
52
52
message_content = str (message .get ("content" , "" ))
You can’t perform that action at this time.
0 commit comments