Skip to content

Commit

Permalink
fix: remove llm_choice
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante committed Dec 14, 2023
1 parent d63c7ae commit 33a89ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .grit/patterns/universal/ai/ai.grit
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ language universal

// Given a question and a list of choices,
function ai_ask($question, $choices) {
$choice_text = join($choices, `, `),
// $choice_text = join($choices, `, `),
$messages = [
{
role: "system",
content: `Answer all questions with a single word. Choices: $choice_text`
content: `Answer all questions with a single word.`
},
{
role: "user",
content: $question
}
],
$answer = llm_choice($messages, $choices),
$answer = llm_chat($messages, pattern=$choices),
return $answer
}

Expand Down
2 changes: 1 addition & 1 deletion .grit/patterns/universal/ai/ai_choose_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tags: #ai, #sample, #util, #hidden
language js
`function ($args) { $body }` as $func where {
$name = ai_ask(choices=["adder", "remover", "divider"], question=`What should I name the function? $func`)
$name = ai_ask(question=`Should this function be an adder, divider, or remover? $func`, choices=or {`adder`, `divider`, `remover`})
} => `// This function: $name
$func`
Expand Down

0 comments on commit 33a89ae

Please sign in to comment.