FIX: triage no longer working with claude (#369)

This commit is contained in:
Sam 2023-12-20 07:58:38 +11:00 committed by GitHub
parent 5a84969c96
commit 8664771b7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -31,12 +31,19 @@ module DiscourseAi
result = nil result = nil
llm = DiscourseAi::Completions::Llm.proxy(model) llm = DiscourseAi::Completions::Llm.proxy(model)
key =
if model.include?("claude")
:max_tokens_to_sample
else
:max_tokens
end
prompt = { prompt = {
insts: filled_system_prompt, insts: filled_system_prompt,
params: { params: {
model => { model => {
max_tokens: (llm.tokenizer.tokenize(search_for_text).length * 2 + 10), key => (llm.tokenizer.tokenize(search_for_text).length * 2 + 10),
temperature: 0, :temperature => 0,
}, },
}, },
} }