FEATURE: Tweaks to Anthropic Summarization (#138)

* FEATURE: Tweaks to Anthropic Summarization

* fix specs
This commit is contained in:
Rafael dos Santos Silva 2023-08-16 15:09:52 -03:00 committed by GitHub
parent 0738f67fa4
commit 49f2453c2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,7 @@ module DiscourseAi
Models::OpenAi.new("gpt-3.5-turbo-16k", max_tokens: 16_384),
Models::Discourse.new("long-t5-tglobal-base-16384-book-summary", max_tokens: 16_384),
Models::Anthropic.new("claude-2", max_tokens: 100_000),
Models::Anthropic.new("claude-instant-1", max_tokens: 100_000),
Models::Llama2.new("Llama2-chat-hf", max_tokens: SiteSetting.ai_hugging_face_token_limit),
Models::Llama2FineTunedOrcaStyle.new(
"StableBeluga2",

View File

@ -66,6 +66,8 @@ module DiscourseAi
base_prompt = <<~TEXT
Human: #{initial_instruction}
Try to keep the summary in the same languague as the forum discussion.
Format the response, including links, using markdown.
Include only the summary inside <ai> tags.
TEXT

View File

@ -23,6 +23,8 @@ RSpec.describe DiscourseAi::Summarization::Models::Anthropic do
def expected_messages(contents, opts)
base_prompt = <<~TEXT
Human: Summarize the following forum discussion inside the given <input> tag.
Try to keep the summary in the same languague as the forum discussion.
Format the response, including links, using markdown.
Include only the summary inside <ai> tags.
Try generating links as well the format is #{opts[:resource_path]}.
The discussion title is: #{opts[:content_title]}.
@ -102,6 +104,8 @@ RSpec.describe DiscourseAi::Summarization::Models::Anthropic do
instructions = <<~TEXT
Human: Summarize the following forum discussion inside the given <input> tag.
Try to keep the summary in the same languague as the forum discussion.
Format the response, including links, using markdown.
Include only the summary inside <ai> tags.
Try generating links as well the format is #{opts[:resource_path]}.
The discussion title is: #{opts[:content_title]}.