Skip to content

Commit eac30ec

Browse files
committed
feat: first interation for kodu
1 parent 839da67 commit eac30ec

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

src/codegate/pipeline/cli/cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ async def process(
111111
if args:
112112
context.shortcut_response = True
113113
cmd_out = await codegate_cli(args[1:])
114-
if base_tool and base_tool == "cline":
114+
if base_tool in ["cline", "kodu"]:
115115
cmd_out = (
116116
f"<attempt_completion><result>{cmd_out}</result></attempt_completion>\n"
117117
)

src/codegate/providers/base.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from codegate.providers.formatting.input_pipeline import PipelineResponseFormatter
1818
from codegate.providers.normalizer.base import ModelInputNormalizer, ModelOutputNormalizer
1919
from codegate.providers.normalizer.completion import CompletionNormalizer
20+
from codegate.utils.utils import get_tool_name_from_messages
2021

2122
logger = structlog.get_logger("codegate")
2223

@@ -233,12 +234,7 @@ async def complete(
233234
# Execute the completion and translate the response
234235
# This gives us either a single response or a stream of responses
235236
# 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)
242238

243239
model_response = await self._completion_handler.execute_completion(
244240
provider_request,

src/codegate/utils/utils.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ def get_tool_name_from_messages(data):
4545
Returns:
4646
str: The name of the tool found in the messages, or None if no match is found.
4747
"""
48-
tools = [
49-
"Cline",
50-
]
48+
tools = ["Cline", "Kodu"]
5149
for message in data.get("messages", []):
5250
message_content = str(message.get("content", ""))
5351
for tool in tools:

0 commit comments

Comments
 (0)