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

inconsistency in titles generated by GPT #1134

Open
ankitsmt211 opened this issue Jul 1, 2024 · 2 comments
Open

inconsistency in titles generated by GPT #1134

ankitsmt211 opened this issue Jul 1, 2024 · 2 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers valid This issue/PR is validated and ready to be picked. This auto adds items to TJ project board.

Comments

@ankitsmt211
Copy link
Member

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 ankitsmt211 added bug Something isn't working good first issue Good for newcomers valid This issue/PR is validated and ready to be picked. This auto adds items to TJ project board. labels Jul 1, 2024
@arslanaka
Copy link

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

@Taz03
Copy link
Member

Taz03 commented Jul 2, 2024

@arslanaka remove the prompt check and add a manual check #1059 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers valid This issue/PR is validated and ready to be picked. This auto adds items to TJ project board.
Projects
Status: Ready
Development

No branches or pull requests

3 participants