Skip to content

story/HOP-8#9

Open
Girik1105 wants to merge 19 commits intodevelopfrom
story/HOP-8
Open

story/HOP-8#9
Girik1105 wants to merge 19 commits intodevelopfrom
story/HOP-8

Conversation

@Girik1105
Copy link
Contributor

@Girik1105 Girik1105 commented Jan 30, 2026

Guidelines for Pull Requests

If you haven't yet read our code review guidelines, please do so, You can find them here.

Please confirm the following by adding an x for each item (turn [ ] into [x]).

  • I have removed all code style changes that are not necessary (e.g. changing blanks across the whole file that don’t need to be changed, adding empty lines in parts other than your own code)
  • I am not making any changes to files that don’t have any effect (e.g. imports added that don’t need to be added)
  • I do not have any sysout statements in my code or commented out code that isn’t needed anymore
  • I am not reformatting any files in the wrong format or without cause.
  • I am not changing file encoding or line endings to something else than UTF-8, LF
  • My pull request does not show an insane amount of files being changed although my ticket only requires a few files being changed
  • I have added Javadoc/documentation where appropriate
  • I have added test cases where appropriate
  • I have explained any part of my code/implementation decisions that is not be self-explanatory

Please provide a brief description of your ticket

Store questions and answers for each user

Description

Properties:
Question
question
timestamp
user asking the question
answer
Answer
all the details send from the AI
timestamp
corresponding question
user that asked the question

HOP-8

Are there any other pull requests that this one depends on?

story/HOP-7

Anything else the reviewer needs to know?

... describe here ...

@diging-jenkins
Copy link

Can one of the admins verify this patch?

@Girik1105 Girik1105 changed the title Story/hop 8 story/HOP-8 Jan 30, 2026

answer_text = ""
if "choices" in llm_response and llm_response["choices"]:
answer_text = llm_response["choices"][0].get("message", {}).get("content", "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is the try/except block from the development branch missing here

elif "message" in llm_response: # Fallback for mock response format
answer_text = llm_response["message"]

QARecord.objects.create(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want to create the record before sending it to the LLM since there can be a significant lack between sending and answering. and then update it with the answer once you have it. This will change a little anyways when polling I presume.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And one thing I'm just thinking of, we probably want to be able to indicate any error responses (e.g. when the request is timed out). So the model will need to accommodate that.

@jdamerow jdamerow closed this Feb 4, 2026
@Girik1105 Girik1105 reopened this Feb 5, 2026
@Girik1105 Girik1105 closed this Feb 5, 2026
@Girik1105 Girik1105 reopened this Feb 5, 2026
@Girik1105 Girik1105 marked this pull request as ready for review February 5, 2026 19:45
answer_text = ""
if "choices" in llm_response and llm_response["choices"]:
answer_text = llm_response["choices"][0].get("message", {}).get("content", "")
elif "message" in llm_response:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there was a comment here in some version of the file explaining this was for the mock server? This should be here as well. or even better, the mock server should return the same format as the real one.

@jdamerow jdamerow closed this Feb 5, 2026
@Girik1105 Girik1105 reopened this Feb 6, 2026
@Girik1105 Girik1105 closed this Feb 6, 2026
@Girik1105 Girik1105 reopened this Feb 6, 2026
error_msg = f"Unexpected response from server: {e}"
except Exception as e:
return JsonResponse({"error": f"Failed to connect to server: {e}"}, status=500) No newline at end of file
error_msg = f"Failed to connect to server: {e}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the exceptions need to be logged

@jdamerow jdamerow closed this Feb 6, 2026
@Girik1105 Girik1105 reopened this Feb 6, 2026
@Girik1105 Girik1105 mentioned this pull request Feb 6, 2026
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants