Skip to content

Commit

Permalink
Reduces throwing errors when the LLM returns a verbose answer in comm…
Browse files Browse the repository at this point in the history
…it classification.

Now if there is 'true' or 'false' in the answer string, it is returned as True and False respectively, instead of checking for certain output formats
  • Loading branch information
lauraschauer committed Aug 16, 2024
1 parent 55e1420 commit 19d16fe
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions prospector/llm/llm_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,9 @@ def classify_commit(
except Exception as e:
raise RuntimeError(f"Prompt-model chain could not be invoked: {e}")

if is_relevant in [
"True",
"ANSWER:True",
"```ANSWER:True```",
]:
if "True" in is_relevant:
return True
elif is_relevant in [
"False",
"ANSWER:False",
"```ANSWER:False```",
]:
elif "False" in is_relevant:
return False
else:
raise RuntimeError(
Expand Down

0 comments on commit 19d16fe

Please sign in to comment.