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

Feature: make display chunks swithable #298

Merged
merged 7 commits into from
May 27, 2024

Conversation

statefb
Copy link
Contributor

@statefb statefb commented May 7, 2024

Issue #, if available:
Closes #248

Description of changes:

  • If disabled,
    • The prompt is instructed to omit the citation
    • GET related-documents returns null
    • used_chunks in the response of GET /conversations/<conv-id> will be null

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@statefb
Copy link
Contributor Author

statefb commented May 7, 2024

image

@statefb statefb requested a review from wadabee May 13, 2024 02:41
@@ -67,6 +68,8 @@ const translation = {
sitemap:
'サイトマップのURLを指定すると、そのサイトマップ内のサイトを自動的にスクレイピングして得られた情報がナレッジとして利用されます。',
file: 'アップロードしたファイルがナレッジとして利用されます。',
citeRetrievedContexts:
'ユーザーの質問に答えるために取得したコンテキストを引用するかどうかを設定します。有効にすると、ユーザーは元のソースURLやファイルにアクセスできます。',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ON/OFF関係なくドキュメントを参考に回答を生成するので、「引用するかどうか」だと誤解を招きそうな表現です。
「引用情報として表示するかどうか」だといかがでしょうか?

@@ -45,11 +45,15 @@ def post_message(request: Request, chat_input: ChatInput):


@router.post(
"/conversation/related-documents", response_model=list[RelatedDocumentsOutput]
"/conversation/related-documents",
response_model=list[RelatedDocumentsOutput] | None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

レスポンスについて、フロントエンド側の型情報も修正をお願いします!

Comment on lines 479 to 490
<div className="mt-2">
<div className="font-semibold">
{t('bot.label.citeRetrievedContexts')}
</div>
<div className="text-sm text-aws-font-color/50">
{t('bot.help.knowledge.citeRetrievedContexts')}
</div>
<Toggle
value={displayRetrievedChunks}
onChange={setDisplayRetrievedChunks}
/>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

スイッチが下にはみ出していて収まりが悪いので、以下のように修正をお願いしますmm

image

@statefb statefb requested a review from wadabee May 27, 2024 04:22
Copy link
Contributor

@wadabee wadabee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@wadabee wadabee merged commit ef1e652 into main May 27, 2024
7 checks passed
@wadabee wadabee deleted the feature/make-display-chunks-swithable branch May 27, 2024 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Turn the returning of related documents off/on for a bot
2 participants