exa-ai 0.10.0 → 0.11.0

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: ffa1108ddff0ff951dc18d12eeef57f74020a4c0425916a394fac95e4699fef5
4
- data.tar.gz: 43c40cc61a7bee139dc3c179fe9d11c40b04dd506d53c22f88e312705ae9dfe3
3
+ metadata.gz: 52f222b86ee544f2e2bfa756c61e816cd874e8e1ac7d688dcb2bae8e242f712e
4
+ data.tar.gz: 254fc95859993deabded89ee9019a680dfa04b05b581a669296524d1a8dbc3b5
5
5
  SHA512:
6
- metadata.gz: 5745df2cf4664fff7b8a507fb82662cd1e448a51dba7a0a0ac30485d624ac1bb3624e85b6086a6bd511a9485636b0d5a9804c561e9476106679a7458572fcf62
7
- data.tar.gz: 637d5150a3b0d192b1c68288c83c4e0ad13827d4d60ac9deb4a974397ab9b0c2ab86dd9281f33bc11dc5e1fd7ba06b22daa4c8d0f80c8927c108946e4c8ffe46
6
+ metadata.gz: af592dc58ceec4b4da49a069622c7f14c65205fd2349fa89ab35b517d368b565b51581e22d401802df96a3a47404d9717ea9d88bfede54d0c513dd1a0434bb96
7
+ data.tar.gz: 0b6f2aa5c9494b934d07499218b2a8156c6150c435e8fea9e5b8ec7b765adbbf922193187c07c256ed776aa17bb7284e77fb6c1cdbf82e0e56a3fa79c65071d4
data/exe/exa-ai-search CHANGED
@@ -18,9 +18,8 @@ def print_help
18
18
  --type TYPE Search type: auto, neural, fast, deep, deep-reasoning,
19
19
  or instant (default: auto)
20
20
  --category CAT Focus on specific data category
21
- Options: "company", "research paper", "news", "pdf",
22
- "github", "tweet", "personal site", "financial report",
23
- "people"
21
+ Options: "company", "research paper", "news", "github",
22
+ "tweet", "personal site", "financial report", "people"
24
23
  --include-domains D Comma-separated list of domains to include
25
24
  --exclude-domains D Comma-separated list of domains to exclude
26
25
  --start-published-date DATE Filter by published date (ISO 8601 format)
@@ -33,6 +32,7 @@ def print_help
33
32
  Content Extraction:
34
33
  --text Include full webpage text
35
34
  --text-max-characters N Max characters for webpage text
35
+ --text-verbosity LEVEL Text verbosity: compact, standard, or full
36
36
  --include-html-tags Include HTML tags in text extraction
37
37
  --summary Include AI-generated summary
38
38
  --summary-query PROMPT Custom prompt for summary generation
@@ -48,14 +48,16 @@ def print_help
48
48
  --highlights-num-sentences N Number of sentences per highlight
49
49
  --highlights-per-url N Number of highlights per URL
50
50
  --highlights-query QUERY Custom query for highlight extraction
51
- --livecrawl MODE Livecrawl mode: always, fallback, never, auto, or preferred
52
- --livecrawl-timeout N Livecrawl timeout in milliseconds
51
+ --livecrawl Enable livecrawl (sets maxAgeHours=0, livecrawlTimeout=5000)
52
+ --livecrawl-timeout N Livecrawl timeout in milliseconds (overrides --livecrawl default)
53
53
  --max-age-hours N Maximum age of results in hours
54
54
 
55
55
  Search Options:
56
56
  --additional-queries QUERY Additional search queries (repeatable)
57
57
  --output-schema JSON JSON schema for output structure (@file syntax)
58
58
  --user-location CODE User location (ISO country code)
59
+ --system-prompt PROMPT System prompt for AI-powered search
60
+ --moderation Enable content moderation
59
61
 
60
62
  General Options:
61
63
  --api-key KEY Exa API key (or set EXA_API_KEY env var)
@@ -79,10 +81,11 @@ def build_contents(args)
79
81
 
80
82
  # Text options
81
83
  if args[:text]
82
- if args[:text_max_characters] || args[:include_html_tags]
84
+ if args[:text_max_characters] || args[:include_html_tags] || args[:text_verbosity]
83
85
  contents[:text] = {}
84
86
  contents[:text][:max_characters] = args[:text_max_characters] if args[:text_max_characters]
85
87
  contents[:text][:include_html_tags] = args[:include_html_tags] if args[:include_html_tags]
88
+ contents[:text][:verbosity] = args[:text_verbosity] if args[:text_verbosity]
86
89
  else
87
90
  contents[:text] = true
88
91
  end
@@ -134,9 +137,13 @@ def build_contents(args)
134
137
  end
135
138
 
136
139
  # Livecrawl options
137
- contents[:livecrawl] = args[:livecrawl] if args[:livecrawl]
138
- contents[:livecrawl_timeout] = args[:livecrawl_timeout] if args[:livecrawl_timeout]
139
- contents[:max_age_hours] = args[:max_age_hours] if args[:max_age_hours]
140
+ if args[:livecrawl]
141
+ contents[:max_age_hours] = args[:max_age_hours].nil? ? 0 : args[:max_age_hours]
142
+ contents[:livecrawl_timeout] = args[:livecrawl_timeout].nil? ? 5000 : args[:livecrawl_timeout]
143
+ else
144
+ contents[:livecrawl_timeout] = args[:livecrawl_timeout] if args[:livecrawl_timeout]
145
+ contents[:max_age_hours] = args[:max_age_hours] if args[:max_age_hours]
146
+ end
140
147
 
141
148
  contents.empty? ? nil : contents
142
149
  end
@@ -177,6 +184,8 @@ begin
177
184
  search_params[:additional_queries] = args[:additional_queries] if args[:additional_queries]
178
185
  search_params[:output_schema] = args[:output_schema] if args[:output_schema]
179
186
  search_params[:user_location] = args[:user_location] if args[:user_location]
187
+ search_params[:system_prompt] = args[:system_prompt] if args[:system_prompt]
188
+ search_params[:moderation] = args[:moderation] if args[:moderation]
180
189
  contents = build_contents(args)
181
190
  search_params.merge!(contents) if contents
182
191
 
@@ -4,9 +4,9 @@ module Exa
4
4
  module CLI
5
5
  class SearchParser
6
6
  VALID_SEARCH_TYPES = ["auto", "neural", "fast", "deep", "deep-reasoning", "instant"].freeze
7
- VALID_LIVECRAWL_MODES = ["always", "fallback", "never", "auto", "preferred"].freeze
7
+ VALID_TEXT_VERBOSITY = ["compact", "standard", "full"].freeze
8
8
  VALID_CATEGORIES = [
9
- "company", "research paper", "news", "pdf", "github",
9
+ "company", "research paper", "news", "github",
10
10
  "tweet", "personal site", "financial report", "people"
11
11
  ].freeze
12
12
 
@@ -140,10 +140,8 @@ module Exa
140
140
  @args[:highlights_query] = @argv[i + 1]
141
141
  i += 2
142
142
  when "--livecrawl"
143
- livecrawl = @argv[i + 1]
144
- validate_livecrawl(livecrawl)
145
- @args[:livecrawl] = livecrawl
146
- i += 2
143
+ @args[:livecrawl] = true
144
+ i += 1
147
145
  when "--livecrawl-timeout"
148
146
  @args[:livecrawl_timeout] = @argv[i + 1].to_i
149
147
  i += 2
@@ -165,6 +163,17 @@ module Exa
165
163
  when "--user-location"
166
164
  @args[:user_location] = @argv[i + 1]
167
165
  i += 2
166
+ when "--system-prompt"
167
+ @args[:system_prompt] = @argv[i + 1]
168
+ i += 2
169
+ when "--moderation"
170
+ @args[:moderation] = true
171
+ i += 1
172
+ when "--text-verbosity"
173
+ verbosity = @argv[i + 1]
174
+ validate_text_verbosity(verbosity)
175
+ @args[:text_verbosity] = verbosity
176
+ i += 2
168
177
  else
169
178
  query_parts << arg
170
179
  i += 1
@@ -184,17 +193,17 @@ module Exa
184
193
  raise ArgumentError, "Search type must be one of: #{VALID_SEARCH_TYPES.join(', ')}"
185
194
  end
186
195
 
187
- def validate_livecrawl(mode)
188
- return if VALID_LIVECRAWL_MODES.include?(mode)
189
-
190
- raise ArgumentError, "Livecrawl mode must be one of: #{VALID_LIVECRAWL_MODES.join(', ')}"
191
- end
192
-
193
196
  def validate_category(category)
194
197
  return if VALID_CATEGORIES.include?(category)
195
198
 
196
199
  raise ArgumentError, "Category must be one of: #{VALID_CATEGORIES.map { |c| "\"#{c}\"" }.join(', ')}"
197
200
  end
201
+
202
+ def validate_text_verbosity(verbosity)
203
+ return if VALID_TEXT_VERBOSITY.include?(verbosity)
204
+
205
+ raise ArgumentError, "Text verbosity must be one of: #{VALID_TEXT_VERBOSITY.join(', ')}"
206
+ end
198
207
  end
199
208
  end
200
209
  end
@@ -42,6 +42,7 @@ module Exa
42
42
  when :num_results then :numResults
43
43
  when :include_domains then :includeDomains
44
44
  when :exclude_domains then :excludeDomains
45
+ when :system_prompt then :systemPrompt
45
46
  else
46
47
  key
47
48
  end
@@ -112,7 +113,8 @@ module Exa
112
113
  max_characters: :maxCharacters,
113
114
  include_html_tags: :includeHtmlTags,
114
115
  include_sections: :includeSections,
115
- exclude_sections: :excludeSections
116
+ exclude_sections: :excludeSections,
117
+ verbosity: :verbosity
116
118
  }
117
119
  end
118
120
 
data/lib/exa/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Exa
4
- VERSION = "0.10.0"
4
+ VERSION = "0.11.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exa-ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Jackson