### ----------------------------------------------------
### -- ML::FindTextualAnswer
### -- Licenses: Artistic-2.0
### -- Authors: Anton Antonov
### -- File: xt/05-llm-classify.rakutest
### ----------------------------------------------------
use v6.d;

# use lib <. ./lib>;

use ML::FindTextualAnswer;
use Test;

my @queries = [
    'Make a classifier with the method RandomForest over the data dfTitanic; show precision and accuracy; plot True Positive Rate vs Positive Predictive Value.',
    'Make a recommender over the data frame dfOrders. Give the top 5 recommendations for the profile year:2022, type:Clothing, and status:Unpaid',
    'Create an LSA object over the text colletion aAbstracts; extract 40 topics; show statistical thesaurus for "notebook", "equation", "changes", and "prediction"',
    'Compute quantile regression for dfTS with interpolation order 3 and knots 12 for the probabilities 0.2, 0.4, and 0.9.'
];

my @wkflTypes = ('Classification', 'Latent Semantic Analysis', 'Quantile Regression', 'Recommendations').sort;

plan *;

## 1
#note llm-classify(@queries.head, @wkflTypes):echo;
isa-ok llm-classify(@queries.head, @wkflTypes), Str;

## 2
#note llm-classify(@queries.head, @wkflTypes):echo;
isa-ok llm-classify(@queries.head, @wkflTypes, temperature => 0.1), Str;

## 3
isa-ok llm-classify(@queries.head, @wkflTypes, :echo), Str;

## 4
isa-ok llm-classify(@queries.head, @wkflTypes, llm-evaluator => 'PaLM', max-tokens => 30), Str;

## 5
isa-ok llm-classify(@queries.head, @wkflTypes, e => 'PaLM'), Str;

## 6
isa-ok llm-classify(@queries, @wkflTypes), Iterable;

done-testing;


