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

Automatic Greeting Feature #216

Merged
merged 11 commits into from
Dec 22, 2024
Merged

Automatic Greeting Feature #216

merged 11 commits into from
Dec 22, 2024

Conversation

milesha
Copy link
Contributor

@milesha milesha commented Dec 17, 2024

Motivation

We aim for the AI mentor to directly engage with the student at the beginning of each session (aka send the first message) to clarify its purpose and enhance the flow of interaction.

Description

  • A separate file including the persona_prompt - an overarching description of the Mentor behaviour.
  • An extra node in the LangGraph responsible for the greeting of the user is the received message is empty.
  • Skeleton for the messages is added as well as "isLoading" state

Testing Instructions

  • Loading State of the message view can be found in Storybook under app/mentor/messages/isLoading
  • Start the webapp, intelligence-service and application-server. Important: your user should have "mentor_access" role.
  • Open the mentor interface and click the "New Session" button -> afterwards, you should automatically get the first message from the AI mentor

Screenshots (if applicable)

Screenshot 2024-12-17 at 11 52 16 Screenshot 2024-12-17 at 11 52 36

Checklist

General

  • PR title is clear and descriptive
  • PR description explains the purpose and changes
  • Code follows project coding standards
  • Self-review of the code has been done
  • Changes have been tested locally
  • Screenshots have been attached (if applicable)
  • Documentation has been updated (if applicable)

Client (if applicable)

  • UI changes look good on all screen sizes and browsers
  • No console errors or warnings
  • User experience and accessibility have been tested
  • Added Storybook stories for new components
  • Components follow design system guidelines (if applicable)

Server (if applicable)

  • Code is performant and follows best practices
  • No security vulnerabilities introduced
  • Proper error handling has been implemented
  • Added tests for new functionality
  • Changes have been tested in different environments (if applicable)

@milesha milesha self-assigned this Dec 17, 2024
@github-actions github-actions bot added client feature size:L This PR changes 100-499 lines, ignoring generated files. labels Dec 17, 2024
Copy link
Collaborator

@GODrums GODrums left a comment

Choose a reason for hiding this comment

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

Very nice PR!

Added a few smaller remarks and one larger suggestion for a redesign of a prompt management solution. If you prefer to solve it in a separate PR, just stack it on top of this one.

return null;
}

Message savedSystemMessage = createSystemMessage(currentSession, systemResponse);
return MessageDTO.fromMessage(savedSystemMessage);
}

private String generateResponse(Long sessionId, String messageContent) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am probably missing something here since this isn't new code - but the messageContent is currently not passed to the IS, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@GODrums the idea is that the latest message is first saved to the session and then passed as part of the message history to the intelligence-service, we do not send it separately.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That makes sense.
Since messageContent is not used in generateResponse directly, we can just omit it as parameter then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@GODrums you are totally right - thanks for noticing! :)

server/intelligence-service/app/mentor/persona_prompt.py Outdated Show resolved Hide resolved
webapp/src/app/mentor/messages/messages.component.html Outdated Show resolved Hide resolved
@milesha milesha requested a review from GODrums December 18, 2024 12:23
@milesha milesha changed the title Add Automatic Greeting Feature Automatic Greeting Feature Dec 18, 2024
Copy link
Collaborator

@GODrums GODrums left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for implementing the suggestions!

Tested it locally.

I'll merge and deploy it together with the Docs-PR later today.

@GODrums GODrums merged commit 63e0928 into develop Dec 22, 2024
7 of 8 checks passed
@GODrums GODrums deleted the feature/auto-start-mentor-chat branch December 22, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
application-server client feature intelligence-service size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants