TJ-Bot icon indicating copy to clipboard operation
TJ-Bot copied to clipboard

inconsistency in titles generated by GPT

Open ankitsmt211 opened this issue 1 year ago • 2 comments

Describe the bug

image

as shown in the screenshot, title is quoted sometimes when question is transfered via TransferQuestionCommand, mainly due to inconsistency in response from GPT. Expected behavior

Title shouldnt have any quotation marks

Additional context

 String chatGptPrompt =
                "Summarize the following text into a concise title or heading not more than 4-5 words, remove quotations if any: %s"
                    .formatted(originalMessage);
        Optional<String> chatGptResponse = chatGptService.ask(chatGptPrompt, "");
        String title = chatGptResponse.orElse(createTitle(originalMessage));
        if (title.length() > TITLE_MAX_LENGTH) {
            title = title.substring(0, TITLE_MAX_LENGTH);
        }

Above piece of code is responsible for generating title in TransferQuestionCommand#onMessageContext, to solve this issue instead of directly assigning generated text from GPT as title, it should be santized by removing quotations if present.

ankitsmt211 avatar Jul 01 '24 19:07 ankitsmt211

I'd like to work on this, assign it to me.

arslanaka avatar Jul 01 '24 22:07 arslanaka

@arslanaka remove the prompt check and add a manual check https://github.com/Together-Java/TJ-Bot/pull/1059#issuecomment-2017473576

Taz03 avatar Jul 02 '24 09:07 Taz03

I'd like to work on it, assign this to me

prudhvi891 avatar Nov 10 '24 07:11 prudhvi891

I'd like to work on it, assign this to me.

billpapat avatar Jun 28 '25 15:06 billpapat

Will remove assignment from previous contributors due to a lack of activity and give @billpapat a chance to implement this.

christolis avatar Jun 28 '25 16:06 christolis

From what I am understanding, @billpapat would like to work on this issue, however they have no OpenAI key to be able to test any changes made and they claim that the free version of the OpenAI key that they can make does not have enough tokens for what they would like to test. For that reason, I will temporarily remove the assignment from them. If anybody else would like to work on this, feel free :)

christolis avatar Jun 30 '25 22:06 christolis

From what I am understanding, @billpapat would like to work on this issue, however they have no OpenAI key to be able to test any changes made and they claim that the free version of the OpenAI key that they can make does not have enough tokens for what they would like to test. For that reason, I will temporarily remove the assignment from them. If anybody else would like to work on this, feel free :)

We have an OpenApi key for everyone to use, exactly for that reason. Check the pins in tj-bot-discussion 🙂 Helps to read the example config 👍

"openaiApiKey": "<check pins in #tjbot_discussion for the key>",

Zabuzard avatar Jul 01 '25 06:07 Zabuzard

Is this still an issue? Seems transferred questions no longer show with quotation marks

discorddioxin avatar Aug 25 '25 02:08 discorddioxin

Yeah I believe Ive fixed it when I touched the GPT-code a few weeks ago.

Zabuzard avatar Aug 25 '25 06:08 Zabuzard

Fixed in #1262

Zabuzard avatar Aug 25 '25 06:08 Zabuzard

Nevermind. Still an issue apparently. See PROD:

example

Zabuzard avatar Aug 28 '25 12:08 Zabuzard

Are anyone working on this issue?

dp7teen avatar Oct 10 '25 10:10 dp7teen

Are anyone working on this issue?

I will check this problem at ~ 16:00 today.

billpapat avatar Oct 10 '25 10:10 billpapat

Hello, i would like to contribute by solving this issue

Bobi222 avatar Oct 10 '25 17:10 Bobi222

Sure thing! Best of lucks

billpapat avatar Oct 10 '25 17:10 billpapat