feature: detection of similar questions on new question created event… #1125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is linked to issue (#991).
it seems the initial idea is impossible to solve (significant challenge for a small purpose), but I found a way to do it under the OpenAI integration. i'd like to give a recap about the approaches ive followed:
Initial Idea :
Fetching messages from the server itself and compute 5 top links based on given criteria. This approach was found to be inadequate due to the high volume of responses and lack of message quality indicators such as upvotes or marked correct answers.
To External Resources :
To improve the quality of responses, i've explored fetching relevant links from Google and Stack Exchange API. While this provided some relevant results, it was challenging to filter out irrelevant links and manage long query strings effectively with previous Discord constraints.
Final Solution: Appending References to AI Generated Responses :
To address these challenges, I implemented an easy solution that combines AI-generated answers with references to reliable external links. by appending a small msg, to include up to five relevant links from reliable websites at the end of the response.
Screenshot :
![image](https://private-user-images.githubusercontent.com/37019463/335813066-cb0a0c92-9640-44d5-b34b-145781ca23a4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwMTU5ODcsIm5iZiI6MTcyNDAxNTY4NywicGF0aCI6Ii8zNzAxOTQ2My8zMzU4MTMwNjYtY2IwYTBjOTItOTY0MC00NGQ1LWIzNGItMTQ1NzgxY2EyM2E0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDIxMTQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZlYmIwOTAzYjBhMTZkZGQ1YTE0ZWIwYjUzMjAwNmU4ZWE3NTE2ODRjMjg4OTBkYzNkOTEzNmNhYmQwNTY5OGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.DrHNjRgTX4k10tkBKFzVyIZbUSHM5IM4NfdUkJ8o15w)