Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

feat: first interation for kodu #778

Merged
merged 4 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/codegate/pipeline/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ async def process(
if args:
context.shortcut_response = True
cmd_out = await codegate_cli(args[1:])
if base_tool and base_tool == "cline":
if base_tool in ["cline", "kodu"]:
cmd_out = (
f"<attempt_completion><result>{cmd_out}</result></attempt_completion>\n"
)
Expand Down
8 changes: 2 additions & 6 deletions src/codegate/providers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from codegate.providers.formatting.input_pipeline import PipelineResponseFormatter
from codegate.providers.normalizer.base import ModelInputNormalizer, ModelOutputNormalizer
from codegate.providers.normalizer.completion import CompletionNormalizer
from codegate.utils.utils import get_tool_name_from_messages

logger = structlog.get_logger("codegate")

Expand Down Expand Up @@ -233,12 +234,7 @@ async def complete(
# Execute the completion and translate the response
# This gives us either a single response or a stream of responses
# based on the streaming flag
is_cline_client = any(
"Cline" in str(message.get("content", "")) for message in data.get("messages", [])
)
base_tool = ""
if is_cline_client:
base_tool = "cline"
base_tool = get_tool_name_from_messages(data)

model_response = await self._completion_handler.execute_completion(
provider_request,
Expand Down
4 changes: 1 addition & 3 deletions src/codegate/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ def get_tool_name_from_messages(data):
Returns:
str: The name of the tool found in the messages, or None if no match is found.
"""
tools = [
"Cline",
]
tools = ["Cline", "Kodu"]
for message in data.get("messages", []):
message_content = str(message.get("content", ""))
for tool in tools:
Expand Down
Loading