exa-ai-ruby 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '008d104475020256c6b98da4d1dd4cd6bf84885a361c14cfa19d7779e2203b16'
4
- data.tar.gz: cd8c86364e8409b63028d8b4fb8d8318c7448c6a6dc9d3409cfeb3caf78415c8
3
+ metadata.gz: 66972bcd1f042b148cd8dc5f004dad3fa38d0a2f242ba8727ded974866cb502c
4
+ data.tar.gz: d4cc2dada13aa407b22fbb168cc9683b8018c8ae3b75f386c5fe7f85bc624a1c
5
5
  SHA512:
6
- metadata.gz: 95ce4e0badfa1a4c58a7589e309911bdbb0891baf6b4e0cb7151915a3ac7e785b2a29279e7e1fe5ebf8c1eebec349f5b8911be84ba03aa87270bbe6e546a1735
7
- data.tar.gz: 62076fc7340a68aee5def9e73ea0c4f65f4a03a6b03aae4fa377c3dfca7ff17ef0487411fe188a8588e264b36e826e57a44d88e2092bb8ba05f1cb2e9ed4fbcf
6
+ metadata.gz: 9ded95dff3837d3c2e827468bdca4d300d802ac318357d0b1b4ced3946a0578ec4c9eb4d97daeb5cf0f4cf3fe1199444a6f95b02caf5ae6aa6a9d512f5773d7f
7
+ data.tar.gz: cc208c8492d43dc2a48d9072e5d402d24de5fee3945e5db60dcc761755332c54168d3dc77a3eda3b22e39af937ee20df57e932d308116e746f76835ca4419b3f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.2.2] - 2025-12-22
4
+ - **BUGFIX**: Fix text/highlights/summary/context extraction in search results.
5
+ - The Exa API requires these options to be wrapped in a `contents` object.
6
+ - Previously, passing `text: true` or `text: {max_characters: 1000}` would silently return no text.
7
+ - Now correctly serializes to `{"contents": {"text": ...}}` as the API expects.
8
+
3
9
  ## [1.2.0] - 2025-10-31
4
10
  - Add `Exa::Internal::Transport::AsyncRequester`, enabling optional fiber-scheduler-friendly HTTP via the `async` ecosystem.
5
11
  - Document async usage in the README with Gemfile requirements and concurrent request example.
@@ -61,13 +61,33 @@ module Exa
61
61
  const :image_links, T.nilable(Integer)
62
62
  end
63
63
 
64
+ # Content options that get wrapped in a `contents` object for the API
65
+ CONTENT_OPTION_KEYS = %i[text highlights summary context].freeze
66
+
64
67
  class SearchRequest < T::Struct
65
68
  include StructWrapper
66
69
  include SearchOptionProps
67
70
  const :query, String
68
71
 
69
72
  def to_payload
70
- Serializer.to_payload(self)
73
+ payload = Serializer.to_payload(self)
74
+ wrap_contents_options(payload)
75
+ end
76
+
77
+ private
78
+
79
+ def wrap_contents_options(payload)
80
+ contents = {}
81
+
82
+ CONTENT_OPTION_KEYS.each do |key|
83
+ camel_key = Serializer.camelize(key)
84
+ next unless payload.key?(camel_key)
85
+
86
+ contents[camel_key] = payload.delete(camel_key)
87
+ end
88
+
89
+ payload["contents"] = contents unless contents.empty?
90
+ payload
71
91
  end
72
92
  end
73
93
  end
data/lib/exa/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Exa
4
- VERSION = "1.2.1"
4
+ VERSION = "1.2.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exa-ai-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vicente Reig Rincon de Arellano