sema-docs 1.21.2

Canonical structured documentation for Sema builtins/special forms; powers LSP hover/completion and REPL apropos
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
---
name: "llm/classify"
module: "llm"
params: [{ name: categories }, { name: text, type: string }, { name: opts, type: map }]
returns: "keyword or string"
---

Classify text into exactly one of the given categories. The first argument is a sequence of category names (keywords or strings); the model is told to respond with only the matching category name. Returns a keyword if the matched category was supplied as a keyword, otherwise a string. The opts map accepts `:model`.

```sema
(llm/classify [:positive :negative :neutral] "I absolutely love this product!")
; => :positive
```