Mutant Info
pyllmut.mutant_lib.mutant_info.MutantInfo
Bases: ResponseInfo
Represents a mutation.
Source code in pyllmut/mutant_lib/mutant_info.py
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
get_after_code_model()
Returns the content of the line after mutation, as returned by the model.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The post-mutation code content from the model. |
Source code in pyllmut/mutant_lib/mutant_info.py
91 92 93 94 95 96 97 98 | |
get_after_code_refined()
Returns the content of the line after mutation, with fixed indentation.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The refined post-mutation code content. |
Source code in pyllmut/mutant_lib/mutant_info.py
109 110 111 112 113 114 115 116 | |
get_diff_content()
Returns a diff representation of the changes between the original and mutated code.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The diff content. |
Source code in pyllmut/mutant_lib/mutant_info.py
73 74 75 76 77 78 79 80 | |
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 | |
get_mutant_type()
Returns the type of the mutant.
Returns:
| Name | Type | Description |
|---|---|---|
MutantType |
MutantType
|
The type of the mutant. |
Source code in pyllmut/mutant_lib/mutant_info.py
118 119 120 121 122 123 124 125 | |
get_mutated_module_content()
Returns the content of the module after applying the mutation.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The mutated module content. |
Source code in pyllmut/mutant_lib/mutant_info.py
64 65 66 67 68 69 70 71 | |
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 | |
get_pre_code_model()
Returns the content of the line before mutation, as returned by the model.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The pre-mutation code content from the model. |
Source code in pyllmut/mutant_lib/mutant_info.py
82 83 84 85 86 87 88 89 | |
get_pre_code_refined()
Returns the actual content of the line before mutation, extracted from the original code.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The refined pre-mutation code content. |
Source code in pyllmut/mutant_lib/mutant_info.py
100 101 102 103 104 105 106 107 | |
get_prompt_content()
Returns the content of the prompt.
Source code in pyllmut/mutant_lib/prompt_info.py
22 23 24 | |
get_received_token_count()
Returns the number of tokens in the response.
Source code in pyllmut/mutant_lib/response_info.py
44 45 46 | |
get_response_content()
Returns the response returned from the model.
Source code in pyllmut/mutant_lib/response_info.py
40 41 42 | |
get_sent_token_count()
Returns the number of sent tokens when using the LLM.
Source code in pyllmut/mutant_lib/response_info.py
36 37 38 | |
set_mutant_type(mutant_type)
Sets the type of the mutant (used during mutant classification).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mutant_type
|
MutantType
|
The mutant type to set. |
required |
Source code in pyllmut/mutant_lib/mutant_info.py
127 128 129 130 131 132 133 134 | |