Skip to content

Commit 1016a75

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

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
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/pipeline/codegate_context_retriever/codegate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,4 @@ async def process(
153153

154154
logger.debug("Final context message", context_message=context_msg)
155155

156-
return PipelineResult(request=new_request, context=context)
156+
return PipelineResult(request=new_request, context=context)

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-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def get_tool_name_from_messages(data):
4646
str: The name of the tool found in the messages, or None if no match is found.
4747
"""
4848
tools = [
49-
"Cline",
49+
"Cline", "Kodu"
5050
]
5151
for message in data.get("messages", []):
5252
message_content = str(message.get("content", ""))

0 commit comments

Comments
 (0)