Skip to content

Commit a69d030

Browse files
committed
fix(parallel): align integration with Parallel AI API docs
1 parent 635179d commit a69d030

File tree

7 files changed

+301
-135
lines changed

7 files changed

+301
-135
lines changed

apps/docs/content/docs/en/tools/parallel_ai.mdx

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,24 @@ Search the web using Parallel AI. Provides comprehensive search results with int
4444
| Parameter | Type | Required | Description |
4545
| --------- | ---- | -------- | ----------- |
4646
| `objective` | string | Yes | The search objective or question to answer |
47-
| `search_queries` | string | No | Optional comma-separated list of search queries to execute |
48-
| `processor` | string | No | Processing method: base or pro \(default: base\) |
49-
| `max_results` | number | No | Maximum number of results to return \(default: 5\) |
50-
| `max_chars_per_result` | number | No | Maximum characters per result \(default: 1500\) |
47+
| `search_queries` | json | No | Array of search queries to execute |
48+
| `mode` | string | No | Search mode: one-shot, agentic, or fast \(default: one-shot\) |
49+
| `max_results` | number | No | Maximum number of results to return \(default: 10\) |
50+
| `max_chars_per_result` | number | No | Maximum characters per result excerpt \(minimum: 1000\) |
51+
| `include_domains` | string | No | Comma-separated list of domains to restrict search results to |
52+
| `exclude_domains` | string | No | Comma-separated list of domains to exclude from search results |
5153
| `apiKey` | string | Yes | Parallel AI API Key |
5254

5355
#### Output
5456

5557
| Parameter | Type | Description |
5658
| --------- | ---- | ----------- |
59+
| `search_id` | string | Unique identifier for this search request |
5760
| `results` | array | Search results with excerpts from relevant pages |
5861
|`url` | string | The URL of the search result |
5962
|`title` | string | The title of the search result |
60-
|`excerpts` | array | Text excerpts from the page |
63+
|`publish_date` | string | Publication date of the page \(YYYY-MM-DD\) |
64+
|`excerpts` | array | LLM-optimized excerpts from the page |
6165

6266
### `parallel_extract`
6367

@@ -68,31 +72,33 @@ Extract targeted information from specific URLs using Parallel AI. Processes pro
6872
| Parameter | Type | Required | Description |
6973
| --------- | ---- | -------- | ----------- |
7074
| `urls` | string | Yes | Comma-separated list of URLs to extract information from |
71-
| `objective` | string | Yes | What information to extract from the provided URLs |
72-
| `excerpts` | boolean | Yes | Include relevant excerpts from the content |
73-
| `full_content` | boolean | Yes | Include full page content |
75+
| `objective` | string | No | What information to extract from the provided URLs |
76+
| `excerpts` | boolean | No | Include relevant excerpts from the content \(default: true\) |
77+
| `full_content` | boolean | No | Include full page content as markdown \(default: false\) |
7478
| `apiKey` | string | Yes | Parallel AI API Key |
7579

7680
#### Output
7781

7882
| Parameter | Type | Description |
7983
| --------- | ---- | ----------- |
84+
| `extract_id` | string | Unique identifier for this extraction request |
8085
| `results` | array | Extracted information from the provided URLs |
8186
|`url` | string | The source URL |
8287
|`title` | string | The title of the page |
83-
|`content` | string | Extracted content |
84-
|`excerpts` | array | Relevant text excerpts |
88+
|`publish_date` | string | Publication date \(YYYY-MM-DD\) |
89+
|`excerpts` | array | Relevant text excerpts in markdown |
90+
|`full_content` | string | Full page content as markdown |
8591

8692
### `parallel_deep_research`
8793

88-
Conduct comprehensive deep research across the web using Parallel AI. Synthesizes information from multiple sources with citations. Can take up to 15 minutes to complete.
94+
Conduct comprehensive deep research across the web using Parallel AI. Synthesizes information from multiple sources with citations. Can take up to 45 minutes to complete.
8995

9096
#### Input
9197

9298
| Parameter | Type | Required | Description |
9399
| --------- | ---- | -------- | ----------- |
94100
| `input` | string | Yes | Research query or question \(up to 15,000 characters\) |
95-
| `processor` | string | No | Compute level: base, lite, pro, ultra, ultra2x, ultra4x, ultra8x \(default: base\) |
101+
| `processor` | string | No | Processing tier: pro, ultra, pro-fast, ultra-fast \(default: pro\) |
96102
| `include_domains` | string | No | Comma-separated list of domains to restrict research to \(source policy\) |
97103
| `exclude_domains` | string | No | Comma-separated list of domains to exclude from research \(source policy\) |
98104
| `apiKey` | string | Yes | Parallel AI API Key |
@@ -101,17 +107,17 @@ Conduct comprehensive deep research across the web using Parallel AI. Synthesize
101107

102108
| Parameter | Type | Description |
103109
| --------- | ---- | ----------- |
104-
| `status` | string | Task status \(completed, failed\) |
110+
| `status` | string | Task status \(completed, failed, running\) |
105111
| `run_id` | string | Unique ID for this research task |
106112
| `message` | string | Status message |
107113
| `content` | object | Research results \(structured based on output_schema\) |
108114
| `basis` | array | Citations and sources with reasoning and confidence levels |
109-
|`field` | string | Output field name |
115+
|`field` | string | Output field dot-notation path |
110116
|`reasoning` | string | Explanation for the result |
111117
|`citations` | array | Array of sources |
112118
|`url` | string | Source URL |
113119
|`title` | string | Source title |
114120
|`excerpts` | array | Relevant excerpts from the source |
115-
|`confidence` | string | Confidence level indicator |
121+
|`confidence` | string | Confidence level \(high, medium\) |
116122

117123

apps/sim/blocks/blocks/parallel.ts

Lines changed: 74 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const ParallelBlock: BlockConfig<ToolResponse> = {
99
authMode: AuthMode.ApiKey,
1010
longDescription:
1111
'Integrate Parallel AI into the workflow. Can search the web, extract information from URLs, and conduct deep research.',
12-
docsLink: 'https://docs.parallel.ai/',
12+
docsLink: 'https://docs.sim.ai/tools/parallel-ai',
1313
category: 'tools',
1414
bgColor: '#E0E0E0',
1515
icon: ParallelIcon,
@@ -56,7 +56,7 @@ export const ParallelBlock: BlockConfig<ToolResponse> = {
5656
title: 'Extract Objective',
5757
type: 'long-input',
5858
placeholder: 'What information to extract from the URLs?',
59-
required: true,
59+
required: false,
6060
condition: { field: 'operation', value: 'extract' },
6161
},
6262
{
@@ -89,13 +89,45 @@ export const ParallelBlock: BlockConfig<ToolResponse> = {
8989
required: true,
9090
condition: { field: 'operation', value: 'deep_research' },
9191
},
92+
{
93+
id: 'search_mode',
94+
title: 'Search Mode',
95+
type: 'dropdown',
96+
options: [
97+
{ label: 'One-Shot', id: 'one-shot' },
98+
{ label: 'Agentic', id: 'agentic' },
99+
{ label: 'Fast', id: 'fast' },
100+
],
101+
value: () => 'one-shot',
102+
condition: { field: 'operation', value: 'search' },
103+
mode: 'advanced',
104+
},
105+
{
106+
id: 'search_include_domains',
107+
title: 'Include Domains',
108+
type: 'short-input',
109+
placeholder: 'Comma-separated domains to include (e.g., .edu, example.com)',
110+
required: false,
111+
condition: { field: 'operation', value: 'search' },
112+
mode: 'advanced',
113+
},
114+
{
115+
id: 'search_exclude_domains',
116+
title: 'Exclude Domains',
117+
type: 'short-input',
118+
placeholder: 'Comma-separated domains to exclude',
119+
required: false,
120+
condition: { field: 'operation', value: 'search' },
121+
mode: 'advanced',
122+
},
92123
{
93124
id: 'include_domains',
94125
title: 'Include Domains',
95126
type: 'short-input',
96127
placeholder: 'Comma-separated domains to include',
97128
required: false,
98129
condition: { field: 'operation', value: 'deep_research' },
130+
mode: 'advanced',
99131
},
100132
{
101133
id: 'exclude_domains',
@@ -104,37 +136,37 @@ export const ParallelBlock: BlockConfig<ToolResponse> = {
104136
placeholder: 'Comma-separated domains to exclude',
105137
required: false,
106138
condition: { field: 'operation', value: 'deep_research' },
139+
mode: 'advanced',
107140
},
108141
{
109-
id: 'processor',
110-
title: 'Processor',
142+
id: 'research_processor',
143+
title: 'Research Processor',
111144
type: 'dropdown',
112145
options: [
113-
{ label: 'Lite', id: 'lite' },
114-
{ label: 'Base', id: 'base' },
115-
{ label: 'Core', id: 'core' },
116-
{ label: 'Core 2x', id: 'core2x' },
117146
{ label: 'Pro', id: 'pro' },
118147
{ label: 'Ultra', id: 'ultra' },
119-
{ label: 'Ultra 2x', id: 'ultra2x' },
120-
{ label: 'Ultra 4x', id: 'ultra4x' },
148+
{ label: 'Pro Fast', id: 'pro-fast' },
149+
{ label: 'Ultra Fast', id: 'ultra-fast' },
121150
],
122-
value: () => 'base',
123-
condition: { field: 'operation', value: ['search', 'deep_research'] },
151+
value: () => 'pro',
152+
condition: { field: 'operation', value: 'deep_research' },
153+
mode: 'advanced',
124154
},
125155
{
126156
id: 'max_results',
127157
title: 'Max Results',
128158
type: 'short-input',
129-
placeholder: '5',
159+
placeholder: '10',
130160
condition: { field: 'operation', value: 'search' },
161+
mode: 'advanced',
131162
},
132163
{
133164
id: 'max_chars_per_result',
134-
title: 'Max Chars',
165+
title: 'Max Chars Per Result',
135166
type: 'short-input',
136167
placeholder: '1500',
137168
condition: { field: 'operation', value: 'search' },
169+
mode: 'advanced',
138170
},
139171
{
140172
id: 'apiKey',
@@ -149,8 +181,6 @@ export const ParallelBlock: BlockConfig<ToolResponse> = {
149181
access: ['parallel_search', 'parallel_extract', 'parallel_deep_research'],
150182
config: {
151183
tool: (params) => {
152-
if (params.extract_objective) params.objective = params.extract_objective
153-
if (params.research_input) params.input = params.research_input
154184
switch (params.operation) {
155185
case 'search':
156186
return 'parallel_search'
@@ -174,21 +204,30 @@ export const ParallelBlock: BlockConfig<ToolResponse> = {
174204
.filter((query: string) => query.length > 0)
175205
if (queries.length > 0) {
176206
result.search_queries = queries
177-
} else {
178-
result.search_queries = undefined
179207
}
180208
}
209+
if (params.search_mode && params.search_mode !== 'one-shot') {
210+
result.mode = params.search_mode
211+
}
181212
if (params.max_results) result.max_results = Number(params.max_results)
182213
if (params.max_chars_per_result) {
183214
result.max_chars_per_result = Number(params.max_chars_per_result)
184215
}
216+
if (params.search_include_domains) result.include_domains = params.search_include_domains
217+
if (params.search_exclude_domains) result.exclude_domains = params.search_exclude_domains
185218
}
186219

187220
if (operation === 'extract') {
221+
if (params.extract_objective) result.objective = params.extract_objective
188222
result.excerpts = !(params.excerpts === 'false' || params.excerpts === false)
189223
result.full_content = params.full_content === 'true' || params.full_content === true
190224
}
191225

226+
if (operation === 'deep_research') {
227+
result.input = params.research_input
228+
if (params.research_processor) result.processor = params.research_processor
229+
}
230+
192231
return result
193232
},
194233
},
@@ -202,29 +241,34 @@ export const ParallelBlock: BlockConfig<ToolResponse> = {
202241
excerpts: { type: 'boolean', description: 'Include excerpts' },
203242
full_content: { type: 'boolean', description: 'Include full content' },
204243
research_input: { type: 'string', description: 'Deep research query' },
205-
include_domains: { type: 'string', description: 'Domains to include' },
206-
exclude_domains: { type: 'string', description: 'Domains to exclude' },
207-
processor: { type: 'string', description: 'Processing method' },
244+
include_domains: { type: 'string', description: 'Domains to include (deep research)' },
245+
exclude_domains: { type: 'string', description: 'Domains to exclude (deep research)' },
246+
search_include_domains: { type: 'string', description: 'Domains to include (search)' },
247+
search_exclude_domains: { type: 'string', description: 'Domains to exclude (search)' },
248+
search_mode: { type: 'string', description: 'Search mode (one-shot, agentic, fast)' },
249+
research_processor: { type: 'string', description: 'Research processing tier' },
208250
max_results: { type: 'number', description: 'Maximum number of results' },
209251
max_chars_per_result: { type: 'number', description: 'Maximum characters per result' },
210252
apiKey: { type: 'string', description: 'Parallel AI API key' },
211253
},
212254
outputs: {
213-
results: { type: 'string', description: 'Search or extract results (JSON stringified)' },
255+
results: {
256+
type: 'json',
257+
description: 'Search or extract results (array of url, title, excerpts)',
258+
},
259+
search_id: { type: 'string', description: 'Search request ID (for search)' },
260+
extract_id: { type: 'string', description: 'Extract request ID (for extract)' },
214261
status: { type: 'string', description: 'Task status (for deep research)' },
215262
run_id: { type: 'string', description: 'Task run ID (for deep research)' },
216263
message: { type: 'string', description: 'Status message (for deep research)' },
217264
content: {
218-
type: 'string',
219-
description: 'Research content (for deep research, JSON stringified)',
265+
type: 'json',
266+
description: 'Research content (for deep research, structured based on output_schema)',
220267
},
221268
basis: {
222-
type: 'string',
223-
description: 'Citations and sources (for deep research, JSON stringified)',
224-
},
225-
metadata: {
226-
type: 'string',
227-
description: 'Task metadata (for deep research, JSON stringified)',
269+
type: 'json',
270+
description:
271+
'Citations and sources with field, reasoning, citations, confidence (for deep research)',
228272
},
229273
},
230274
}

0 commit comments

Comments
 (0)