From 31e53046bd35b83027f8a8e1ab99a6eceb4e6a3c Mon Sep 17 00:00:00 2001 From: icebaker Date: Mon, 8 Jan 2024 21:41:30 -0300 Subject: adding support to markdown cartridges --- spec/logic/cartridge/parser_spec.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 spec/logic/cartridge/parser_spec.rb (limited to 'spec/logic') diff --git a/spec/logic/cartridge/parser_spec.rb b/spec/logic/cartridge/parser_spec.rb new file mode 100644 index 0000000..f8d1302 --- /dev/null +++ b/spec/logic/cartridge/parser_spec.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +require_relative '../../../logic/cartridge/parser' + +RSpec.describe NanoBot::Logic::Cartridge::Parser do + context 'markdown' do + let(:raw) { File.read('spec/data/cartridges/markdown.md') } + + it 'parses markdown cartridge' do + expect(described_class.parse(raw, format: 'md')).to eq( + { meta: { + symbol: '🤖', + name: 'ChatGPT 4 Turbo', + author: 'icebaker', + version: '0.0.1', + license: 'CC0-1.0', + description: 'A helpful assistant.' + }, + behaviors: { interaction: { directive: 'You are a helpful assistant.' } }, + provider: { + id: 'openai', + credentials: { 'access-token': 'ENV/OPENAI_API_KEY' }, + settings: { + user: 'ENV/NANO_BOTS_END_USER', + model: 'gpt-4-1106-preview' + } + } } + ) + end + end +end -- cgit v1.2.3