INNER CODE UNIT · Python

_get_cli_from_continue

stacklok/codegate · src/codegate/pipeline/cli/cli.py:81

def _get_cli_from_continue(last_user_message_str: str) -> Optional[re.Match[str]]:
    """
    Continue sends a differently formatted message to the CLI if DeepSeek is used
    """
    deepseek_match = re.search(
        r"utilizing the DeepSeek Coder model.*?### Instruction:\s*codegate\s+(.*?)\s*### Response:",
        last_user_message_str,
        re.DOTALL | re.IGNORECASE,
    )
    if deepseek_match:
        command = deepseek_match.group(1).strip()
        return re.match(r"^(.*?)$", command)  # This creates a match object with the command

    return codegate_regex.match(last_user_message_str)


def _get_cli_from_copilot(last_user_message_str: str) -> Optional[re.Match[str]]:
    """

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…