Skip to content

Commit 092dfba

Browse files
committed
fix(peopledatalabs): align endpoints + outputs with PDL API
- person_identify: short-circuit on PDL 404 (no-match), matching the person_enrich pattern - company_search: drop unsupported `dataset` param (PDL company search docs do not list it) - block: expose `min_likelihood` for `pdl_company_enrich` (PDL Company Enrichment supports min_likelihood) - location_clean: surface `subregion`; drop phantom `latitude`/ `longitude` (PDL only returns `geo` as a "lat,lon" string) - school_clean: surface `domain` and `location_continent` from the nested `location` object - docs icon: switch fill to `currentColor` so the icon renders on light backgrounds
1 parent f55893a commit 092dfba

6 files changed

Lines changed: 17 additions & 16 deletions

File tree

apps/docs/components/icons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ export function PeopleDataLabsIcon(props: SVGProps<SVGSVGElement>) {
905905
{...props}
906906
>
907907
<path
908-
fill='#fff'
908+
fill='currentColor'
909909
fillRule='evenodd'
910910
d='M99.91,57.77l-3.2-24.4c0-.7-.4-1.3-.8-1.8l-20-21.3c-.5-.5-1.1-.8-1.8-1L29.21.07c-1.1-.2-2.2,0-2.9.8L1.01,24.07c-.9.8-1.2,2-.9,3.1l6,23.4c.3,1.2,1.3,2.1,2.5,2.4l9.9,2,11.3,6.6h0l11.9,6.5,14.9,20.6c.8,1.1,2.2,1.6,3.5,1.3l8.1-1.9c1.4-.3,2.5-1.6,2.5-3l.3-6.8,27.4-17.4c1.1-.7,1.6-1.9,1.5-3.1ZM90.31,35.17l2.1,16.3-40.2-26.8,20.4-8.4,17.7,18.8v.1ZM31.11,7.17l31.2,6.3-18.4,7.5h0l-16.8,7.3s4-21.1,4-21.1ZM12.01,47.07l-5-19.6,16.5-15.1-3.9,20.7c-.3,1.4.4,2.7,1.6,3.4l30.1,16.6-31-4.4-8.3-1.7v.1ZM60.81,83.17l-14-19.4c-.3-.4-.7-.7-1.1-1l-9.8-5.4,29,4.1-.4,14.7-.2,6-3.5.8v.2ZM83.01,62.97l-11.7,7.4.3-11.5c0-1.2-.6-2.3-1.7-2.9l-39.8-21.9,14.8-6.4,45.7,30.4-7.7,4.9h.1Z'
911911
/>

apps/sim/blocks/blocks/peopledatalabs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const PeopleDataLabsBlock: BlockConfig<PdlPersonEnrichResponse> = {
9595
title: 'Min Likelihood',
9696
type: 'short-input',
9797
placeholder: '6',
98-
condition: { field: 'operation', value: 'pdl_person_enrich' },
98+
condition: { field: 'operation', value: ['pdl_person_enrich', 'pdl_company_enrich'] },
9999
mode: 'advanced',
100100
},
101101

apps/sim/tools/peopledatalabs/company_search.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ export const companySearchTool: ToolConfig<PdlCompanySearchParams, PdlCompanySea
4242
visibility: 'user-or-llm',
4343
description: 'Pagination token returned from a prior response',
4444
},
45-
dataset: {
46-
type: 'string',
47-
required: false,
48-
visibility: 'user-or-llm',
49-
description: 'Dataset filter (e.g., all)',
50-
},
5145
},
5246

5347
request: {
@@ -70,7 +64,6 @@ export const companySearchTool: ToolConfig<PdlCompanySearchParams, PdlCompanySea
7064
}
7165
if (params.size !== undefined) body.size = Number(params.size)
7266
if (params.scroll_token) body.scroll_token = params.scroll_token
73-
if (params.dataset) body.dataset = params.dataset
7467
return body
7568
},
7669
},

apps/sim/tools/peopledatalabs/person_identify.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ export const personIdentifyTool: ToolConfig<PdlPersonIdentifyParams, PdlPersonId
182182

183183
transformResponse: async (response: Response) => {
184184
const data = (await response.json()) as Record<string, unknown>
185+
const status = (data.status as number) ?? response.status
186+
187+
if (status === 404) {
188+
return { success: true, output: { matches: [] } }
189+
}
185190

186191
if (!response.ok) {
187192
const error = (data.error as { message?: string })?.message

apps/sim/tools/peopledatalabs/types.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ export interface PdlCompanySearchParams {
272272
query?: string
273273
size?: number
274274
scroll_token?: string
275-
dataset?: string
276275
}
277276

278277
export interface PdlCompanySearchResponse extends ToolResponse {
@@ -401,24 +400,22 @@ export const PDL_LOCATION_OUTPUT_PROPERTIES = {
401400
name: { type: 'string', description: 'Normalized location name', optional: true },
402401
locality: { type: 'string', description: 'City', optional: true },
403402
region: { type: 'string', description: 'State/region', optional: true },
403+
subregion: { type: 'string', description: 'Subregion (e.g., county)', optional: true },
404404
country: { type: 'string', description: 'Country', optional: true },
405405
continent: { type: 'string', description: 'Continent', optional: true },
406406
type: { type: 'string', description: 'Location type', optional: true },
407407
geo: { type: 'string', description: 'Latitude,longitude string', optional: true },
408-
latitude: { type: 'number', description: 'Latitude', optional: true },
409-
longitude: { type: 'number', description: 'Longitude', optional: true },
410408
} as const satisfies Record<string, OutputProperty>
411409

412410
export interface PdlLocationRecord {
413411
name?: string
414412
locality?: string
415413
region?: string
414+
subregion?: string
416415
country?: string
417416
continent?: string
418417
type?: string
419418
geo?: string
420-
latitude?: number
421-
longitude?: number
422419
}
423420

424421
export interface PdlCleanLocationResponse extends ToolResponse {
@@ -448,10 +445,12 @@ export const PDL_SCHOOL_OUTPUT_PROPERTIES = {
448445
linkedin_id: { type: 'string', description: 'LinkedIn ID', optional: true },
449446
facebook_url: { type: 'string', description: 'Facebook URL', optional: true },
450447
twitter_url: { type: 'string', description: 'Twitter URL', optional: true },
448+
domain: { type: 'string', description: 'School domain', optional: true },
451449
location_name: { type: 'string', description: 'Location name', optional: true },
452450
location_locality: { type: 'string', description: 'City', optional: true },
453451
location_region: { type: 'string', description: 'State/region', optional: true },
454452
location_country: { type: 'string', description: 'Country', optional: true },
453+
location_continent: { type: 'string', description: 'Continent', optional: true },
455454
} as const satisfies Record<string, OutputProperty>
456455

457456
export interface PdlSchoolRecord {
@@ -463,10 +462,12 @@ export interface PdlSchoolRecord {
463462
linkedin_id?: string
464463
facebook_url?: string
465464
twitter_url?: string
465+
domain?: string
466466
location_name?: string
467467
location_locality?: string
468468
location_region?: string
469469
location_country?: string
470+
location_continent?: string
470471
}
471472

472473
export interface PdlCleanSchoolResponse extends ToolResponse {

apps/sim/tools/peopledatalabs/utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,11 @@ export function projectLocation(
112112
name: (r.name as string) ?? undefined,
113113
locality: (r.locality as string) ?? undefined,
114114
region: (r.region as string) ?? undefined,
115+
subregion: (r.subregion as string) ?? undefined,
115116
country: (r.country as string) ?? undefined,
116117
continent: (r.continent as string) ?? undefined,
117118
type: (r.type as string) ?? undefined,
118119
geo: (r.geo as string) ?? undefined,
119-
latitude: (r.latitude as number) ?? undefined,
120-
longitude: (r.longitude as number) ?? undefined,
121120
}
122121
}
123122

@@ -136,10 +135,13 @@ export function projectSchool(raw: Record<string, unknown> | null | undefined):
136135
linkedin_id: (r.linkedin_id as string) ?? undefined,
137136
facebook_url: (r.facebook_url as string) ?? undefined,
138137
twitter_url: (r.twitter_url as string) ?? undefined,
138+
domain: (r.domain as string) ?? undefined,
139139
location_name: (r.location_name as string) ?? (location.name as string) ?? undefined,
140140
location_locality:
141141
(r.location_locality as string) ?? (location.locality as string) ?? undefined,
142142
location_region: (r.location_region as string) ?? (location.region as string) ?? undefined,
143143
location_country: (r.location_country as string) ?? (location.country as string) ?? undefined,
144+
location_continent:
145+
(r.location_continent as string) ?? (location.continent as string) ?? undefined,
144146
}
145147
}

0 commit comments

Comments
 (0)