-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29a92e2
commit dff0ace
Showing
3 changed files
with
70 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe GenAI::Result do | ||
subject do | ||
described_class.new(provider: :open_ai, model: 'gpt-3.5-turbo', raw: {}, values: ['The capital of Turkey is Ankara.']) | ||
end | ||
|
||
describe '#value' do | ||
it 'returns raw value' do | ||
expect(subject.value).to eq('The capital of Turkey is Ankara.') | ||
end | ||
|
||
it 'returns base64 value' do | ||
expect(subject.value(:base64)).to eq("VGhlIGNhcGl0YWwgb2YgVHVya2V5IGlzIEFua2FyYS4=\n") | ||
end | ||
end | ||
|
||
describe '#prompt_tokens' do | ||
it 'returns prompt tokens' do | ||
expect(subject.prompt_tokens).to eq(nil) | ||
end | ||
end | ||
|
||
describe '#completion_tokens' do | ||
it 'returns completion tokens' do | ||
expect(subject.completion_tokens).to eq(nil) | ||
end | ||
end | ||
|
||
describe '#total_tokens' do | ||
it 'returns total tokens' do | ||
expect(subject.total_tokens).to eq(nil) | ||
end | ||
end | ||
end |