File tree 3 files changed +4
-10
lines changed
3 files changed +4
-10
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 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 @@ -45,9 +45,7 @@ def get_tool_name_from_messages(data):
45
45
Returns:
46
46
str: The name of the tool found in the messages, or None if no match is found.
47
47
"""
48
- tools = [
49
- "Cline" ,
50
- ]
48
+ tools = ["Cline" , "Kodu" ]
51
49
for message in data .get ("messages" , []):
52
50
message_content = str (message .get ("content" , "" ))
53
51
for tool in tools :
You can’t perform that action at this time.
0 commit comments