Skip to content

Prompt Info

pyllmut.mutant_lib.prompt_info.PromptInfo

A class to store information about a prompt for generating mutants.

Source code in pyllmut/mutant_lib/prompt_info.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class PromptInfo:
    """A class to store information about a prompt for generating mutants."""

    def __init__(
            self,
            prompt_content: str,
            original_module_content: str,
            line_number: int
    ):
        """
        Initializes the PromptInfo object with the given parameters.

        Args:
            prompt_content (str): The content of the prompt.
            original_module_content (str): The content of the module we plan to generate mutants for.
            line_number (int): The line number in the module where we want to generate mutants.
        """
        self._prompt_content = prompt_content
        self._original_module_content = original_module_content
        self._line_number = line_number

    def get_prompt_content(self) -> str:
        """Returns the content of the prompt."""
        return self._prompt_content

    def get_original_module_content(self) -> str:
        """Returns the content of the module we plan to generate mutants for."""
        return self._original_module_content

    def get_line_number(self) -> int:
        """Returns the line number in the module where we want to generate mutants."""
        return self._line_number

get_line_number()

Returns the line number in the module where we want to generate mutants.

Source code in pyllmut/mutant_lib/prompt_info.py
30
31
32
def get_line_number(self) -> int:
    """Returns the line number in the module where we want to generate mutants."""
    return self._line_number

get_original_module_content()

Returns the content of the module we plan to generate mutants for.

Source code in pyllmut/mutant_lib/prompt_info.py
26
27
28
def get_original_module_content(self) -> str:
    """Returns the content of the module we plan to generate mutants for."""
    return self._original_module_content

get_prompt_content()

Returns the content of the prompt.

Source code in pyllmut/mutant_lib/prompt_info.py
22
23
24
def get_prompt_content(self) -> str:
    """Returns the content of the prompt."""
    return self._prompt_content