Together-Java / TJ-Bot

TJ-Bot is a Discord Bot used on the Together Java server. It is maintained by the community, anyone can contribute.
https://togetherjava.org
GNU General Public License v3.0
101 stars 86 forks source link

feature: detection of similar questions on new question created event… #1125

Open firasrg opened 4 months ago

firasrg commented 4 months ago

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

sonarcloud[bot] commented 4 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud