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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/exa/types/search.rb +21 -1
- data/lib/exa/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 66972bcd1f042b148cd8dc5f004dad3fa38d0a2f242ba8727ded974866cb502c
|
|
4
|
+
data.tar.gz: d4cc2dada13aa407b22fbb168cc9683b8018c8ae3b75f386c5fe7f85bc624a1c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
data/lib/exa/types/search.rb
CHANGED
|
@@ -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