logdetective 2.3.0__tar.gz → 2.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. {logdetective-2.3.0 → logdetective-2.4.1}/PKG-INFO +1 -1
  2. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/config.py +3 -2
  3. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/models.py +2 -0
  4. logdetective-2.4.1/logdetective/server/templates/base_response.html.j2 +59 -0
  5. logdetective-2.4.1/logdetective/server/templates/gitlab_full_comment.md.j2 +71 -0
  6. logdetective-2.4.1/logdetective/server/templates/gitlab_short_comment.md.j2 +60 -0
  7. {logdetective-2.3.0 → logdetective-2.4.1}/pyproject.toml +5 -1
  8. logdetective-2.3.0/logdetective/server/templates/gitlab_full_comment.md.j2 +0 -68
  9. logdetective-2.3.0/logdetective/server/templates/gitlab_short_comment.md.j2 +0 -57
  10. {logdetective-2.3.0 → logdetective-2.4.1}/LICENSE +0 -0
  11. {logdetective-2.3.0 → logdetective-2.4.1}/README.md +0 -0
  12. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/__init__.py +0 -0
  13. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/constants.py +0 -0
  14. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/drain3.ini +0 -0
  15. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/extractors.py +0 -0
  16. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/logdetective.py +0 -0
  17. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/models.py +0 -0
  18. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/prompts-summary-first.yml +0 -0
  19. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/prompts-summary-only.yml +0 -0
  20. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/prompts.yml +0 -0
  21. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/remote_log.py +0 -0
  22. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/__init__.py +0 -0
  23. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/compressors.py +0 -0
  24. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/database/__init__.py +0 -0
  25. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/database/base.py +0 -0
  26. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/database/models/__init__.py +0 -0
  27. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/database/models/exceptions.py +0 -0
  28. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/database/models/koji.py +0 -0
  29. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/database/models/merge_request_jobs.py +0 -0
  30. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/database/models/metrics.py +0 -0
  31. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/emoji.py +0 -0
  32. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/exceptions.py +0 -0
  33. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/gitlab.py +0 -0
  34. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/koji.py +0 -0
  35. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/llm.py +0 -0
  36. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/metric.py +0 -0
  37. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/plot.py +0 -0
  38. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/server.py +0 -0
  39. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/server/utils.py +0 -0
  40. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/skip_snippets.yml +0 -0
  41. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective/utils.py +0 -0
  42. {logdetective-2.3.0 → logdetective-2.4.1}/logdetective.1.asciidoc +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: logdetective
3
- Version: 2.3.0
3
+ Version: 2.4.1
4
4
  Summary: Log using LLM AI to search for build/test failures and provide ideas for fixing these.
5
5
  License: Apache-2.0
6
6
  License-File: LICENSE
@@ -52,10 +52,11 @@ def get_log(config: Config):
52
52
  return log
53
53
 
54
54
 
55
- def get_openai_api_client(ineference_config: InferenceConfig):
55
+ def get_openai_api_client(inference_config: InferenceConfig):
56
56
  """Set up AsyncOpenAI client with default configuration."""
57
57
  return AsyncOpenAI(
58
- api_key=ineference_config.api_token, base_url=ineference_config.url
58
+ api_key=inference_config.api_token, base_url=inference_config.url,
59
+ timeout=inference_config.llm_api_timeout
59
60
  )
60
61
 
61
62
 
@@ -182,6 +182,7 @@ class InferenceConfig(BaseModel): # pylint: disable=too-many-instance-attribute
182
182
  http_timeout: float = 5.0
183
183
  user_role: str = USER_ROLE_DEFAULT
184
184
  system_role: str = SYSTEM_ROLE_DEFAULT
185
+ llm_api_timeout: float = 15.0
185
186
  _http_session: aiohttp.ClientSession = None
186
187
  _limiter: AsyncLimiter = AsyncLimiter(LLM_DEFAULT_REQUESTS_PER_MINUTE)
187
188
 
@@ -203,6 +204,7 @@ class InferenceConfig(BaseModel): # pylint: disable=too-many-instance-attribute
203
204
  self._requests_per_minute = data.get(
204
205
  "requests_per_minute", LLM_DEFAULT_REQUESTS_PER_MINUTE
205
206
  )
207
+ self.llm_api_timeout = data.get("llm_api_timeout", 15.0)
206
208
  self._limiter = AsyncLimiter(self._requests_per_minute)
207
209
 
208
210
  def __del__(self):
@@ -0,0 +1,59 @@
1
+ <b>Log Detective report
2
+ {% if project %}for {{ project }}{% endif %}
3
+ </b>
4
+ <p>
5
+ Analysis:
6
+ <br>
7
+ {{ explanation }}
8
+ <br>
9
+ <details>
10
+ <summary>Analysis details</summary>
11
+ <ul>
12
+ {% for snippet in snippets %}
13
+ <li>
14
+ <b>Line {{ snippet.line_number }}:</b> <code>{{ snippet.text }}</code>
15
+ {{ snippet.explanation.text }}
16
+ </li>
17
+ {% endfor %}
18
+ </ul>
19
+ </details>
20
+ </p>
21
+ <br>
22
+ <details>
23
+ <summary>Help</summary>
24
+ <p>
25
+ Log Detective analyses logs using template mining algorithm and LLMs.
26
+ Providing overview of the primary issue, while highlighting potentially important log lines.
27
+ </p>
28
+ <p>
29
+ Log Detective may offer potential solution to problem.
30
+ However, it is designed to do so only when sufficiently confident in the response.
31
+ <br>
32
+ Even so, as with any LLM based AI system, recommendations of Log Detective must be taken with caution.
33
+ Before acting on any recommendations of Log Detective, consider following:
34
+ </p>
35
+ <ul>
36
+ <li>
37
+ <b>Do you understand how does the proposed solution work? And why should it solve your problem?</b>
38
+ </li>
39
+ <li>Did Log Detective work with sufficient information to make this suggestion?</li>
40
+ <li>Are the suggested actions safe in the context of your work?</li>
41
+ <li>Do results of snippet analysis align with results of final analysis?</li>
42
+ <li>Are there any potentially adverse outcomes from implementing proposed solution?</li>
43
+ </ul>
44
+ </details>
45
+ <br>
46
+ {% render_contacts %}
47
+ <details>
48
+ <summary>Contacts</summary>
49
+ <p>Don't hesitate to reach out with your questions or suggestions.</p>
50
+ <ul>
51
+ <li>
52
+ <a href="https://github.com/fedora-copr/logdetective">Source</a>
53
+ </li>
54
+ <li>
55
+ <a href="https://github.com/fedora-copr/logdetective/issues">Issue tracker</a>
56
+ </li>
57
+ </ul>
58
+ </details>
59
+ {% endif %}
@@ -0,0 +1,71 @@
1
+ The package {{ package }} build has experienced an issue.
2
+ Please know that the explanation was provided by AI and may be incorrect.
3
+ {% if certainty > 0 %}
4
+ In this case, we are {{ "%.2f" | format(certainty) }}% certain of the response {{ emoji_face }}.
5
+ {% endif %}
6
+
7
+ <b>Snippets:</b>
8
+
9
+ <ul>
10
+ {% for snippet in snippets %}
11
+ <li>
12
+ <b>Line {{ snippet.line_number }}:</b> <code>{{ snippet.text }}</code>
13
+ {{ snippet.explanation.text }}
14
+ </li>
15
+ {% endfor %}
16
+ </ul>
17
+ <details>
18
+ <summary>Description</summary>
19
+ {{ explanation }}
20
+ </details>
21
+ <details>
22
+ <summary>Logs</summary>
23
+ <p>Log Detective analyzed the following logs files to provide an explanation:</p>
24
+ <ul>
25
+ <li>
26
+ <a href="{{ log_url }}">{{ log_url }}</a>
27
+ </li>
28
+ </ul>
29
+ <p>
30
+ Additional logs are available from:
31
+ <ul>
32
+ <li>
33
+ <a href="{{ artifacts_url }}">artifacts.zip</a>
34
+ </li>
35
+ </ul>
36
+ </p>
37
+ <p>
38
+ Please know that these log files are automatically removed after some
39
+ time, so you might need a backup.
40
+ </p>
41
+ </details>
42
+ <details>
43
+ <summary>Help</summary>
44
+ <p>Don't hesitate to reach out.</p>
45
+ <ul>
46
+ <li>
47
+ <a href="https://github.com/fedora-copr/logdetective">Upstream</a>
48
+ </li>
49
+ <li>
50
+ <a href="https://github.com/fedora-copr/logdetective/issues">Issue tracker</a>
51
+ </li>
52
+ <li>
53
+ <a href="https://redhat.enterprise.slack.com/archives/C06DWNVKKDE">Slack</a>
54
+ </li>
55
+ <li>
56
+ <a href="https://log-detective.com/documentation">Documentation</a>
57
+ </li>
58
+ </ul>
59
+ </details>
60
+ ---
61
+ This comment was created by [Log Detective][log-detective].
62
+ Was the provided feedback accurate and helpful?
63
+ <br>
64
+ Please vote with :thumbsup:
65
+ or :thumbsdown: to help us improve.
66
+ <br>
67
+ <i>If this Log Detective report contains harmful content, please use the
68
+ [Gitlab reporting feature for harmful content](https://docs.gitlab.com/user/report_abuse/)
69
+ and contact the [Log Detective developers](https://github.com/fedora-copr/logdetective/issues).</i>
70
+ [log-detective]: https://log-detective.com/
71
+ [contact]: https://github.com/fedora-copr
@@ -0,0 +1,60 @@
1
+ The package {{ package }} build has experienced an issue.
2
+ Please know that the explanation was provided by AI and may be incorrect.
3
+ {% if certainty > 0 %}
4
+ In this case, we are {{ "%.2f" | format(certainty) }}% certain of the response {{ emoji_face }}.
5
+ {% endif %}
6
+ <details>
7
+ <summary>Description</summary>
8
+ {{ explanation }}
9
+ </details>
10
+ <details>
11
+ <summary>Logs</summary>
12
+ <p>Log Detective analyzed the following logs files to provide an explanation:</p>
13
+ <ul>
14
+ <li>
15
+ <a href="{{ log_url }}">{{ log_url }}</a>
16
+ </li>
17
+ </ul>
18
+ <p>
19
+ Additional logs are available from:
20
+ <ul>
21
+ <li>
22
+ <a href="{{ artifacts_url }}">artifacts.zip</a>
23
+ </li>
24
+ </ul>
25
+ </p>
26
+ <p>
27
+ Please know that these log files are automatically removed after some
28
+ time, so you might need a backup.
29
+ </p>
30
+ </details>
31
+ <details>
32
+ <summary>Help</summary>
33
+ <p>Don't hesitate to reach out.</p>
34
+ <ul>
35
+ <li>
36
+ <a href="https://github.com/fedora-copr/logdetective">Upstream</a>
37
+ </li>
38
+ <li>
39
+ <a href="https://github.com/fedora-copr/logdetective/issues">Issue tracker</a>
40
+ </li>
41
+ <li>
42
+ <a href="https://redhat.enterprise.slack.com/archives/C06DWNVKKDE">Slack</a>
43
+ </li>
44
+ <li>
45
+ <a href="https://log-detective.com/documentation">Documentation</a>
46
+ </li>
47
+ </ul>
48
+ </details>
49
+ ---
50
+ This comment was created by [Log Detective][log-detective].
51
+ Was the provided feedback accurate and helpful?
52
+ <br>
53
+ Please vote with :thumbsup:
54
+ or :thumbsdown: to help us improve.
55
+ <br>
56
+ <i>If this Log Detective report contains harmful content, please use the
57
+ [Gitlab reporting feature for harmful content](https://docs.gitlab.com/user/report_abuse/)
58
+ and contact the [Log Detective developers](https://github.com/fedora-copr/logdetective/issues).</i>
59
+ [log-detective]: https://log-detective.com/
60
+ [contact]: https://github.com/fedora-copr
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "logdetective"
3
- version = "2.3.0"
3
+ version = "2.4.1"
4
4
  description = "Log using LLM AI to search for build/test failures and provide ideas for fixing these."
5
5
  authors = ["Jiri Podivin <jpodivin@gmail.com>"]
6
6
  license = "Apache-2.0"
@@ -97,3 +97,7 @@ disable = [
97
97
  testpaths = [
98
98
  "tests",
99
99
  ]
100
+
101
+ [tool.djlint]
102
+ profile="jinja"
103
+ extension=".j2"
@@ -1,68 +0,0 @@
1
- The package {{ package }} failed to build, here is a possible explanation why.
2
-
3
- Please know that the explanation was provided by AI and may be incorrect.
4
- {% if certainty > 0 %}
5
- In this case, we are {{ "%.2f" | format(certainty) }}% certain of the response {{ emoji_face }}.
6
- {% endif %}
7
-
8
- {{ explanation }}
9
-
10
- <details>
11
- <ul>
12
- {% for snippet in snippets %}
13
- <li>
14
- <b>Line {{ snippet.line_number }}:</b> <code>{{ snippet.text }}</code>
15
- {{ snippet.explanation.text }}
16
- </li>
17
- {% endfor %}
18
- </ul>
19
- </details>
20
-
21
- <details>
22
- <summary>Logs</summary>
23
- <p>
24
- Log Detective analyzed the following logs files to provide an explanation:
25
- </p>
26
-
27
- <ul>
28
- <li><a href="{{ log_url }}">{{ log_url }}</a></li>
29
- </ul>
30
-
31
- <p>
32
- Additional logs are available from:
33
- <ul>
34
- <li><a href="{{ artifacts_url }}">artifacts.zip</a></li>
35
- </ul>
36
- </p>
37
-
38
- <p>
39
- Please know that these log files are automatically removed after some
40
- time, so you might need a backup.
41
- </p>
42
- </details>
43
-
44
- <details>
45
- <summary>Help</summary>
46
- <p>Don't hesitate to reach out.</p>
47
-
48
- <ul>
49
- <li><a href="https://github.com/fedora-copr/logdetective">Upstream</a></li>
50
- <li><a href="https://github.com/fedora-copr/logdetective/issues">Issue tracker</a></li>
51
- <li><a href="https://redhat.enterprise.slack.com/archives/C06DWNVKKDE">Slack</a></li>
52
- <li><a href="https://log-detective.com/documentation">Documentation</a></li>
53
- </ul>
54
- </details>
55
-
56
-
57
- ---
58
- This comment was created by [Log Detective][log-detective].
59
-
60
- Was the provided feedback accurate and helpful? <br>Please vote with :thumbsup:
61
- or :thumbsdown: to help us improve.<br>
62
-
63
- <i>If this Log Detective report contains harmful content, please use the
64
- [Gitlab reporting feature for harmful content](https://docs.gitlab.com/user/report_abuse/)
65
- and contact the [Log Detective developers](https://github.com/fedora-copr/logdetective/issues).</i>
66
-
67
- [log-detective]: https://log-detective.com/
68
- [contact]: https://github.com/fedora-copr
@@ -1,57 +0,0 @@
1
- The package {{ package }} failed to build, here is a possible explanation why.
2
-
3
- Please know that the explanation was provided by AI and may be incorrect.
4
- {% if certainty > 0 %}
5
- In this case, we are {{ "%.2f" | format(certainty) }}% certain of the response {{ emoji_face }}.
6
- {% endif %}
7
-
8
- {{ explanation }}
9
-
10
- <details>
11
- <summary>Logs</summary>
12
- <p>
13
- Log Detective analyzed the following logs files to provide an explanation:
14
- </p>
15
-
16
- <ul>
17
- <li><a href="{{ log_url }}">{{ log_url }}</a></li>
18
- </ul>
19
-
20
- <p>
21
- Additional logs are available from:
22
- <ul>
23
- <li><a href="{{ artifacts_url }}">artifacts.zip</a></li>
24
- </ul>
25
- </p>
26
-
27
- <p>
28
- Please know that these log files are automatically removed after some
29
- time, so you might need a backup.
30
- </p>
31
- </details>
32
-
33
- <details>
34
- <summary>Help</summary>
35
- <p>Don't hesitate to reach out.</p>
36
-
37
- <ul>
38
- <li><a href="https://github.com/fedora-copr/logdetective">Upstream</a></li>
39
- <li><a href="https://github.com/fedora-copr/logdetective/issues">Issue tracker</a></li>
40
- <li><a href="https://redhat.enterprise.slack.com/archives/C06DWNVKKDE">Slack</a></li>
41
- <li><a href="https://log-detective.com/documentation">Documentation</a></li>
42
- </ul>
43
- </details>
44
-
45
-
46
- ---
47
- This comment was created by [Log Detective][log-detective].
48
-
49
- Was the provided feedback accurate and helpful? <br>Please vote with :thumbsup:
50
- or :thumbsdown: to help us improve.<br>
51
-
52
- <i>If this Log Detective report contains harmful content, please use the
53
- [Gitlab reporting feature for harmful content](https://docs.gitlab.com/user/report_abuse/)
54
- and contact the [Log Detective developers](https://github.com/fedora-copr/logdetective/issues).</i>
55
-
56
- [log-detective]: https://log-detective.com/
57
- [contact]: https://github.com/fedora-copr
File without changes
File without changes