repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_websearch.rb | spec/support/adapters/chat_requests_with_websearch.rb | require 'spec_helper'
RSpec.shared_examples 'chat requests with web search' do | options = {} |
# note that there is no practical way to determine if a web search happen except to verify citations
# so the expectation of the adapter is that it will enable citations
context 'where there is one message which req... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests_with_tools.rb | spec/support/adapters/stream_requests_with_tools.rb | require 'spec_helper'
require 'debug'
RSpec.shared_examples 'stream requests with tools' do | options = {} |
let( :get_location_tool ) {
Intelligence::Tool.build! do
name :get_location
description \
"The get_location tool will return the users city, state or province and country."
end... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_tools.rb | spec/support/adapters/chat_requests_with_tools.rb | require 'spec_helper'
require 'debug'
RSpec.shared_examples 'chat requests with tools' do | options = {} |
let( :get_location_tool ) {
Intelligence::Tool.build! do
name :get_location
description \
"The get_location tool will return the users city, state or province and country."
end
... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests_with_stop_sequence.rb | spec/support/adapters/stream_requests_with_stop_sequence.rb | require 'spec_helper'
RSpec.shared_examples 'stream requests with stop sequence' do | options = {} |
context 'where there is a single message that ends at stop sequence' do
it 'streams generated text up to the stop sequence' do
conversation = create_conversation( "count to twenty in words, all lower ca... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_invalid_key.rb | spec/support/adapters/chat_requests_with_invalid_key.rb | require 'spec_helper'
RSpec.shared_examples 'chat requests with invalid key' do | options = {} |
context 'where the adapter is configured with an invalid key' do
it 'responds with an appropriate error' do
response = create_and_make_chat_request(
send( options[ :adapter ] || :adapter_with_invalid_... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests_with_binary_encoded_images.rb | spec/support/adapters/stream_requests_with_binary_encoded_images.rb | require 'spec_helper'
RSpec.shared_examples 'stream requests with binary encoded images' do | options = {} |
let( :binary_content_of_red_balloon ) {
build_binary_content( fixture_file_path( 'single-red-balloon.png' ) )
}
let( :binary_content_of_three_balloons ) {
build_binary_content( fixture_file_pat... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_binary_encoded_images.rb | spec/support/adapters/chat_requests_with_binary_encoded_images.rb | require 'spec_helper'
RSpec.shared_examples 'chat requests with binary encoded images' do | options = {} |
let( :binary_content_of_red_balloon ) {
build_binary_content( fixture_file_path( 'single-red-balloon.png' ) )
}
let( :binary_content_of_three_balloons ) {
build_binary_content( fixture_file_path(... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests_with_websearch.rb | spec/support/adapters/stream_requests_with_websearch.rb | require 'spec_helper'
RSpec.shared_examples 'stream requests with web search' do | options = {} |
# note that there is no practical way to determine if a web search happen except to verify citations
# so the expectation of the adapter is that it will enable citations
context 'where there is one message which re... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests_with_parallel_tools.rb | spec/support/adapters/stream_requests_with_parallel_tools.rb | require 'spec_helper'
require 'debug'
RSpec.shared_examples 'stream requests with parallel tools' do | options = {} |
let( :get_weather_tool ) {
Intelligence::Tool.build! do
name :get_weather
description "The get_weather tool will return the current weather in a given locality."
argument nam... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests.rb | spec/support/adapters/stream_requests.rb | require 'spec_helper'
RSpec.shared_examples 'stream requests' do
context 'where there is no system message' do
context 'where there is a single message' do
it 'streams the appropriate generated text' do
conversation = create_conversation_without_system_message( "respond only with the word 'hell... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_parallel_tools.rb | spec/support/adapters/chat_requests_with_parallel_tools.rb | require 'spec_helper'
require 'debug'
RSpec.shared_examples 'chat requests with parallel tools' do | options = {} |
let( :get_weather_tool ) {
Intelligence::Tool.build! do
name :get_weather
description "The get_weather tool will return the current weather in a given locality."
argument name:... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests_with_tools_multiturn.rb | spec/support/adapters/stream_requests_with_tools_multiturn.rb | require 'spec_helper'
require 'debug'
RSpec.shared_examples 'stream requests with tools multiturn' do | options = {} |
let( :get_location_tool ) {
Intelligence::Tool.build! do
name :get_location
description \
"The get_location tool will return the users city, state or province and country... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_binary_encoded_text.rb | spec/support/adapters/chat_requests_with_binary_encoded_text.rb | require 'spec_helper'
RSpec.shared_examples 'chat requests with binary encoded text' do
let( :binary_content_of_text_file ) {
build_binary_content( fixture_file_path( 'this-is-a-test.txt' ) )
}
let( :binary_content_of_universe_text_file ) {
build_binary_content( fixture_file_path( 'universe.txt' ) )
... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_invalid_model.rb | spec/support/adapters/chat_requests_with_invalid_model.rb | require 'spec_helper'
RSpec.shared_examples 'chat requests with invalid model' do | options = {} |
context 'where the adapter is configured with an invalid model' do
it 'responds with an appropriate error' do
response = create_and_make_chat_request(
send( options[ :adapter ] || :adapter_with_inva... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_file_images.rb | spec/support/adapters/chat_requests_with_file_images.rb | require 'spec_helper'
RSpec.shared_examples 'chat requests with file images' do | options = {} |
let( :file_content_of_red_balloon ) {
Intelligence::MessageContent::File.build do
uri "https://github.com/EndlessInternational/intelligence/blob/main/spec/fixtures/files/single-red-balloon.png?raw=true"
... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests_with_token_limit_exceeded.rb | spec/support/adapters/stream_requests_with_token_limit_exceeded.rb | require 'spec_helper'
RSpec.shared_examples 'stream requests with token limit exceeded' do | options = {} |
context 'where there is a single message the response to which will exceed the token limit' do
it 'streams limited text and an end reason which indicates that the token limit was exceeded' do
con... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests_without_alternating_roles.rb | spec/support/adapters/stream_requests_without_alternating_roles.rb | require 'spec_helper'
RSpec.shared_examples 'stream requests without alternating roles' do
context 'where there are two messages with the same role in a sequence' do
it 'streams the appropriate generated text' do
conversation = create_conversation(
"the word to remember is 'blue'\n",
"... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests_with_binary_encoded_audio.rb | spec/support/adapters/stream_requests_with_binary_encoded_audio.rb | require 'spec_helper'
RSpec.shared_examples 'stream requests with binary encoded audio' do
let( :binary_content_of_test_audio_file ) {
build_binary_content( fixture_file_path( 'this-is-a-test.mp3' ) )
}
let( :binary_content_of_hello_world_audio_file ) {
build_binary_content( fixture_file_path( 'hello... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_token_limit_exceeded.rb | spec/support/adapters/chat_requests_with_token_limit_exceeded.rb | require 'spec_helper'
RSpec.shared_examples 'chat requests with token limit exceeded' do | options = {} |
context 'where there is a single message the response to which will exceed the token limit' do
it 'responds with limited text and an end reason which indicates that the token limit was exceeded' do
... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests_with_calculator_tool.rb | spec/support/adapters/stream_requests_with_calculator_tool.rb | require 'spec_helper'
require 'debug'
require 'dentaku'
RSpec.shared_examples 'stream requests with calculator tool' do | options = {} |
def calculator( arguments )
if arguments.is_a?( String )
begin
arguments = JSON.parse( arguments )
rescue
raise RuntimeError,
"The ... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_without_alternating_roles.rb | spec/support/adapters/chat_requests_without_alternating_roles.rb | require 'spec_helper'
RSpec.shared_examples 'chat requests without alternating roles' do
context 'where there are two messages with the same role in a sequence' do
it 'responds with the appropriate generated text' do
conversation = create_conversation(
"the word you should remember is 'blue'\n... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_calculator_tool.rb | spec/support/adapters/chat_requests_with_calculator_tool.rb | require 'spec_helper'
require 'debug'
require 'dentaku'
RSpec.shared_examples 'chat requests with calculator tool' do | options = {} |
def calculator( arguments )
if arguments.is_a?( String )
begin
arguments = JSON.parse( arguments )
rescue
raise RuntimeError,
"The pa... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_adapter_tools.rb | spec/support/adapters/chat_requests_with_adapter_tools.rb | require 'spec_helper'
require 'debug'
RSpec.shared_examples 'chat requests with adapter tools' do | options = {} |
context 'where there is a single message and a single tool' do
it 'responds with a tool request' do
response = nil
conversation = create_conversation( "Where am I located?\n" )
r... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests_with_binary_encoded_text.rb | spec/support/adapters/stream_requests_with_binary_encoded_text.rb | require 'spec_helper'
RSpec.shared_examples 'stream requests with binary encoded text' do
let( :binary_content_of_text_file ) {
build_binary_content( fixture_file_path( 'this-is-a-test.txt' ) )
}
let( :binary_content_of_universe_text_file ) {
build_binary_content( fixture_file_path( 'universe.txt' ) ... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests_with_file_images.rb | spec/support/adapters/stream_requests_with_file_images.rb | require 'spec_helper'
RSpec.shared_examples 'stream requests with file images' do | options = {} |
let( :file_content_of_red_balloon ) {
Intelligence::MessageContent::File.build do
uri "https://github.com/EndlessInternational/intelligence/blob/main/spec/fixtures/files/single-red-balloon.png?raw=true"
... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_tools_multiturn.rb | spec/support/adapters/chat_requests_with_tools_multiturn.rb | require 'spec_helper'
require 'debug'
RSpec.shared_examples 'chat requests with tools multiturn' do | options = {} |
let( :get_location_tool ) {
Intelligence::Tool.build! do
name :get_location
description \
"The get_location tool will return the users city, state or province and country."... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_thought.rb | spec/support/adapters/chat_requests_with_thought.rb | require 'spec_helper'
RSpec.shared_examples 'chat requests with thought' do | options = {} |
context 'where there is a message which requires thought' do
it 'responds with the appropriate generated text' do
conversation = create_conversation(
"Given a triangle ABC with angle A 60 degrees and ... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests_with_thought.rb | spec/support/adapters/stream_requests_with_thought.rb | require 'spec_helper'
RSpec.shared_examples 'stream requests with thought' do | options = {} |
# note that there is no practical way to determine if a web search happen except to verify citations
# so the expectation of the adapter is that it will enable citations
context 'where there is a message which require... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/stream_requests_with_binary_encoded_pdf.rb | spec/support/adapters/stream_requests_with_binary_encoded_pdf.rb | require 'spec_helper'
RSpec.shared_examples 'stream requests with binary encoded pdf' do | options = {} |
let( :binary_content_of_nasa_pdf_file ) {
build_binary_content( fixture_file_path( 'nasa.pdf' ) )
}
let( :binary_content_of_nasa_mars_curiosity_pdf_file ) {
build_binary_content( fixture_file_path... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_binary_encoded_pdf.rb | spec/support/adapters/chat_requests_with_binary_encoded_pdf.rb | require 'spec_helper'
RSpec.shared_examples 'chat requests with binary encoded pdf' do | options = {} |
let( :binary_content_of_nasa_pdf_file ) {
build_binary_content( fixture_file_path( 'nasa.pdf' ) )
}
let( :binary_content_of_nasa_mars_curiosity_pdf_file ) {
build_binary_content( fixture_file_path( ... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests.rb | spec/support/adapters/chat_requests.rb | require 'spec_helper'
RSpec.shared_examples 'chat requests' do
context 'where there is no system message' do
context 'where there is a single message' do
it 'responds with the appropriate generated text' do
response = nil
conversation = create_conversation_without_system_message( "resp... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_complex_tools.rb | spec/support/adapters/chat_requests_with_complex_tools.rb | require 'spec_helper'
require 'debug'
RSpec.shared_examples 'chat requests with complex tools' do | options = {} |
let( :get_complex_weather_tool ) {
Intelligence::Tool.build! do
name :get_weather
description 'The get_weather tool returns the current weather in given locality.'
argument name:... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/support/adapters/chat_requests_with_binary_encoded_audio.rb | spec/support/adapters/chat_requests_with_binary_encoded_audio.rb | require 'spec_helper'
RSpec.shared_examples 'chat requests with binary encoded audio' do
let( :binary_content_of_test_audio_file ) {
build_binary_content( fixture_file_path( 'this-is-a-test.mp3' ) )
}
let( :binary_content_of_hello_world_audio_file ) {
build_binary_content( fixture_file_path( 'hello-w... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/message_content/file_spec.rb | spec/message_content/file_spec.rb | require 'spec_helper'
require 'uri'
require 'mime/types'
RSpec.describe Intelligence::MessageContent::File do
describe '#initialize' do
context 'when attributes include uri and content_type' do
let( :attributes ) { { uri: 'http://example.com/file.txt', content_type: 'text/plain' } }
subject { descri... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/message_content/text_spec.rb | spec/message_content/text_spec.rb | require 'spec_helper'
RSpec.describe Intelligence::MessageContent::Text, :unit do
describe '#initialize' do
it 'sets @text from attributes when provided' do
attributes = { text: 'Hello, world!' }
content = described_class.new( attributes )
expect( content.text ).to eq( 'Hello, world!' )
e... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/message_content/binary_spec.rb | spec/message_content/binary_spec.rb | require 'spec_helper'
RSpec.describe Intelligence::MessageContent::Binary, :unit do
describe '#initialize' do
it 'sets @content_type and @bytes from attributes when provided' do
attributes = { content_type: 'image/png', bytes: 'binary_data_here' }
content = described_class.new( attributes )
... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/together_ai/chat_spec.rb | spec/adapters/together_ai/chat_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :together_ai ]} chat requests", :together_ai do
include_context 'vcr'
before do
raise "A TOGETHERAI_API_KEY must be defined in the environment." unless ENV[ 'TOGETHERAI_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :together_a... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/together_ai/stream_spec.rb | spec/adapters/together_ai/stream_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :together_ai ]} stream requests", :together_ai do
include_context 'vcr'
before do
raise "An TOGETHERAI_API_KEY must be defined in the environment." unless ENV[ 'TOGETHERAI_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :togeth... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/open_ai/chat_spec.rb | spec/adapters/open_ai/chat_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :open_ai ]} chat requests", :open_ai do
include_context 'vcr'
before do
raise "An OPENAI_API_KEY must be defined in the environment." unless ENV[ 'OPENAI_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :open_ai ].build! do
... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/open_ai/stream_spec.rb | spec/adapters/open_ai/stream_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :open_ai ]} stream requests", :open_ai do
include_context 'vcr'
before do
raise "An OPENAI_API_KEY must be defined in the environment." unless ENV[ 'OPENAI_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :open_ai ].build! do ... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/azure/chat_spec.rb | spec/adapters/azure/chat_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :azure ]} chat requests", :azure do
include_context 'vcr'
before do
raise "An AZURE_API_KEY must be defined in the environment." unless ENV[ 'AZURE_API_KEY' ]
raise "An AZURE_BASE_URI must be defined in the environment." unless ENV[ 'AZURE_BA... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/azure/stream_spec.rb | spec/adapters/azure/stream_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :azure ]} stream requests", :azure do
include_context 'vcr'
before do
raise "An AZURE_API_KEY must be defined in the environment." unless ENV[ 'AZURE_API_KEY' ]
raise "An AZURE_BASE_URI must be defined in the environment." unless ENV[ 'AZU... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/hyperbolic/chat_spec.rb | spec/adapters/hyperbolic/chat_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :hyperbolic ]} chat requests", :hyperbolic do
include_context 'vcr'
before do
raise "A HYPERBOLIC_API_KEY must be defined in the environment." unless ENV[ 'HYPERBOLIC_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :hyperbolic ]... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/hyperbolic/stream_spec.rb | spec/adapters/hyperbolic/stream_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :hyperbolic ]} stream requests", :hyperbolic do
before do
raise "An HYPERBOLIC_API_KEY must be defined in the environment." unless ENV[ 'HYPERBOLIC_API_KEY' ]
end
include_context 'vcr'
let( :adapter ) do
Intelligence::Adapter[ :hyperbol... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/open_ai_legacy/chat_spec.rb | spec/adapters/open_ai_legacy/chat_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :open_ai_legacy ]} chat requests", :open_ai_legacy do
include_context 'vcr'
before do
raise "An OPENAI_API_KEY must be defined in the environment." unless ENV[ 'OPENAI_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :open_ai_le... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/open_ai_legacy/stream_spec.rb | spec/adapters/open_ai_legacy/stream_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :open_ai_legacy ]} stream requests", :open_ai_legacy do
include_context 'vcr'
before do
raise "An OPENAI_API_KEY must be defined in the environment." unless ENV[ 'OPENAI_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :open_ai_... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/open_router/chat_spec.rb | spec/adapters/open_router/chat_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :open_router ]} chat requests", :open_router do
include_context 'vcr'
before do
raise "A OPENROUTER_API_KEY must be defined in the environment." unless ENV[ 'OPENROUTER_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :open_route... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/open_router/stream_spec.rb | spec/adapters/open_router/stream_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :open_router ]} stream requests", :open_router do
before do
raise "An OPENROUTER_API_KEY must be defined in the environment." unless ENV[ 'OPENROUTER_API_KEY' ]
end
include_context 'vcr'
let( :adapter ) do
Intelligence::Adapter[ :open_r... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/groq/chat_spec.rb | spec/adapters/groq/chat_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :groq ]} chat requests", :groq do
include_context 'vcr'
before do
raise "A GROQ_API_KEY must be defined in the environment." unless ENV[ 'GROQ_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :groq ].build! do
key ... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/groq/stream_spec.rb | spec/adapters/groq/stream_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :groq ]} stream requests", :groq do
include_context 'vcr'
before do
raise "An GROQ_API_KEY must be defined in the environment." unless ENV[ 'GROQ_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :groq ].build! do
key ... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/x_ai/chat_spec.rb | spec/adapters/x_ai/chat_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :x_ai ]} chat requests", :x_ai do
include_context 'vcr'
before do
raise "A XAI_API_KEY must be defined in the environment." unless ENV[ 'XAI_API_KEY' ]
end
# this is needed for x-AI test to avoid the rate limit
after( :each ) do | example ... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/x_ai/stream_spec.rb | spec/adapters/x_ai/stream_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :x_ai ]} stream requests", :x_ai do
include_context 'vcr'
before do
raise "An XAI_API_KEY must be defined in the environment." unless ENV[ 'XAI_API_KEY' ]
end
# this is needed for x-AI test to avoid the rate limit
after( :each ) do | exam... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/mistral/chat_spec.rb | spec/adapters/mistral/chat_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :mistral ]} chat requests", :mistral do
include_context 'vcr'
before do
raise "A MISTRAL_API_KEY must be defined in the environment." unless ENV[ 'MISTRAL_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :mistral ].build! do
... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/mistral/stream_spec.rb | spec/adapters/mistral/stream_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :mistral ]} stream requests", :mistral do
include_context 'vcr'
before do
raise "An MISTRAL_API_KEY must be defined in the environment." unless ENV[ 'MISTRAL_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :mistral ].build! d... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/anthropic/chat_spec.rb | spec/adapters/anthropic/chat_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :anthropic ]} chat requests", :anthropic do
include_context 'vcr'
before do
raise "An ANTHROPIC_API_KEY must be defined in the environment." unless ENV[ 'ANTHROPIC_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :anthropic ].bui... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/anthropic/stream_spec.rb | spec/adapters/anthropic/stream_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :anthropic ]} stream requests", :anthropic do
include_context 'vcr'
before do
raise "An ANTHROPIC_API_KEY must be defined in the environment." unless ENV[ 'ANTHROPIC_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :anthropic ].b... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/cerebras/chat_spec.rb | spec/adapters/cerebras/chat_spec.rb | require 'spec_helper'
RSpec.describe Intelligence::Adapter[ :cerebras ], :cerebras do
include_context 'vcr'
# this is needed for cerebras test to avoid the rate limit
after( :each ) do | example |
cassette = VCR.current_cassette
sleep 10 if cassette && cassette.new_recorded_interactions.any?
end
... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/cerebras/stream_spec.rb | spec/adapters/cerebras/stream_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :cerebras ]} stream requests", :cerebras do
include_context 'vcr'
# this is needed for cerebras test to avoid the rate limit
after( :each ) do | example |
cassette = VCR.current_cassette
sleep 10 if cassette && cassette.new_recorded_interac... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/google/chat_spec.rb | spec/adapters/google/chat_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :google ]} chat requests", :google do
include_context 'vcr'
before do
raise "An GOOGLE_API_KEY must be defined in the environment." unless ENV[ 'GOOGLE_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :google ].build! do
... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/google/stream_spec.rb | spec/adapters/google/stream_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :google ]} stream requests", :google do
include_context 'vcr'
before do
raise "An GOOGLE_API_KEY must be defined in the environment." unless ENV[ 'GOOGLE_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :google ].build! do
... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/samba_nova/chat_spec.rb | spec/adapters/samba_nova/chat_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :samba_nova ]} chat requests", :samba_nova do
include_context 'vcr'
before do
raise "A SAMBANOVA_API_KEY must be defined in the environment." unless ENV[ 'SAMBANOVA_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :samba_nova ].... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/spec/adapters/samba_nova/stream_spec.rb | spec/adapters/samba_nova/stream_spec.rb | require 'spec_helper'
RSpec.describe "#{Intelligence::Adapter[ :samba_nova ]} stream requests", :samba_nova do
include_context 'vcr'
before do
raise "An SAMBANOVA_API_KEY must be defined in the environment." unless ENV[ 'SAMBANOVA_API_KEY' ]
end
let( :adapter ) do
Intelligence::Adapter[ :samba_nova... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/google_builder.rb | examples/google_builder.rb | # this line will ensure your code can see the intelligence gem; if you have copied this example
# to another directory be sure to change the next line to: require 'intelligence'
require_relative '../lib/intelligence'
require 'debug'
# this block of code builds and configures your adapter; in this case we have chosen ... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/parallax_minimal.rb | examples/parallax_minimal.rb | require_relative '../lib/intelligence'
adapter_options = {
base_uri: 'http://localhost:4001/v1',
chat_options: {
max_tokens: 2048
}
}
adapter = Intelligence::Adapter[ :parallax ].new( adapter_options )
request = Intelligence::ChatRequest.new( adapter: adapter )
response = request.chat( ARGV[ 0 ] || 'Hell... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/openai_minimal_stream.rb | examples/openai_minimal_stream.rb | # this line will ensure your code can see the intelligence gem; if you have copied this example
# to another directory be sure to change the next line to: require 'intelligence'
require_relative '../lib/intelligence'
# this code defines the adapter options; we're adding the open ai api key from the environment
# plus... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/google_minimal.rb | examples/google_minimal.rb | # this line will ensure your code can see the intelligence gem; if you have copied this example
# to another directory be sure to change the next line to: require 'intelligence'
require_relative '../lib/intelligence'
# this code defines the adapter options; we're adding the google api key from the environment
# plus ... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/google_vision.rb | examples/google_vision.rb | # this line will ensure your code can see the intelligence gem; if you have copied this example
# to another directory be sure to change the next line to: require 'intelligence'
require_relative '../lib/intelligence'
# this line will include the mime types gem; be sure to install it: `gem install "mime-types"`
require... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/ollama_minimal.rb | examples/ollama_minimal.rb | # this line will ensure your code can see the intelligence gem; if you have copied this example
# to another directory be sure to change the next line to: require 'intelligence'
require_relative '../lib/intelligence'
# this code defines the adapter options; we're not using a key as this is a local model but we
# hav... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/anthropic_expanded_stream.rb | examples/anthropic_expanded_stream.rb | # this line will ensure your code can see the intelligence gem; if you have copied this example
# to another directory be sure to change the next line to: require 'intelligence'
require_relative '../lib/intelligence'
# this block of code builds and configures your adapter; in this case we have chosen anthropic
adapt... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/openai_minimal.rb | examples/openai_minimal.rb | # this line will ensure your code can see the intelligence gem; if you have copied this example
# to another directory be sure to change the next line to: require 'intelligence'
require_relative '../lib/intelligence'
# this code defines the adapter options; we're adding the open ai api key from the environment
# plus... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/openai_builders.rb | examples/openai_builders.rb | # this line will ensure your code can see the intelligence gem; if you have copied this example
# to another directory be sure to change the next line to: require 'intelligence'
require_relative '../lib/intelligence'
# this block of code builds and configures your adapter; in this case we have chosen open_ai
adapter... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/hyperbolic_builders.rb | examples/hyperbolic_builders.rb | # this line will ensure your code can see the intelligence gem; if you have copied this example
# to another directory be sure to change the next line to: require 'intelligence'
require_relative '../lib/intelligence'
# this block of code builds and configures your adapter; in this case we have chosen hyperbolic
adap... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/anthropic_minimal_stream.rb | examples/anthropic_minimal_stream.rb | # this line will ensure your code can see the intelligence gem; if you have copied this example
# to another directory be sure to change the next line to: require 'intelligence'
require_relative '../lib/intelligence'
# this code defines the adapter options; we're adding the anthropic api key from the environment
# pl... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/google_expanded.rb | examples/google_expanded.rb | # this line will ensure your code can see the intelligence gem; if you have copied this example
# to another directory be sure to change the next line to: require 'intelligence'
require_relative '../lib/intelligence'
# this block of code builds and configures your adapter; in this case we have chosen google
adapter ... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/openai_vision.rb | examples/openai_vision.rb | # this line will ensure your code can see the intelligence gem; if you have copied this example
# to another directory be sure to change the next line to: require 'intelligence'
require_relative '../lib/intelligence'
# this line will include the mime types gem; be sure to install it: `gem install "mime-types"`
require... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/parallax_minimal_stream.rb | examples/parallax_minimal_stream.rb | require_relative '../lib/intelligence'
adapter_options = {
base_uri: 'http://localhost:4001/v1',
chat_options: {
max_tokens: 2048,
stream: true
}
}
adapter = Intelligence::Adapter[ :parallax ].new( adapter_options )
request = Intelligence::ChatRequest.new( adapter: adapter )
response = request.stream... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/google_expanded_stream.rb | examples/google_expanded_stream.rb | # this line will ensure your code can see the intelligence gem; if you have copied this example
# to another directory be sure to change the next line to: require 'intelligence'
require_relative '../lib/intelligence'
# this block of code builds and configures your adapter; in this case we have chosen google
adapter ... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/examples/hyperbolic_vision.rb | examples/hyperbolic_vision.rb | # this line will ensure your code can see the intelligence gem; if you have copied this example
# to another directory be sure to change the next line to: require 'intelligence'
require_relative '../lib/intelligence'
# this line will include the mime types gem; be sure to install it: `gem install "mime-types"`
require... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence.rb | lib/intelligence.rb | require 'json'
require 'base64'
require 'faraday'
require 'dynamic_schema'
require 'mime-types'
require 'json/repair'
require 'intelligence/version'
require 'intelligence/utilities/deep_dup'
require 'intelligence/error'
require 'intelligence/adapter_error'
require 'intelligence/unsupported_content_error'
require '... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/chat_request.rb | lib/intelligence/chat_request.rb | module Intelligence
#
# The ChatRequestMethods module extends a Faraday request, adding the +receive_result+ method.
#
module ChatRequestMethods
def receive_result( &block )
@_intelligence_result_callback = block
end
end
#
# The ChatResponseMethods module extends a Faraday reponse, ad... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/version.rb | lib/intelligence/version.rb | module Intelligence
VERSION = "1.0.0"
end
| ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/adapter_error.rb | lib/intelligence/adapter_error.rb | module Intelligence
class AdapterError < Error;
def initialize( adapter_type, text )
adapter_class_name = adapter_type.to_s.split( '_' ).map( &:capitalize ).join
super( "The #{adapter_class_name} adapter #{text}." )
end
end
end
| ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/unsupported_content_error.rb | lib/intelligence/unsupported_content_error.rb | module Intelligence
class UnsupportedContentError < AdapterError; end
end | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/invalid_content_error.rb | lib/intelligence/invalid_content_error.rb | module Intelligence
class InvalidContentError < AdapterError; end
end
| ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/adapter.rb | lib/intelligence/adapter.rb | require_relative 'adapter/module_methods'
require_relative 'adapter/base'
module Intelligence
module Adapter
extend ModuleMethods
end
end
| ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/message_content.rb | lib/intelligence/message_content.rb | Dir[ File.join( __dir__, 'message_content', '*.rb' ) ].each do | file |
require_relative file
end
module Intelligence
module MessageContent
def self.[]( type )
type_name = type.to_s.split( '_' ).map { | word | word.capitalize }.join
klass = Intelligence.const_get( "MessageContent::#{type_n... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/message.rb | lib/intelligence/message.rb | module Intelligence
class Message
include DynamicSchema::Definable
ROLES = [ :system, :user, :assistant ]
schema do
role Symbol, required: true
content array: true, as: :contents do
type Symbol, default: :text
# note: we replicate these sc... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/chat_error_result.rb | lib/intelligence/chat_error_result.rb | module Intelligence
#
# class. ChatErrorResult
#
# The ChatErrorResult class encapsulates error result from a chat request.
#
class ChatErrorResult < ErrorResult
end
end
| ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/conversation.rb | lib/intelligence/conversation.rb | module Intelligence
class Conversation
include DynamicSchema::Definable
include DynamicSchema::Buildable
schema do
system_message default: { role: :system }, &Message.schema
message as: :messages, array: true, &Message.schema
end
attr_reader :system_message
a... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/chat_metrics.rb | lib/intelligence/chat_metrics.rb | module Intelligence
#
# class. ChatMetrics
#
# The ChatMetrics class encapsulates metrics information. These metrics include the number of
# input tokens consumed, the number of output tokens generated, the total number of tokens,
# and the duration of the request in milliseconds.
#
class ChatMetrics
... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/error_result.rb | lib/intelligence/error_result.rb | module Intelligence
class ErrorResult
# ---------------
attr_reader :error_type
attr_reader :error
attr_reader :error_description
def initialize( error_attributes )
# --------------------------------
error_attributes.each do | key, value |
instance_variable_set( "@#{key}", value... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/chat_result_choice.rb | lib/intelligence/chat_result_choice.rb | module Intelligence
class ChatResultChoice
attr_reader :message
attr_reader :end_reason
attr_reader :end_sequence
def initialize( chat_choice_attributes )
@attributes = chat_choice_attributes.dup
@end_reason = @attributes.delete( :end_reason )
@end_sequence = @attributes.delete( ... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/chat_result.rb | lib/intelligence/chat_result.rb | module Intelligence
#
# class. ChatResult
#
# The ChatResult class encapsulates a successful result to a chat or stream request. A result
# includes an array of choices ( it is an array even if there is a single choice ) and the
# metrics associated with the generation of all result choices.
#
class ... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/tool.rb | lib/intelligence/tool.rb | module Intelligence
##
# The +Tool+ class instance encpasulates a definition of a tool that may be executed by a
# model. The properies of a tool include a unique name, a comprehensive description of what
# the tool does and a set of properies that describe the arguments the tool accepts, each
# with its o... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/error.rb | lib/intelligence/error.rb | module Intelligence
class Error < StandardError; end
end | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/message_content/web_reference.rb | lib/intelligence/message_content/web_reference.rb | module Intelligence
module MessageContent
class WebReference < Base
schema do
uri URI
title String
summary String
access_date Date
end
attribute :uri, :title, :summary, :access_date
def valid?
... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/message_content/binary.rb | lib/intelligence/message_content/binary.rb | module Intelligence
module MessageContent
class Binary < Base
schema do
content_type String, required: true
bytes String, required: true
end
attribute :content_type, :bytes
def valid?
( @content_type || false ) && !MIME::Types[ @conten... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/message_content/thought.rb | lib/intelligence/message_content/thought.rb | module Intelligence
module MessageContent
class Thought < Base
schema do
text String, required: true
end
attribute :text
def valid?
true
end
end
end
end
| ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/message_content/text.rb | lib/intelligence/message_content/text.rb | module Intelligence
module MessageContent
class Text < Base
schema do
text String, required: true
end
attribute :text
def valid?
( text || false ) && text.respond_to?( :empty? ) && !text.empty?
end
end
end
end | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
EndlessInternational/intelligence | https://github.com/EndlessInternational/intelligence/blob/2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a/lib/intelligence/message_content/file.rb | lib/intelligence/message_content/file.rb | module Intelligence
module MessageContent
class File < Base
schema do
content_type String
uri URI, required: true
end
attribute :uri
def initialize( attributes = nil )
if attributes&.fetch( :uri )
attributes = attribute... | ruby | MIT | 2ea7d4c0121a2c3eb962bb6199df67d8a38cb50a | 2026-01-04T17:53:00.421273Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.