Skip to content

Commit 021428c

Browse files
committed
Update auto_answer_bot.py
1 parent d7ac4bf commit 021428c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

KnowledgeBaseBot/auto_answer_bot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
g = Github(GITHUB_TOKEN)
2525
repo = g.get_repo(REPO_NAME)
2626
issue = repo.get_issue(number=ISSUE_NUMBER)
27-
model = SentenceTransformer(MODEL_NAME)
27+
llm_model = SentenceTransformer(MODEL_NAME)
2828

2929
# --- Load the Unified Knowledge Base ---
3030
index = faiss.read_index("unified_index.faiss")
@@ -35,7 +35,7 @@
3535

3636
# --- Process the New Issue ---
3737
new_issue_text = f"Title: {issue.title}\nBody: {issue.body}"
38-
new_issue_embedding = model.encode([new_issue_text]).astype('float32')
38+
new_issue_embedding = llm_model.encode([new_issue_text]).astype('float32')
3939

4040
# --- Semantic Search ---
4141
distances, indices = index.search(new_issue_embedding, K_NEAREST_NEIGHBORS)
@@ -85,12 +85,12 @@
8585

8686
# https://ai.google.dev/gemini-api/docs/models
8787
# Create the model with the system instruction
88-
model = genai.GenerativeModel(
88+
generative_model = genai.GenerativeModel(
8989
model_name="gemini-2.5-flash",
9090
system_instruction=system_instruction
9191
)
9292

93-
response = model.generate_content(prompt)
93+
response = generative_model.generate_content(prompt)
9494
# --- Post the Comment ---
9595
final_comment = f"Hello @{issue.user.login}, thanks for reaching out.\n\n"
9696
final_comment += response.text

0 commit comments

Comments
 (0)