### ----------------------------------------------------
### -- LLM::Functions
### -- Licenses: Artistic-2.0
### -- Authors: Anton Antonov
### -- File: xt/01-OpenAI-basic-usage.rakutest
### ----------------------------------------------------
use v6.d;

use lib '.';
use lib './lib';

use LLM::Functions;
use Text::SubParsers;

use Test;

plan *;

## 1
ok llm-configuration('openai');

## 2
my $prompt2 = "Make a recipe for the given phrase.";
ok ($prompt2 ==> llm-function(llm-evaluator => llm-configuration('openai') ))("greek salad");

## 3
ok ($prompt2 ==> llm-function(llm-evaluator => 'openai'))("greek salad");

## 4
my $res = llm-synthesize(['Give the GDP of the top 10 countries in 2020. Give the results as a JSON dictionary.'], e=>'chatgpt', form => sub-parser('JSON'):drop);
isa-ok $res, Hash;

done-testing;


