ChatGPT integration

Large language models can be helpful to human beings when they encounter internet hoax.

[!NOTE] This document now only contains implementation detail.

Original use cases and related research has been moved to https://g0v.hackmd.io/@cofacts/rd/%2FmU8qi721RZeAQ9PDfj7XRA

Scenario #1: point out suspicious points

For scenario #1 identified in the research document, the ChatGPT response on critical thinking of the forwarded messages are called “AI replies”.

Chatbot

When to create AI reply:

Can implement a getOrCreateAiReply(articleId) helper function for the following scenarios.

After searching a message that has not been replied yet

https://www.figma.com/proto/1tiXCGut4kNCEkDG9FTza7/LINE-Chat-UI-Template-(Community)?page-id=208%3A844&node-id=302-1236&viewport=294%2C-41%2C0.53&scaling=scale-down

After submitting a new message to database

(Note: this does not apply if we decide to only generate AI replies for messages with >=2 reply requests.)

https://www.figma.com/proto/1tiXCGut4kNCEkDG9FTza7/LINE-Chat-UI-Template-(Community)?page-id=208%3A844&node-id=339-1260&viewport=334%2C-393%2C0.53&scaling=scale-down

After voting a reply as not useful

Nice-to-have

Site

https://www.figma.com/file/DvmAQjMJCncuPORWKnljM1/Cofacts-LIFF-and-new-designs?node-id=5133-543&t=sml0QRW7fnGr8xfV-4

Display an extra section when all of the below is satisfied:

Discussion

[!TIP] 2023/3/22 meeting:

  • Pick left design (differentiate user reply & AI reply)
  • Always show ChatGPT section
    • Collapse when have human reply

Elasticsearch

New index: airesponses

Fields

New index: airesponsefeedbacks

API

New AIResponse object type

Exposes the fields in elasticsearch index airesponses.

Also:

New AIResponseFeedback object type

Exposes fields in elasticsearch index airesponsefeedbacks.

New mutation createAIReply

Generates new AI response doc that points to an article.

(If we will have other AI responses in the future, use another mutation,)

Inputs

Output AIResponse object.

New mutation createOrUpdateAiResponseFeedback

Inputs

Outputs AiResponse object.

New query ListAIResponses

New query ListAIResponseFeedbacks

Article object type

Roadmap

Phase 0: preparation

Phase 1: AI reply

Phase 2: Feedbacks for the AI reply

Scenario #1 extended: Provide search keywords

[!WARNING] Priority: As discussed on 2023/4/12, we will implement keyword first, then feedbacks for AI reply.

  • Evaluation can come later, get BETA version of keywords first [name=bil]

chatbot: https://www.figma.com/proto/1tiXCGut4kNCEkDG9FTza7/LINE-Chat-UI-Template-(Community)?node-id=302-1236&scaling=scale-down&page-id=208%3A844 website: https://www.figma.com/file/DvmAQjMJCncuPORWKnljM1/Cofacts-LIFF-and-new-designs?node-id=5163-546&t=nHTu1xJbgYP5rEao-4