exa-ai 0.12.2 → 0.14.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 +4 -4
- data/README.md +120 -83
- data/exe/exa-ai +45 -152
- data/exe/exa-ai-agent-run-create +55 -20
- data/exe/exa-ai-agent-run-delete +1 -8
- data/exe/exa-ai-agent-run-events +21 -1
- data/exe/exa-ai-agent-run-list +1 -1
- data/exe/{exa-ai-research-list → exa-ai-agent-run-stop} +31 -32
- data/exe/exa-ai-answer +25 -0
- data/exe/exa-ai-context +6 -2
- data/exe/exa-ai-find-similar +26 -68
- data/exe/exa-ai-get-contents +138 -42
- data/exe/exa-ai-search +27 -104
- data/exe/exa-ai-search-monitor-batch +93 -0
- data/exe/exa-ai-search-monitor-create +104 -0
- data/exe/exa-ai-search-monitor-delete +69 -0
- data/exe/exa-ai-search-monitor-get +69 -0
- data/exe/exa-ai-search-monitor-list +73 -0
- data/exe/exa-ai-search-monitor-runs-get +68 -0
- data/exe/exa-ai-search-monitor-runs-list +75 -0
- data/exe/exa-ai-search-monitor-trigger +69 -0
- data/exe/exa-ai-search-monitor-update +102 -0
- data/lib/exa/cli/base.rb +57 -0
- data/lib/exa/cli/contents_flags.rb +199 -0
- data/lib/exa/cli/formatters/agent_run_formatter.rb +79 -3
- data/lib/exa/cli/formatters/search_formatter.rb +18 -2
- data/lib/exa/cli/formatters/search_monitor_formatter.rb +98 -0
- data/lib/exa/cli/search_parser.rb +46 -87
- data/lib/exa/client.rb +183 -333
- data/lib/exa/middleware/raise_error.rb +14 -0
- data/lib/exa/resources/agent_run.rb +5 -3
- data/lib/exa/resources/agent_run_deletion.rb +17 -0
- data/lib/exa/resources/answer.rb +3 -3
- data/lib/exa/resources/contents_result.rb +5 -1
- data/lib/exa/resources/find_similar_result.rb +5 -1
- data/lib/exa/resources/search_monitor.rb +42 -0
- data/lib/exa/resources/search_monitor_batch_result.rb +11 -0
- data/lib/exa/resources/{research_list.rb → search_monitor_list.rb} +3 -2
- data/lib/exa/resources/search_monitor_run.rb +46 -0
- data/lib/exa/resources/search_monitor_trigger_result.rb +11 -0
- data/lib/exa/resources/search_result.rb +11 -1
- data/lib/exa/services/agent_run_cancel.rb +1 -12
- data/lib/exa/services/agent_run_create.rb +1 -12
- data/lib/exa/services/agent_run_delete.rb +6 -14
- data/lib/exa/services/agent_run_events.rb +33 -4
- data/lib/exa/services/agent_run_get.rb +1 -12
- data/lib/exa/services/agent_run_list.rb +1 -12
- data/lib/exa/services/agent_run_stop.rb +21 -0
- data/lib/exa/services/agent_run_stream.rb +56 -52
- data/lib/exa/services/answer.rb +5 -2
- data/lib/exa/services/answer_stream.rb +57 -46
- data/lib/exa/services/context.rb +3 -1
- data/lib/exa/services/find_similar.rb +9 -2
- data/lib/exa/services/get_contents.rb +14 -15
- data/lib/exa/services/parameter_converter.rb +128 -111
- data/lib/exa/services/search.rb +58 -19
- data/lib/exa/services/search_monitors/batch.rb +36 -0
- data/lib/exa/services/search_monitors/create.rb +37 -0
- data/lib/exa/services/search_monitors/delete.rb +22 -0
- data/lib/exa/services/search_monitors/get.rb +22 -0
- data/lib/exa/services/search_monitors/list.rb +29 -0
- data/lib/exa/services/search_monitors/runs_get.rb +23 -0
- data/lib/exa/services/search_monitors/runs_list.rb +29 -0
- data/lib/exa/services/search_monitors/trigger.rb +22 -0
- data/lib/exa/services/search_monitors/update.rb +42 -0
- data/lib/exa/services/search_stream.rb +38 -0
- data/lib/exa/version.rb +1 -1
- data/lib/exa.rb +18 -56
- metadata +31 -94
- data/exe/exa-ai-enrichment-cancel +0 -108
- data/exe/exa-ai-enrichment-create +0 -226
- data/exe/exa-ai-enrichment-delete +0 -122
- data/exe/exa-ai-enrichment-get +0 -104
- data/exe/exa-ai-enrichment-list +0 -99
- data/exe/exa-ai-enrichment-update +0 -171
- data/exe/exa-ai-import-create +0 -253
- data/exe/exa-ai-import-delete +0 -92
- data/exe/exa-ai-import-get +0 -92
- data/exe/exa-ai-import-list +0 -72
- data/exe/exa-ai-import-update +0 -164
- data/exe/exa-ai-monitor-create +0 -223
- data/exe/exa-ai-monitor-delete +0 -101
- data/exe/exa-ai-monitor-get +0 -92
- data/exe/exa-ai-monitor-list +0 -90
- data/exe/exa-ai-monitor-runs-get +0 -103
- data/exe/exa-ai-monitor-runs-list +0 -110
- data/exe/exa-ai-monitor-update +0 -207
- data/exe/exa-ai-research-get +0 -109
- data/exe/exa-ai-research-start +0 -174
- data/exe/exa-ai-webset-cancel +0 -97
- data/exe/exa-ai-webset-create +0 -254
- data/exe/exa-ai-webset-delete +0 -111
- data/exe/exa-ai-webset-get +0 -93
- data/exe/exa-ai-webset-item-delete +0 -111
- data/exe/exa-ai-webset-item-get +0 -105
- data/exe/exa-ai-webset-item-list +0 -108
- data/exe/exa-ai-webset-list +0 -91
- data/exe/exa-ai-webset-search-cancel +0 -104
- data/exe/exa-ai-webset-search-create +0 -247
- data/exe/exa-ai-webset-search-get +0 -105
- data/exe/exa-ai-webset-update +0 -143
- data/lib/exa/cli/formatters/enrichment_formatter.rb +0 -125
- data/lib/exa/cli/formatters/import_formatter.rb +0 -153
- data/lib/exa/cli/formatters/monitor_formatter.rb +0 -144
- data/lib/exa/cli/formatters/monitor_run_formatter.rb +0 -126
- data/lib/exa/cli/formatters/research_formatter.rb +0 -124
- data/lib/exa/cli/formatters/webset_formatter.rb +0 -134
- data/lib/exa/cli/formatters/webset_item_formatter.rb +0 -131
- data/lib/exa/cli/formatters/webset_search_formatter.rb +0 -57
- data/lib/exa/constants/websets.rb +0 -19
- data/lib/exa/resources/import.rb +0 -86
- data/lib/exa/resources/import_collection.rb +0 -33
- data/lib/exa/resources/monitor.rb +0 -48
- data/lib/exa/resources/monitor_collection.rb +0 -30
- data/lib/exa/resources/monitor_run.rb +0 -52
- data/lib/exa/resources/monitor_run_collection.rb +0 -30
- data/lib/exa/resources/research_task.rb +0 -39
- data/lib/exa/resources/webset.rb +0 -74
- data/lib/exa/resources/webset_collection.rb +0 -33
- data/lib/exa/resources/webset_enrichment.rb +0 -71
- data/lib/exa/resources/webset_enrichment_collection.rb +0 -28
- data/lib/exa/resources/webset_item_collection.rb +0 -33
- data/lib/exa/resources/webset_search.rb +0 -112
- data/lib/exa/services/research_get.rb +0 -30
- data/lib/exa/services/research_list.rb +0 -37
- data/lib/exa/services/research_start.rb +0 -26
- data/lib/exa/services/websets/cancel.rb +0 -36
- data/lib/exa/services/websets/cancel_enrichment.rb +0 -35
- data/lib/exa/services/websets/cancel_search.rb +0 -44
- data/lib/exa/services/websets/create.rb +0 -45
- data/lib/exa/services/websets/create_enrichment.rb +0 -35
- data/lib/exa/services/websets/create_search.rb +0 -48
- data/lib/exa/services/websets/create_search_validator.rb +0 -128
- data/lib/exa/services/websets/create_validator.rb +0 -213
- data/lib/exa/services/websets/delete.rb +0 -36
- data/lib/exa/services/websets/delete_enrichment.rb +0 -35
- data/lib/exa/services/websets/delete_item.rb +0 -20
- data/lib/exa/services/websets/get_item.rb +0 -20
- data/lib/exa/services/websets/get_search.rb +0 -43
- data/lib/exa/services/websets/import_create.rb +0 -40
- data/lib/exa/services/websets/import_delete.rb +0 -37
- data/lib/exa/services/websets/import_get.rb +0 -37
- data/lib/exa/services/websets/import_list.rb +0 -25
- data/lib/exa/services/websets/import_update.rb +0 -38
- data/lib/exa/services/websets/import_upload.rb +0 -58
- data/lib/exa/services/websets/list.rb +0 -25
- data/lib/exa/services/websets/list_items.rb +0 -26
- data/lib/exa/services/websets/monitors/create.rb +0 -42
- data/lib/exa/services/websets/monitors/delete.rb +0 -32
- data/lib/exa/services/websets/monitors/get.rb +0 -33
- data/lib/exa/services/websets/monitors/list.rb +0 -27
- data/lib/exa/services/websets/monitors/runs/get.rb +0 -37
- data/lib/exa/services/websets/monitors/runs/list.rb +0 -30
- data/lib/exa/services/websets/monitors/update.rb +0 -33
- data/lib/exa/services/websets/retrieve.rb +0 -47
- data/lib/exa/services/websets/retrieve_enrichment.rb +0 -35
- data/lib/exa/services/websets/update.rb +0 -37
- data/lib/exa/services/websets/update_enrichment.rb +0 -36
- data/lib/exa/services/websets_parameter_converter.rb +0 -45
data/lib/exa/resources/webset.rb
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Exa
|
|
4
|
-
module Resources
|
|
5
|
-
# Represents a webset from the Exa API
|
|
6
|
-
#
|
|
7
|
-
# A webset is a collection of web entities (companies, people, etc.)
|
|
8
|
-
# discovered through searches, imports, and enrichments.
|
|
9
|
-
class Webset < Struct.new(
|
|
10
|
-
:id,
|
|
11
|
-
:object,
|
|
12
|
-
:status,
|
|
13
|
-
:external_id,
|
|
14
|
-
:title,
|
|
15
|
-
:searches,
|
|
16
|
-
:imports,
|
|
17
|
-
:enrichments,
|
|
18
|
-
:monitors,
|
|
19
|
-
:excludes,
|
|
20
|
-
:metadata,
|
|
21
|
-
:created_at,
|
|
22
|
-
:updated_at,
|
|
23
|
-
:items,
|
|
24
|
-
keyword_init: true
|
|
25
|
-
)
|
|
26
|
-
def initialize(
|
|
27
|
-
id:,
|
|
28
|
-
object:,
|
|
29
|
-
status:,
|
|
30
|
-
external_id: nil,
|
|
31
|
-
title: nil,
|
|
32
|
-
searches: nil,
|
|
33
|
-
imports: nil,
|
|
34
|
-
enrichments: nil,
|
|
35
|
-
monitors: nil,
|
|
36
|
-
excludes: nil,
|
|
37
|
-
metadata: nil,
|
|
38
|
-
created_at: nil,
|
|
39
|
-
updated_at: nil,
|
|
40
|
-
items: nil
|
|
41
|
-
)
|
|
42
|
-
super
|
|
43
|
-
freeze
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def idle?
|
|
47
|
-
status == "idle"
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def processing?
|
|
51
|
-
status == "processing"
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def to_h
|
|
55
|
-
{
|
|
56
|
-
id: id,
|
|
57
|
-
object: object,
|
|
58
|
-
status: status,
|
|
59
|
-
external_id: external_id,
|
|
60
|
-
title: title,
|
|
61
|
-
searches: searches,
|
|
62
|
-
imports: imports,
|
|
63
|
-
enrichments: enrichments,
|
|
64
|
-
monitors: monitors,
|
|
65
|
-
excludes: excludes,
|
|
66
|
-
metadata: metadata,
|
|
67
|
-
created_at: created_at,
|
|
68
|
-
updated_at: updated_at,
|
|
69
|
-
items: items
|
|
70
|
-
}.compact
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
end
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Exa
|
|
4
|
-
module Resources
|
|
5
|
-
# Represents a paginated list of websets from the Exa API
|
|
6
|
-
#
|
|
7
|
-
# This class wraps the JSON response from the GET /websets/v0/websets endpoint
|
|
8
|
-
# and provides pagination support.
|
|
9
|
-
class WebsetCollection < Struct.new(
|
|
10
|
-
:data,
|
|
11
|
-
:has_more,
|
|
12
|
-
:next_cursor,
|
|
13
|
-
keyword_init: true
|
|
14
|
-
)
|
|
15
|
-
def initialize(data:, has_more: false, next_cursor: nil)
|
|
16
|
-
super
|
|
17
|
-
freeze
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def empty?
|
|
21
|
-
data.empty?
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def to_h
|
|
25
|
-
{
|
|
26
|
-
data: data,
|
|
27
|
-
has_more: has_more,
|
|
28
|
-
next_cursor: next_cursor
|
|
29
|
-
}
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Exa
|
|
4
|
-
module Resources
|
|
5
|
-
# Represents a webset enrichment from the Exa API
|
|
6
|
-
#
|
|
7
|
-
# An enrichment extracts specific data from web entities in a webset.
|
|
8
|
-
class WebsetEnrichment < Struct.new(
|
|
9
|
-
:id,
|
|
10
|
-
:object,
|
|
11
|
-
:status,
|
|
12
|
-
:webset_id,
|
|
13
|
-
:title,
|
|
14
|
-
:description,
|
|
15
|
-
:format,
|
|
16
|
-
:options,
|
|
17
|
-
:instructions,
|
|
18
|
-
:metadata,
|
|
19
|
-
:created_at,
|
|
20
|
-
:updated_at,
|
|
21
|
-
keyword_init: true
|
|
22
|
-
)
|
|
23
|
-
def initialize(
|
|
24
|
-
id:,
|
|
25
|
-
object:,
|
|
26
|
-
status:,
|
|
27
|
-
webset_id: nil,
|
|
28
|
-
title: nil,
|
|
29
|
-
description: nil,
|
|
30
|
-
format: nil,
|
|
31
|
-
options: nil,
|
|
32
|
-
instructions: nil,
|
|
33
|
-
metadata: nil,
|
|
34
|
-
created_at: nil,
|
|
35
|
-
updated_at: nil
|
|
36
|
-
)
|
|
37
|
-
super
|
|
38
|
-
freeze
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def pending?
|
|
42
|
-
status == "pending"
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def running?
|
|
46
|
-
status == "running"
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def completed?
|
|
50
|
-
status == "completed"
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def to_h
|
|
54
|
-
{
|
|
55
|
-
id: id,
|
|
56
|
-
object: object,
|
|
57
|
-
status: status,
|
|
58
|
-
webset_id: webset_id,
|
|
59
|
-
title: title,
|
|
60
|
-
description: description,
|
|
61
|
-
format: format,
|
|
62
|
-
options: options,
|
|
63
|
-
instructions: instructions,
|
|
64
|
-
metadata: metadata,
|
|
65
|
-
created_at: created_at,
|
|
66
|
-
updated_at: updated_at
|
|
67
|
-
}.compact
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Exa
|
|
4
|
-
module Resources
|
|
5
|
-
# Represents a list of enrichments for a webset from the Exa API
|
|
6
|
-
#
|
|
7
|
-
# This class wraps the JSON response from the GET /websets/v0/websets/{id}/enrichments endpoint
|
|
8
|
-
class WebsetEnrichmentCollection < Struct.new(
|
|
9
|
-
:data,
|
|
10
|
-
keyword_init: true
|
|
11
|
-
)
|
|
12
|
-
def initialize(data:)
|
|
13
|
-
super
|
|
14
|
-
freeze
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def empty?
|
|
18
|
-
data.empty?
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def to_h
|
|
22
|
-
{
|
|
23
|
-
data: data
|
|
24
|
-
}
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Exa
|
|
4
|
-
module Resources
|
|
5
|
-
# Represents a paginated list of webset items from the Exa API
|
|
6
|
-
#
|
|
7
|
-
# This class wraps the JSON response from the GET /websets/v0/websets/{id}/items endpoint
|
|
8
|
-
# and provides pagination support.
|
|
9
|
-
class WebsetItemCollection < Struct.new(
|
|
10
|
-
:data,
|
|
11
|
-
:has_more,
|
|
12
|
-
:next_cursor,
|
|
13
|
-
keyword_init: true
|
|
14
|
-
)
|
|
15
|
-
def initialize(data:, has_more: false, next_cursor: nil)
|
|
16
|
-
super
|
|
17
|
-
freeze
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def empty?
|
|
21
|
-
data.empty?
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def to_h
|
|
25
|
-
{
|
|
26
|
-
data: data,
|
|
27
|
-
has_more: has_more,
|
|
28
|
-
next_cursor: next_cursor
|
|
29
|
-
}
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Exa
|
|
4
|
-
module Resources
|
|
5
|
-
# Represents a search operation within a webset
|
|
6
|
-
#
|
|
7
|
-
# A search finds entities matching specific criteria and can either
|
|
8
|
-
# override existing webset items or append to them.
|
|
9
|
-
class WebsetSearch < Struct.new(
|
|
10
|
-
:id,
|
|
11
|
-
:object,
|
|
12
|
-
:status,
|
|
13
|
-
:webset_id,
|
|
14
|
-
:query,
|
|
15
|
-
:entity,
|
|
16
|
-
:criteria,
|
|
17
|
-
:count,
|
|
18
|
-
:behavior,
|
|
19
|
-
:exclude,
|
|
20
|
-
:scope,
|
|
21
|
-
:progress,
|
|
22
|
-
:recall,
|
|
23
|
-
:metadata,
|
|
24
|
-
:canceled_at,
|
|
25
|
-
:canceled_reason,
|
|
26
|
-
:created_at,
|
|
27
|
-
:updated_at,
|
|
28
|
-
keyword_init: true
|
|
29
|
-
)
|
|
30
|
-
def initialize(
|
|
31
|
-
id:,
|
|
32
|
-
object:,
|
|
33
|
-
status:,
|
|
34
|
-
webset_id: nil,
|
|
35
|
-
query: nil,
|
|
36
|
-
entity: nil,
|
|
37
|
-
criteria: nil,
|
|
38
|
-
count: nil,
|
|
39
|
-
behavior: nil,
|
|
40
|
-
exclude: nil,
|
|
41
|
-
scope: nil,
|
|
42
|
-
progress: nil,
|
|
43
|
-
recall: nil,
|
|
44
|
-
metadata: nil,
|
|
45
|
-
canceled_at: nil,
|
|
46
|
-
canceled_reason: nil,
|
|
47
|
-
created_at: nil,
|
|
48
|
-
updated_at: nil
|
|
49
|
-
)
|
|
50
|
-
super
|
|
51
|
-
freeze
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# Status helper methods
|
|
55
|
-
def created?
|
|
56
|
-
status == "created"
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
def running?
|
|
60
|
-
status == "running"
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def completed?
|
|
64
|
-
status == "completed"
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def failed?
|
|
68
|
-
status == "failed"
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
def canceled?
|
|
72
|
-
status == "canceled"
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
def in_progress?
|
|
76
|
-
created? || running?
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
# Behavior helper methods
|
|
80
|
-
def override?
|
|
81
|
-
behavior == "override"
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def append?
|
|
85
|
-
behavior == "append"
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
def to_h
|
|
89
|
-
{
|
|
90
|
-
id: id,
|
|
91
|
-
object: object,
|
|
92
|
-
status: status,
|
|
93
|
-
webset_id: webset_id,
|
|
94
|
-
query: query,
|
|
95
|
-
entity: entity,
|
|
96
|
-
criteria: criteria,
|
|
97
|
-
count: count,
|
|
98
|
-
behavior: behavior,
|
|
99
|
-
exclude: exclude,
|
|
100
|
-
scope: scope,
|
|
101
|
-
progress: progress,
|
|
102
|
-
recall: recall,
|
|
103
|
-
metadata: metadata,
|
|
104
|
-
canceled_at: canceled_at,
|
|
105
|
-
canceled_reason: canceled_reason,
|
|
106
|
-
created_at: created_at,
|
|
107
|
-
updated_at: updated_at
|
|
108
|
-
}.compact
|
|
109
|
-
end
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
end
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module Exa
|
|
2
|
-
module Services
|
|
3
|
-
class ResearchGet
|
|
4
|
-
def initialize(connection, research_id:, **params)
|
|
5
|
-
@connection = connection
|
|
6
|
-
@research_id = research_id
|
|
7
|
-
@params = params
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def call
|
|
11
|
-
response = @connection.get("/research/v1/#{@research_id}", @params)
|
|
12
|
-
body = response.body
|
|
13
|
-
|
|
14
|
-
Resources::ResearchTask.new(
|
|
15
|
-
research_id: body["researchId"],
|
|
16
|
-
created_at: body["createdAt"],
|
|
17
|
-
status: body["status"],
|
|
18
|
-
instructions: body["instructions"],
|
|
19
|
-
model: body["model"],
|
|
20
|
-
output_schema: body["outputSchema"],
|
|
21
|
-
events: body["events"],
|
|
22
|
-
output: body["output"],
|
|
23
|
-
cost_dollars: body["costDollars"],
|
|
24
|
-
finished_at: body["finishedAt"],
|
|
25
|
-
error: body["error"]
|
|
26
|
-
)
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
module Exa
|
|
2
|
-
module Services
|
|
3
|
-
class ResearchList
|
|
4
|
-
def initialize(connection, **params)
|
|
5
|
-
@connection = connection
|
|
6
|
-
@params = params
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def call
|
|
10
|
-
response = @connection.get("/research/v1", @params)
|
|
11
|
-
body = response.body
|
|
12
|
-
|
|
13
|
-
data = body["data"].map do |task_data|
|
|
14
|
-
Resources::ResearchTask.new(
|
|
15
|
-
research_id: task_data["researchId"],
|
|
16
|
-
created_at: task_data["createdAt"],
|
|
17
|
-
status: task_data["status"],
|
|
18
|
-
instructions: task_data["instructions"],
|
|
19
|
-
model: task_data["model"],
|
|
20
|
-
output_schema: task_data["outputSchema"],
|
|
21
|
-
events: task_data["events"],
|
|
22
|
-
output: task_data["output"],
|
|
23
|
-
cost_dollars: task_data["costDollars"],
|
|
24
|
-
finished_at: task_data["finishedAt"],
|
|
25
|
-
error: task_data["error"]
|
|
26
|
-
)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
Resources::ResearchList.new(
|
|
30
|
-
data: data,
|
|
31
|
-
has_more: body["hasMore"],
|
|
32
|
-
next_cursor: body["nextCursor"]
|
|
33
|
-
)
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Exa
|
|
4
|
-
module Services
|
|
5
|
-
class ResearchStart
|
|
6
|
-
def initialize(connection, **params)
|
|
7
|
-
@connection = connection
|
|
8
|
-
@params = params
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def call
|
|
12
|
-
response = @connection.post("/research/v1", @params)
|
|
13
|
-
body = response.body
|
|
14
|
-
|
|
15
|
-
Resources::ResearchTask.new(
|
|
16
|
-
research_id: body["researchId"],
|
|
17
|
-
created_at: body["createdAt"],
|
|
18
|
-
status: body["status"],
|
|
19
|
-
instructions: body["instructions"],
|
|
20
|
-
model: body["model"],
|
|
21
|
-
output_schema: body["outputSchema"]
|
|
22
|
-
)
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Exa
|
|
4
|
-
module Services
|
|
5
|
-
module Websets
|
|
6
|
-
class Cancel
|
|
7
|
-
def initialize(connection, id:)
|
|
8
|
-
@connection = connection
|
|
9
|
-
@id = id
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def call
|
|
13
|
-
response = @connection.post("/websets/v0/websets/#{@id}/cancel", {})
|
|
14
|
-
body = response.body
|
|
15
|
-
|
|
16
|
-
Resources::Webset.new(
|
|
17
|
-
id: body["id"],
|
|
18
|
-
object: body["object"],
|
|
19
|
-
status: body["status"],
|
|
20
|
-
external_id: body["externalId"],
|
|
21
|
-
title: body["title"],
|
|
22
|
-
searches: body["searches"],
|
|
23
|
-
imports: body["imports"],
|
|
24
|
-
enrichments: body["enrichments"],
|
|
25
|
-
monitors: body["monitors"],
|
|
26
|
-
excludes: body["excludes"],
|
|
27
|
-
metadata: body["metadata"],
|
|
28
|
-
created_at: body["createdAt"],
|
|
29
|
-
updated_at: body["updatedAt"],
|
|
30
|
-
items: body["items"]
|
|
31
|
-
)
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Exa
|
|
4
|
-
module Services
|
|
5
|
-
module Websets
|
|
6
|
-
class CancelEnrichment
|
|
7
|
-
def initialize(connection, webset_id:, id:)
|
|
8
|
-
@connection = connection
|
|
9
|
-
@webset_id = webset_id
|
|
10
|
-
@id = id
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def call
|
|
14
|
-
response = @connection.post("/websets/v0/websets/#{@webset_id}/enrichments/#{@id}/cancel", {})
|
|
15
|
-
body = response.body
|
|
16
|
-
|
|
17
|
-
Resources::WebsetEnrichment.new(
|
|
18
|
-
id: body["id"],
|
|
19
|
-
object: body["object"],
|
|
20
|
-
status: body["status"],
|
|
21
|
-
webset_id: body["websetId"],
|
|
22
|
-
title: body["title"],
|
|
23
|
-
description: body["description"],
|
|
24
|
-
format: body["format"],
|
|
25
|
-
options: body["options"],
|
|
26
|
-
instructions: body["instructions"],
|
|
27
|
-
metadata: body["metadata"],
|
|
28
|
-
created_at: body["createdAt"],
|
|
29
|
-
updated_at: body["updatedAt"]
|
|
30
|
-
)
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Exa
|
|
4
|
-
module Services
|
|
5
|
-
module Websets
|
|
6
|
-
class CancelSearch
|
|
7
|
-
def initialize(connection, webset_id:, id:)
|
|
8
|
-
@connection = connection
|
|
9
|
-
@webset_id = webset_id
|
|
10
|
-
@id = id
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def call
|
|
14
|
-
response = @connection.post(
|
|
15
|
-
"/websets/v0/websets/#{@webset_id}/searches/#{@id}/cancel",
|
|
16
|
-
{}
|
|
17
|
-
)
|
|
18
|
-
body = response.body
|
|
19
|
-
|
|
20
|
-
Resources::WebsetSearch.new(
|
|
21
|
-
id: body["id"],
|
|
22
|
-
object: body["object"],
|
|
23
|
-
status: body["status"],
|
|
24
|
-
webset_id: body["websetId"],
|
|
25
|
-
query: body["query"],
|
|
26
|
-
entity: body["entity"],
|
|
27
|
-
criteria: body["criteria"],
|
|
28
|
-
count: body["count"],
|
|
29
|
-
behavior: body["behavior"],
|
|
30
|
-
exclude: body["exclude"],
|
|
31
|
-
scope: body["scope"],
|
|
32
|
-
progress: body["progress"],
|
|
33
|
-
recall: body["recall"],
|
|
34
|
-
metadata: body["metadata"],
|
|
35
|
-
canceled_at: body["canceledAt"],
|
|
36
|
-
canceled_reason: body["canceledReason"],
|
|
37
|
-
created_at: body["createdAt"],
|
|
38
|
-
updated_at: body["updatedAt"]
|
|
39
|
-
)
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative "create_validator"
|
|
4
|
-
require_relative "../websets_parameter_converter"
|
|
5
|
-
|
|
6
|
-
module Exa
|
|
7
|
-
module Services
|
|
8
|
-
module Websets
|
|
9
|
-
class Create
|
|
10
|
-
def initialize(connection, **params)
|
|
11
|
-
@connection = connection
|
|
12
|
-
@params = params
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def call
|
|
16
|
-
# Validate parameters before making the API call
|
|
17
|
-
CreateValidator.validate!(@params)
|
|
18
|
-
|
|
19
|
-
# Convert Ruby snake_case params to API camelCase
|
|
20
|
-
converted_params = WebsetsParameterConverter.convert(@params)
|
|
21
|
-
|
|
22
|
-
response = @connection.post("/websets/v0/websets", converted_params)
|
|
23
|
-
body = response.body
|
|
24
|
-
|
|
25
|
-
Resources::Webset.new(
|
|
26
|
-
id: body["id"],
|
|
27
|
-
object: body["object"],
|
|
28
|
-
status: body["status"],
|
|
29
|
-
external_id: body["externalId"],
|
|
30
|
-
title: body["title"],
|
|
31
|
-
searches: body["searches"],
|
|
32
|
-
imports: body["imports"],
|
|
33
|
-
enrichments: body["enrichments"],
|
|
34
|
-
monitors: body["monitors"],
|
|
35
|
-
excludes: body["excludes"],
|
|
36
|
-
metadata: body["metadata"],
|
|
37
|
-
created_at: body["createdAt"],
|
|
38
|
-
updated_at: body["updatedAt"],
|
|
39
|
-
items: body["items"]
|
|
40
|
-
)
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
end
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Exa
|
|
4
|
-
module Services
|
|
5
|
-
module Websets
|
|
6
|
-
class CreateEnrichment
|
|
7
|
-
def initialize(connection, webset_id:, **params)
|
|
8
|
-
@connection = connection
|
|
9
|
-
@webset_id = webset_id
|
|
10
|
-
@params = params
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def call
|
|
14
|
-
response = @connection.post("/websets/v0/websets/#{@webset_id}/enrichments", @params)
|
|
15
|
-
body = response.body
|
|
16
|
-
|
|
17
|
-
Resources::WebsetEnrichment.new(
|
|
18
|
-
id: body["id"],
|
|
19
|
-
object: body["object"],
|
|
20
|
-
status: body["status"],
|
|
21
|
-
webset_id: body["websetId"],
|
|
22
|
-
title: body["title"],
|
|
23
|
-
description: body["description"],
|
|
24
|
-
format: body["format"],
|
|
25
|
-
options: body["options"],
|
|
26
|
-
instructions: body["instructions"],
|
|
27
|
-
metadata: body["metadata"],
|
|
28
|
-
created_at: body["createdAt"],
|
|
29
|
-
updated_at: body["updatedAt"]
|
|
30
|
-
)
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative "create_search_validator"
|
|
4
|
-
|
|
5
|
-
module Exa
|
|
6
|
-
module Services
|
|
7
|
-
module Websets
|
|
8
|
-
class CreateSearch
|
|
9
|
-
def initialize(connection, webset_id:, **params)
|
|
10
|
-
@connection = connection
|
|
11
|
-
@webset_id = webset_id
|
|
12
|
-
@params = params
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def call
|
|
16
|
-
CreateSearchValidator.validate!(@params)
|
|
17
|
-
|
|
18
|
-
response = @connection.post(
|
|
19
|
-
"/websets/v0/websets/#{@webset_id}/searches",
|
|
20
|
-
@params
|
|
21
|
-
)
|
|
22
|
-
body = response.body
|
|
23
|
-
|
|
24
|
-
Resources::WebsetSearch.new(
|
|
25
|
-
id: body["id"],
|
|
26
|
-
object: body["object"],
|
|
27
|
-
status: body["status"],
|
|
28
|
-
webset_id: body["websetId"],
|
|
29
|
-
query: body["query"],
|
|
30
|
-
entity: body["entity"],
|
|
31
|
-
criteria: body["criteria"],
|
|
32
|
-
count: body["count"],
|
|
33
|
-
behavior: body["behavior"],
|
|
34
|
-
exclude: body["exclude"],
|
|
35
|
-
scope: body["scope"],
|
|
36
|
-
progress: body["progress"],
|
|
37
|
-
recall: body["recall"],
|
|
38
|
-
metadata: body["metadata"],
|
|
39
|
-
canceled_at: body["canceledAt"],
|
|
40
|
-
canceled_reason: body["canceledReason"],
|
|
41
|
-
created_at: body["createdAt"],
|
|
42
|
-
updated_at: body["updatedAt"]
|
|
43
|
-
)
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|