DEV: Use different feature_names for summarization strategies (#875)

This commit is contained in:
Roman Rizzi 2024-10-29 08:45:14 -03:00 committed by GitHub
parent 0f0f2a247a
commit dd404c924a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 2 deletions

View File

@ -128,10 +128,10 @@ module DiscourseAi
)
if cursor == items.length
llm.generate(prompt, user: user, feature_name: "summarize", &on_partial_blk)
llm.generate(prompt, user: user, feature_name: strategy.feature, &on_partial_blk)
else
latest_summary =
llm.generate(prompt, user: user, max_tokens: 600, feature_name: "summarize")
llm.generate(prompt, user: user, max_tokens: 600, feature_name: strategy.feature)
fold(items, latest_summary, cursor, user, &on_partial_blk)
end
end

View File

@ -42,6 +42,11 @@ module DiscourseAi
def first_summary_prompt(_input)
raise NotImplementedError
end
# We'll pass this as the feature_name when doing LLM calls.
def feature
"summarize"
end
end
end
end

View File

@ -8,6 +8,10 @@ module DiscourseAi
AiSummary.summary_types[:gist]
end
def feature
"gists"
end
def targets_data
op_post_number = 1