### ----------------------------------------------------
### -- LLM::Prompts
### -- Licenses: Artistic-2.0
### -- Authors: Anton Antonov
### -- File: t/01-basic-usage.rakutest
### ----------------------------------------------------
use v6.d;
use Test;

use LLM::Prompts;

plan *;

## 1
ok ingest-prompt-data();

## 2
isa-ok llm-prompt-data(), Hash;

## 3
isa-ok llm-prompt-categories(), Positional;

## 4
isa-ok llm-prompt-topics(), Positional;

## 5
isa-ok llm-prompt('FTFY'), Callable;

## 6
isa-ok llm-prompt-dataset():f, Array;

## 7
isa-ok llm-prompt-dataset():compact, Array;

## 8
isa-ok llm-prompt-dataset():personas, Array;

## 9
isa-ok llm-prompt-dataset():modifiers, Array;

## 10
is-deeply llm-prompt-dataset():modifiers, llm-prompt-dataset():m;

## 11
is-deeply llm-prompt-dataset():functions, llm-prompt-dataset():f;

## 12
is-deeply llm-prompt-dataset():personas, llm-prompt-dataset():p;

## 13
is-deeply
        llm-prompt-dataset(:m,:c).map({ $_<Name> => $_ }).Hash,
        llm-prompt-dataset(:modifiers,:compact).map({ $_<Name> => $_ }).Hash;

## 14
isa-ok llm-prompt-data(fields => 'Description'), Hash;

## 15
isa-ok llm-prompt-data(fields => <Description URL>), Hash;

## 16
isa-ok llm-prompt-data(/ Em /), Hash;

## 17
is llm-prompt-data(/ Em /, fields => 'PromptText').values.all ~~ Str, True;

## 18
dies-ok { llm-prompt-data(/ Em /, fields => 'BlahBlah') };

## 19
isa-ok llm-prompt-data('Translated'), Hash;

## 20
isa-ok llm-prompt-data('Translated', <Description PromptText>), Hash;

## 21
isa-ok llm-prompt-data(:pairs), Hash;

## 22
isa-ok llm-prompt-data(:!pairs), Hash;

## 23
isa-ok llm-prompt-data(fields => <Description URL>, :pairs), Hash;

done-testing;


