summaryrefslogtreecommitdiff
path: root/spec/logic/cartridge
diff options
context:
space:
mode:
authoricebaker <icebaker@proton.me>2024-01-08 21:41:30 -0300
committericebaker <icebaker@proton.me>2024-01-08 21:41:30 -0300
commit31e53046bd35b83027f8a8e1ab99a6eceb4e6a3c (patch)
treed13179fb7eb91db4e70a97c96f24889b3153c451 /spec/logic/cartridge
parent819381e7bd3e3ca5d310ad0a29b6925dcfa26720 (diff)
adding support to markdown cartridges
Diffstat (limited to 'spec/logic/cartridge')
-rw-r--r--spec/logic/cartridge/parser_spec.rb31
1 files changed, 31 insertions, 0 deletions
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