Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.5.11 #1707

Merged
merged 5 commits into from
Jun 6, 2024
Merged

v1.5.11 #1707

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion feder/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PEP 396: The __version__ attribute's value SHOULD be a string.
__version__ = "1.5.10"
__version__ = "1.5.11"


# Compatibility to eg. django-rest-framework
Expand Down
5 changes: 5 additions & 0 deletions feder/llm_evaluation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ def get_normalized_answers(cls, letter):
normalized_questions_json = (
letter.case.monitoring.normalized_response_template
)
instruction_extension = (
letter.case.monitoring.letter_normalization_prompt_extension or ""
)
else:
logger.warning(
f"Can not get normalised answer: letter {letter.pk}"
Expand All @@ -244,6 +247,7 @@ def get_normalized_answers(cls, letter):
test_prompt = letter_response_normalization.format(
institution=institution_name,
normalized_questions=normalized_questions_json,
prompt_instruction_extension=instruction_extension,
monitoring_response="",
)
llm_engine = settings.OPENAI_API_ENGINE_35
Expand Down Expand Up @@ -273,6 +277,7 @@ def get_normalized_answers(cls, letter):
final_prompt = letter_response_normalization.format(
institution=institution_name,
normalized_questions=normalized_questions_json,
prompt_instruction_extension=instruction_extension,
monitoring_response=text,
)
letter_llm_request = cls.objects.create(
Expand Down
8 changes: 8 additions & 0 deletions feder/llm_evaluation/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ def update_letter_normalized_answers(letter_pk):
)
return

if not letter.ai_evaluation:
categorize_letter_in_background(letter_pk)
logger.info(
f"Letter with pk={letter_pk} has no AI evaluation. Task to update letter"
+ " categorization and upadte normalized answers created."
)
return

if EMAIL_IS_ANSWER in letter.ai_evaluation:
LlmLetterRequest.get_normalized_answers(letter)
logger.info(f"Letter with pk={letter_pk} answer normalization processed.")
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.