-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/f 33 chat implementation #15
Conversation
…implemenation-backend-communication feat: implement communication with back-end for the chatbot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally, all types, interfaces and props should go into the domain folder, while util functions should be in the operations folder
src/services/api/chatbot.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use a repository instead of this service file here as well. So you should create an interface called ChatRepository in domain/repositories (with just two methods, testHealth and sendMessage) and a ChatRepositoryImpl in infrastructure/repositories. Then register the implementation in container.tsx so all the components can reach the instance without knowing the exact implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, @ahmtslmngcl will continue refactoring on this part 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall AWESOME Job! Just had a few comments regarding code style, other than that functionality, structure, finalization everything rocks! Also generally one thing I noticed in the PR, there are no return types for your functions. Please add return types for each function
const function = (): void => {...}
src/services/api/chatbot.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not sure if APIError should be placed in here. Would be grateful for feedback!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wanted to rename QueryResponse "response" field to "text" so that the call would be "response.text". But interestingly renaming it (and all its occurences) caused the system to fail when trying to interact with the chatbot.
✅ Deploy Preview for wfp-hungermap ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome job! Still few remarks and feedback to be applied, but this PR is big, so we merge it and create smaller PRs for the features and finalizations later
Sorry for later PR, it took some time to refactoring the style issue: especially remove inline style and use tailwind css, it goes smoothly when bug in tailwind config fixed.
There are some points:
Regarding backend integration part @ahmtslmngcl will also plan to refactoring sth, I'm not if you need do it in this branch or open a new ticket
Typing animation is still pending, current implementation could be delete later, if text is render als markdown from backend side, we will change this component and logic
Add some css definition into global.css related to waiting AI response animation, I hope it is not big issue.
Since there are a lot custom style variable related to Chatbot, so a lot of customisation has also been added to the tailwind config
Since not all icons could be found in iconsax-react, so there is still other package be used.