Skip to content

Commit 59bb198

Browse files
author
Docs
committed
Minor nits
Signed-off-by: Docs <[email protected]>
1 parent f83ffc6 commit 59bb198

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,14 @@ Python 3.11 and above is recommended for the environment setup.
1616
```
1717
python3 slack.py --help
1818
19-
usage: slack.py [-h] [--product PRODUCT] [--ci CI] [--mapping-config MAPPING_CONFIG]
19+
usage: slack.py [-h] [--product PRODUCT] [--ci CI]
2020
2121
Slack Log Analyzer Bot
2222
2323
options:
2424
-h, --help show this help message and exit
2525
--product PRODUCT Product type (e.g., openshift, ansible)
2626
--ci CI CI system name
27-
--mapping-config MAPPING_CONFIG
28-
Path to mapping config
2927
```
3028

3129
## **Configurables**
@@ -89,5 +87,5 @@ podman build -f Dockerfile -t=quay.io/YOUR_REPO/bugzooka:latest .
8987
podman push quay.io/YOUR_REPO/bugzooka:latest
9088
9189
// Run as a container
92-
podman run -d -e PRODUCT=openshift -e CI_NAME=prow -v /path-to/prompts.json:/app/prompts.json:Z -v /path-to/.env:/app/.env:Z quay.io/YOUR_REPO/bugzooka:latest
90+
podman run -d -e PRODUCT=openshift -e CI=prow -v /path-to/prompts.json:/app/prompts.json:Z -v /path-to/.env:/app/.env:Z quay.io/YOUR_REPO/bugzooka:latest
9391
```
File renamed without changes.

slack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def fetch_messages(self, **kwargs):
104104
requires_llm = True # Assuming you want LLM for ansible too?
105105

106106
if requires_llm:
107-
error_prompt = ERROR_FILTER_PROMPT["user"].format(error_list="\n".join(errors_list)[:8192])
107+
error_prompt = ERROR_FILTER_PROMPT["user"].format(error_list="\n".join(errors_list)[:6100])
108108
response = ask_inference_api(
109109
messages=[
110110
{"role": "system", "content": ERROR_FILTER_PROMPT["system"]},
@@ -119,7 +119,7 @@ def fetch_messages(self, **kwargs):
119119
# Convert JSON response to a Python list
120120
errors_list = response.split("\n")
121121

122-
errors_list_string = "\n".join(errors_list)[:8192]
122+
errors_list_string = "\n".join(errors_list)[:6100]
123123
message_block = get_slack_message_blocks(
124124
markdown_header=":checking: *Error Logs Preview*\n",
125125
preformatted_text=errors_list_string

src/log_summarizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def download_url_to_log(url, log_file_path):
201201
response.raise_for_status()
202202

203203
with open(log_file_path, 'wb') as file:
204-
for chunk in response.iter_content(chunk_size=8192):
204+
for chunk in response.iter_content(chunk_size=6100):
205205
file.write(chunk)
206206
print(f"Successfully downloaded content from {url} to {log_file_path}")
207207

@@ -258,7 +258,7 @@ def generate_prompt(error_list):
258258
# Convert to messages list format
259259
messages = [
260260
{"role": "system", "content": ERROR_SUMMARIZATION_PROMPT["system"]},
261-
{"role": "user", "content": ERROR_SUMMARIZATION_PROMPT["user"].format(error_list="\n".join(error_list)[:8192])},
261+
{"role": "user", "content": ERROR_SUMMARIZATION_PROMPT["user"].format(error_list="\n".join(error_list)[:6100])},
262262
{"role": "assistant", "content": ERROR_SUMMARIZATION_PROMPT["assistant"]}
263263
]
264264
return messages

0 commit comments

Comments
 (0)