lumnisai 0.1.25 → 0.1.26
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.
- package/dist/index.cjs +237 -0
- package/dist/index.d.cts +137 -4
- package/dist/index.d.mts +137 -4
- package/dist/index.d.ts +137 -4
- package/dist/index.mjs +237 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1966,6 +1966,148 @@ class ResponsesResource {
|
|
|
1966
1966
|
constructor(http) {
|
|
1967
1967
|
this.http = http;
|
|
1968
1968
|
}
|
|
1969
|
+
_getParamValue(obj, camel, snake) {
|
|
1970
|
+
if (!obj)
|
|
1971
|
+
return void 0;
|
|
1972
|
+
if (Object.prototype.hasOwnProperty.call(obj, camel))
|
|
1973
|
+
return obj[camel];
|
|
1974
|
+
if (Object.prototype.hasOwnProperty.call(obj, snake))
|
|
1975
|
+
return obj[snake];
|
|
1976
|
+
return void 0;
|
|
1977
|
+
}
|
|
1978
|
+
_isPlainObject(value) {
|
|
1979
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
1980
|
+
}
|
|
1981
|
+
_validateCriteriaDefinitions(criteriaDefinitions) {
|
|
1982
|
+
if (!Array.isArray(criteriaDefinitions))
|
|
1983
|
+
throw new ValidationError("criteria_definitions must be a list");
|
|
1984
|
+
if (criteriaDefinitions.length === 0)
|
|
1985
|
+
throw new ValidationError("criteria_definitions cannot be empty");
|
|
1986
|
+
const criterionIds = /* @__PURE__ */ new Set();
|
|
1987
|
+
const columnNames = /* @__PURE__ */ new Set();
|
|
1988
|
+
const validTypes = ["universal", "varying", "validation_only"];
|
|
1989
|
+
criteriaDefinitions.forEach((criterion, index) => {
|
|
1990
|
+
if (!this._isPlainObject(criterion))
|
|
1991
|
+
throw new ValidationError(`Criterion ${index} must be an object`);
|
|
1992
|
+
const criterionId = this._getParamValue(criterion, "criterionId", "criterion_id");
|
|
1993
|
+
const columnName = this._getParamValue(criterion, "columnName", "column_name");
|
|
1994
|
+
const criterionText = this._getParamValue(criterion, "criterionText", "criterion_text");
|
|
1995
|
+
const criterionType = this._getParamValue(criterion, "criterionType", "criterion_type");
|
|
1996
|
+
const weightRaw = this._getParamValue(criterion, "weight", "weight");
|
|
1997
|
+
if (!criterionId || typeof criterionId !== "string")
|
|
1998
|
+
throw new ValidationError(`Criterion ${index} criterion_id must be a non-empty string`);
|
|
1999
|
+
if (criterionIds.has(criterionId))
|
|
2000
|
+
throw new ValidationError(`Duplicate criterion_id: ${criterionId}`);
|
|
2001
|
+
criterionIds.add(criterionId);
|
|
2002
|
+
if (!columnName || typeof columnName !== "string")
|
|
2003
|
+
throw new ValidationError(`Criterion ${index} column_name must be a non-empty string`);
|
|
2004
|
+
if (columnNames.has(columnName))
|
|
2005
|
+
throw new ValidationError(`Duplicate column_name: ${columnName}`);
|
|
2006
|
+
columnNames.add(columnName);
|
|
2007
|
+
if (!criterionText || typeof criterionText !== "string")
|
|
2008
|
+
throw new ValidationError(`Criterion ${index} criterion_text must be a non-empty string`);
|
|
2009
|
+
if (!criterionType || !validTypes.includes(criterionType))
|
|
2010
|
+
throw new ValidationError(`Criterion ${index} has invalid criterion_type: ${String(criterionType)}`);
|
|
2011
|
+
const weight = Number(weightRaw);
|
|
2012
|
+
if (!Number.isFinite(weight))
|
|
2013
|
+
throw new ValidationError(`Criterion ${index} weight must be a number`);
|
|
2014
|
+
if (weight <= 0)
|
|
2015
|
+
throw new ValidationError(`Criterion ${index} weight must be positive`);
|
|
2016
|
+
});
|
|
2017
|
+
}
|
|
2018
|
+
_validateCriteriaClassification(criteriaClassification) {
|
|
2019
|
+
if (!this._isPlainObject(criteriaClassification))
|
|
2020
|
+
throw new ValidationError("criteria_classification must be an object");
|
|
2021
|
+
const universalCriteria = this._getParamValue(criteriaClassification, "universalCriteria", "universal_criteria");
|
|
2022
|
+
const varyingCriteria = this._getParamValue(criteriaClassification, "varyingCriteria", "varying_criteria");
|
|
2023
|
+
const validationOnlyCriteria = this._getParamValue(criteriaClassification, "validationOnlyCriteria", "validation_only_criteria");
|
|
2024
|
+
if (!Array.isArray(universalCriteria))
|
|
2025
|
+
throw new ValidationError("criteria_classification missing or invalid universal_criteria");
|
|
2026
|
+
if (!Array.isArray(varyingCriteria))
|
|
2027
|
+
throw new ValidationError("criteria_classification missing or invalid varying_criteria");
|
|
2028
|
+
if (!Array.isArray(validationOnlyCriteria))
|
|
2029
|
+
throw new ValidationError("criteria_classification missing or invalid validation_only_criteria");
|
|
2030
|
+
}
|
|
2031
|
+
_validateCriteriaParams(params, specializedAgent) {
|
|
2032
|
+
if (!params)
|
|
2033
|
+
return;
|
|
2034
|
+
const rawParams = params;
|
|
2035
|
+
const reuseCriteriaFrom = this._getParamValue(rawParams, "reuseCriteriaFrom", "reuse_criteria_from");
|
|
2036
|
+
const criteriaDefinitions = this._getParamValue(
|
|
2037
|
+
rawParams,
|
|
2038
|
+
"criteriaDefinitions",
|
|
2039
|
+
"criteria_definitions"
|
|
2040
|
+
);
|
|
2041
|
+
const criteriaClassification = this._getParamValue(
|
|
2042
|
+
rawParams,
|
|
2043
|
+
"criteriaClassification",
|
|
2044
|
+
"criteria_classification"
|
|
2045
|
+
);
|
|
2046
|
+
const runSingleCriterion = this._getParamValue(rawParams, "runSingleCriterion", "run_single_criterion");
|
|
2047
|
+
const addCriterion = this._getParamValue(rawParams, "addCriterion", "add_criterion");
|
|
2048
|
+
const addAndRunCriterion = this._getParamValue(rawParams, "addAndRunCriterion", "add_and_run_criterion");
|
|
2049
|
+
const candidateProfiles = this._getParamValue(
|
|
2050
|
+
rawParams,
|
|
2051
|
+
"candidateProfiles",
|
|
2052
|
+
"candidate_profiles"
|
|
2053
|
+
);
|
|
2054
|
+
const hasCriteria = !!criteriaDefinitions && !!criteriaClassification;
|
|
2055
|
+
if (criteriaDefinitions && !criteriaClassification || !criteriaDefinitions && criteriaClassification) {
|
|
2056
|
+
throw new ValidationError(
|
|
2057
|
+
"When providing criteria directly, both criteria_definitions and criteria_classification must be provided."
|
|
2058
|
+
);
|
|
2059
|
+
}
|
|
2060
|
+
if (criteriaDefinitions || criteriaClassification) {
|
|
2061
|
+
this._validateCriteriaDefinitions(criteriaDefinitions);
|
|
2062
|
+
this._validateCriteriaClassification(criteriaClassification);
|
|
2063
|
+
}
|
|
2064
|
+
if (runSingleCriterion) {
|
|
2065
|
+
if (!reuseCriteriaFrom && !hasCriteria) {
|
|
2066
|
+
throw new ValidationError(
|
|
2067
|
+
"run_single_criterion requires reuse_criteria_from or explicit criteria_definitions/criteria_classification."
|
|
2068
|
+
);
|
|
2069
|
+
}
|
|
2070
|
+
if (typeof runSingleCriterion !== "string" || !runSingleCriterion.trim()) {
|
|
2071
|
+
throw new ValidationError("run_single_criterion must be a non-empty string");
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
if (addCriterion) {
|
|
2075
|
+
if (!reuseCriteriaFrom && !hasCriteria)
|
|
2076
|
+
throw new ValidationError("add_criterion requires existing criteria (reuse or direct criteria).");
|
|
2077
|
+
if (!this._isPlainObject(addCriterion))
|
|
2078
|
+
throw new ValidationError("add_criterion must be an object");
|
|
2079
|
+
const columnName = this._getParamValue(addCriterion, "columnName", "column_name");
|
|
2080
|
+
const criterionText = this._getParamValue(addCriterion, "criterionText", "criterion_text");
|
|
2081
|
+
if (!columnName || typeof columnName !== "string")
|
|
2082
|
+
throw new ValidationError("add_criterion requires column_name");
|
|
2083
|
+
if (!criterionText || typeof criterionText !== "string")
|
|
2084
|
+
throw new ValidationError("add_criterion requires criterion_text");
|
|
2085
|
+
}
|
|
2086
|
+
if (addAndRunCriterion !== void 0) {
|
|
2087
|
+
if (!reuseCriteriaFrom && !hasCriteria)
|
|
2088
|
+
throw new ValidationError("add_and_run_criterion requires existing criteria (reuse or direct criteria).");
|
|
2089
|
+
if (typeof addAndRunCriterion !== "string" || !addAndRunCriterion.trim())
|
|
2090
|
+
throw new ValidationError("add_and_run_criterion must be a non-empty string");
|
|
2091
|
+
}
|
|
2092
|
+
if (specializedAgent === "people_scoring") {
|
|
2093
|
+
if (!candidateProfiles || !Array.isArray(candidateProfiles) || candidateProfiles.length === 0)
|
|
2094
|
+
throw new ValidationError("candidate_profiles is required for people_scoring agent and must be a non-empty list");
|
|
2095
|
+
const missingIds = [];
|
|
2096
|
+
candidateProfiles.forEach((candidate, index) => {
|
|
2097
|
+
const c = candidate || {};
|
|
2098
|
+
const linkedinUrl = c.linkedin_url || c.linkedinUrl;
|
|
2099
|
+
const email = c.email;
|
|
2100
|
+
const emails = c.emails;
|
|
2101
|
+
if (!linkedinUrl && !email && (!emails || !Array.isArray(emails) || emails.length === 0))
|
|
2102
|
+
missingIds.push({ index, name: c.name });
|
|
2103
|
+
});
|
|
2104
|
+
if (missingIds.length > 0) {
|
|
2105
|
+
throw new ValidationError(
|
|
2106
|
+
`Each candidate in candidate_profiles must include at least one identifier: linkedin_url or email. Missing identifiers for ${missingIds.length} candidates: ${JSON.stringify(missingIds)}`
|
|
2107
|
+
);
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
1969
2111
|
_validateFileReference(uri) {
|
|
1970
2112
|
if (uri.startsWith("artifact_"))
|
|
1971
2113
|
return;
|
|
@@ -2006,6 +2148,8 @@ class ResponsesResource {
|
|
|
2006
2148
|
for (const file of request.files)
|
|
2007
2149
|
this._validateFileReference(file.uri);
|
|
2008
2150
|
}
|
|
2151
|
+
if (request.specializedAgentParams)
|
|
2152
|
+
this._validateCriteriaParams(request.specializedAgentParams, request.specializedAgent);
|
|
2009
2153
|
return this.http.post("/responses", request);
|
|
2010
2154
|
}
|
|
2011
2155
|
/**
|
|
@@ -2104,6 +2248,99 @@ class ResponsesResource {
|
|
|
2104
2248
|
}
|
|
2105
2249
|
return this.create(request);
|
|
2106
2250
|
}
|
|
2251
|
+
/**
|
|
2252
|
+
* Perform a deep people search with AI-generated criteria and validation
|
|
2253
|
+
* @param query - Natural language search query describing ideal candidates
|
|
2254
|
+
* @param options - Optional search parameters
|
|
2255
|
+
* @param options.requestedCandidates - Number of candidates to find (default: 100)
|
|
2256
|
+
* @param options.dataSources - Specific data sources to use: ["PDL", "CORESIGNAL", "CRUST_DATA"]
|
|
2257
|
+
* @param options.reuseCriteriaFrom - Response ID to reuse criteria from
|
|
2258
|
+
* @param options.criteriaDefinitions - Pre-defined criteria definitions
|
|
2259
|
+
* @param options.criteriaClassification - Pre-defined criteria classification
|
|
2260
|
+
* @param options.runSingleCriterion - Run only a single criterion by ID
|
|
2261
|
+
* @param options.addCriterion - Add a new criterion to existing criteria
|
|
2262
|
+
* @param options.addAndRunCriterion - Add criterion from text and run only that criterion
|
|
2263
|
+
* @param options.excludeProfiles - LinkedIn URLs to exclude from results
|
|
2264
|
+
* @param options.excludePreviouslyContacted - Exclude previously contacted people
|
|
2265
|
+
* @param options.excludeNames - Names to exclude from results
|
|
2266
|
+
* @returns Response with structured_response containing:
|
|
2267
|
+
* - candidates: Validated and scored candidates
|
|
2268
|
+
* - criteria: Generated/reused criteria definitions and classification
|
|
2269
|
+
* - searchStats: Search execution statistics
|
|
2270
|
+
*/
|
|
2271
|
+
async deepPeopleSearch(query, options) {
|
|
2272
|
+
const request = {
|
|
2273
|
+
messages: [{ role: "user", content: query }],
|
|
2274
|
+
specializedAgent: "deep_people_search"
|
|
2275
|
+
};
|
|
2276
|
+
if (options) {
|
|
2277
|
+
const params = {};
|
|
2278
|
+
if (options.requestedCandidates !== void 0)
|
|
2279
|
+
params.requestedCandidates = options.requestedCandidates;
|
|
2280
|
+
if (options.dataSources)
|
|
2281
|
+
params.dataSources = options.dataSources;
|
|
2282
|
+
if (options.reuseCriteriaFrom)
|
|
2283
|
+
params.reuseCriteriaFrom = options.reuseCriteriaFrom;
|
|
2284
|
+
if (options.criteriaDefinitions)
|
|
2285
|
+
params.criteriaDefinitions = options.criteriaDefinitions;
|
|
2286
|
+
if (options.criteriaClassification)
|
|
2287
|
+
params.criteriaClassification = options.criteriaClassification;
|
|
2288
|
+
if (options.runSingleCriterion)
|
|
2289
|
+
params.runSingleCriterion = options.runSingleCriterion;
|
|
2290
|
+
if (options.addCriterion)
|
|
2291
|
+
params.addCriterion = options.addCriterion;
|
|
2292
|
+
if (options.addAndRunCriterion)
|
|
2293
|
+
params.addAndRunCriterion = options.addAndRunCriterion;
|
|
2294
|
+
if (options.excludeProfiles)
|
|
2295
|
+
params.excludeProfiles = options.excludeProfiles;
|
|
2296
|
+
if (options.excludePreviouslyContacted !== void 0)
|
|
2297
|
+
params.excludePreviouslyContacted = options.excludePreviouslyContacted;
|
|
2298
|
+
if (options.excludeNames)
|
|
2299
|
+
params.excludeNames = options.excludeNames;
|
|
2300
|
+
if (Object.keys(params).length > 0)
|
|
2301
|
+
request.specializedAgentParams = params;
|
|
2302
|
+
}
|
|
2303
|
+
return this.create(request);
|
|
2304
|
+
}
|
|
2305
|
+
/**
|
|
2306
|
+
* Score provided candidates against AI-generated or provided criteria
|
|
2307
|
+
* @param query - Natural language description of ideal candidate criteria
|
|
2308
|
+
* @param candidateProfiles - List of candidates to score (each must have linkedin_url or email)
|
|
2309
|
+
* @param options - Optional scoring parameters
|
|
2310
|
+
* @param options.reuseCriteriaFrom - Response ID to reuse criteria from
|
|
2311
|
+
* @param options.criteriaDefinitions - Pre-defined criteria definitions
|
|
2312
|
+
* @param options.criteriaClassification - Pre-defined criteria classification
|
|
2313
|
+
* @param options.runSingleCriterion - Run only a single criterion by ID
|
|
2314
|
+
* @param options.addCriterion - Add a new criterion to existing criteria
|
|
2315
|
+
* @param options.addAndRunCriterion - Add criterion from text and run only that criterion
|
|
2316
|
+
* @returns Response with structured_response containing:
|
|
2317
|
+
* - candidates: Scored candidates with validation results
|
|
2318
|
+
* - criteria: Generated/reused criteria definitions and classification
|
|
2319
|
+
*/
|
|
2320
|
+
async peopleScoring(query, candidateProfiles, options) {
|
|
2321
|
+
const request = {
|
|
2322
|
+
messages: [{ role: "user", content: query }],
|
|
2323
|
+
specializedAgent: "people_scoring",
|
|
2324
|
+
specializedAgentParams: {
|
|
2325
|
+
candidateProfiles
|
|
2326
|
+
}
|
|
2327
|
+
};
|
|
2328
|
+
if (options) {
|
|
2329
|
+
if (options.reuseCriteriaFrom)
|
|
2330
|
+
request.specializedAgentParams.reuseCriteriaFrom = options.reuseCriteriaFrom;
|
|
2331
|
+
if (options.criteriaDefinitions)
|
|
2332
|
+
request.specializedAgentParams.criteriaDefinitions = options.criteriaDefinitions;
|
|
2333
|
+
if (options.criteriaClassification)
|
|
2334
|
+
request.specializedAgentParams.criteriaClassification = options.criteriaClassification;
|
|
2335
|
+
if (options.runSingleCriterion)
|
|
2336
|
+
request.specializedAgentParams.runSingleCriterion = options.runSingleCriterion;
|
|
2337
|
+
if (options.addCriterion)
|
|
2338
|
+
request.specializedAgentParams.addCriterion = options.addCriterion;
|
|
2339
|
+
if (options.addAndRunCriterion)
|
|
2340
|
+
request.specializedAgentParams.addAndRunCriterion = options.addAndRunCriterion;
|
|
2341
|
+
}
|
|
2342
|
+
return this.create(request);
|
|
2343
|
+
}
|
|
2107
2344
|
}
|
|
2108
2345
|
|
|
2109
2346
|
class SkillsResource {
|
package/dist/index.d.cts
CHANGED
|
@@ -638,11 +638,44 @@ interface AgentConfig {
|
|
|
638
638
|
interface ModelOverrides {
|
|
639
639
|
[key: string]: string;
|
|
640
640
|
}
|
|
641
|
+
type CriterionType = 'universal' | 'varying' | 'validation_only';
|
|
642
|
+
interface CriterionDefinition {
|
|
643
|
+
criterionId: string;
|
|
644
|
+
columnName: string;
|
|
645
|
+
criterionText: string;
|
|
646
|
+
criterionType: CriterionType;
|
|
647
|
+
weight: number;
|
|
648
|
+
}
|
|
649
|
+
interface CriteriaClassification {
|
|
650
|
+
universalCriteria: CriterionDefinition[];
|
|
651
|
+
varyingCriteria: CriterionDefinition[];
|
|
652
|
+
validationOnlyCriteria: CriterionDefinition[];
|
|
653
|
+
universalReasoning?: string;
|
|
654
|
+
varyingReasoning?: string;
|
|
655
|
+
validationReasoning?: string;
|
|
656
|
+
}
|
|
657
|
+
interface AddCriterionRequest {
|
|
658
|
+
columnName: string;
|
|
659
|
+
criterionText: string;
|
|
660
|
+
criterionType?: CriterionType;
|
|
661
|
+
weight?: number;
|
|
662
|
+
}
|
|
663
|
+
interface CriteriaMetadata {
|
|
664
|
+
version: number;
|
|
665
|
+
createdAt: string;
|
|
666
|
+
source: 'generated' | 'reused' | 'provided';
|
|
667
|
+
sourceResponseId?: string;
|
|
668
|
+
criteriaDefinitions: CriterionDefinition[];
|
|
669
|
+
criteriaClassification: CriteriaClassification;
|
|
670
|
+
}
|
|
671
|
+
interface StructuredResponse extends Record<string, any> {
|
|
672
|
+
criteria?: CriteriaMetadata;
|
|
673
|
+
}
|
|
641
674
|
/**
|
|
642
675
|
* Available specialized agents
|
|
643
676
|
* Using a union type that can be extended with any string to support future agents
|
|
644
677
|
*/
|
|
645
|
-
type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | (string & {});
|
|
678
|
+
type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | 'people_scoring' | (string & {});
|
|
646
679
|
/**
|
|
647
680
|
* Parameters for specialized agent execution
|
|
648
681
|
* This is a flexible interface that supports any agent-specific parameters
|
|
@@ -677,6 +710,35 @@ interface SpecializedAgentParams {
|
|
|
677
710
|
* Names to exclude from results (passed through to CrustData post-processing when supported).
|
|
678
711
|
*/
|
|
679
712
|
excludeNames?: string[];
|
|
713
|
+
/**
|
|
714
|
+
* Response ID to reuse criteria from.
|
|
715
|
+
*/
|
|
716
|
+
reuseCriteriaFrom?: string;
|
|
717
|
+
/**
|
|
718
|
+
* Pre-defined criteria definitions to use.
|
|
719
|
+
*/
|
|
720
|
+
criteriaDefinitions?: CriterionDefinition[];
|
|
721
|
+
/**
|
|
722
|
+
* Pre-defined criteria classification to use.
|
|
723
|
+
*/
|
|
724
|
+
criteriaClassification?: CriteriaClassification;
|
|
725
|
+
/**
|
|
726
|
+
* Run validation against a single criterion ID.
|
|
727
|
+
*/
|
|
728
|
+
runSingleCriterion?: string;
|
|
729
|
+
/**
|
|
730
|
+
* Add a new criterion to existing criteria.
|
|
731
|
+
*/
|
|
732
|
+
addCriterion?: AddCriterionRequest;
|
|
733
|
+
/**
|
|
734
|
+
* Add a new criterion from English text and run only that criterion.
|
|
735
|
+
*/
|
|
736
|
+
addAndRunCriterion?: string;
|
|
737
|
+
/**
|
|
738
|
+
* List of candidate profiles to score (for people_scoring agent).
|
|
739
|
+
* Each candidate must include at least one identifier: linkedin_url or email/emails.
|
|
740
|
+
*/
|
|
741
|
+
candidateProfiles?: Array<Record<string, any>>;
|
|
680
742
|
/**
|
|
681
743
|
* Additional parameters for any specialized agent
|
|
682
744
|
* This allows flexibility for future agents without SDK updates
|
|
@@ -695,7 +757,7 @@ interface CreateResponseRequest {
|
|
|
695
757
|
modelOverrides?: ModelOverrides;
|
|
696
758
|
/**
|
|
697
759
|
* Route to a specialized agent instead of the main Lumnis agent
|
|
698
|
-
* Known agents: 'quick_people_search', 'deep_people_search'
|
|
760
|
+
* Known agents: 'quick_people_search', 'deep_people_search', 'people_scoring'
|
|
699
761
|
* Accepts any string to support future agents without SDK updates
|
|
700
762
|
*/
|
|
701
763
|
specializedAgent?: SpecializedAgentType;
|
|
@@ -728,7 +790,7 @@ interface ResponseObject {
|
|
|
728
790
|
outputText?: string | null;
|
|
729
791
|
content?: string | null;
|
|
730
792
|
responseTitle?: string | null;
|
|
731
|
-
structuredResponse?:
|
|
793
|
+
structuredResponse?: StructuredResponse | null;
|
|
732
794
|
artifacts?: ResponseArtifact[] | null;
|
|
733
795
|
createdAt: string;
|
|
734
796
|
completedAt?: string | null;
|
|
@@ -2806,6 +2868,11 @@ declare class PeopleResource {
|
|
|
2806
2868
|
declare class ResponsesResource {
|
|
2807
2869
|
private readonly http;
|
|
2808
2870
|
constructor(http: Http);
|
|
2871
|
+
private _getParamValue;
|
|
2872
|
+
private _isPlainObject;
|
|
2873
|
+
private _validateCriteriaDefinitions;
|
|
2874
|
+
private _validateCriteriaClassification;
|
|
2875
|
+
private _validateCriteriaParams;
|
|
2809
2876
|
private _validateFileReference;
|
|
2810
2877
|
/**
|
|
2811
2878
|
* Create a new response request for asynchronous processing
|
|
@@ -2878,6 +2945,72 @@ declare class ResponsesResource {
|
|
|
2878
2945
|
limit?: number;
|
|
2879
2946
|
dataSources?: string[];
|
|
2880
2947
|
}): Promise<CreateResponseResponse>;
|
|
2948
|
+
/**
|
|
2949
|
+
* Perform a deep people search with AI-generated criteria and validation
|
|
2950
|
+
* @param query - Natural language search query describing ideal candidates
|
|
2951
|
+
* @param options - Optional search parameters
|
|
2952
|
+
* @param options.requestedCandidates - Number of candidates to find (default: 100)
|
|
2953
|
+
* @param options.dataSources - Specific data sources to use: ["PDL", "CORESIGNAL", "CRUST_DATA"]
|
|
2954
|
+
* @param options.reuseCriteriaFrom - Response ID to reuse criteria from
|
|
2955
|
+
* @param options.criteriaDefinitions - Pre-defined criteria definitions
|
|
2956
|
+
* @param options.criteriaClassification - Pre-defined criteria classification
|
|
2957
|
+
* @param options.runSingleCriterion - Run only a single criterion by ID
|
|
2958
|
+
* @param options.addCriterion - Add a new criterion to existing criteria
|
|
2959
|
+
* @param options.addAndRunCriterion - Add criterion from text and run only that criterion
|
|
2960
|
+
* @param options.excludeProfiles - LinkedIn URLs to exclude from results
|
|
2961
|
+
* @param options.excludePreviouslyContacted - Exclude previously contacted people
|
|
2962
|
+
* @param options.excludeNames - Names to exclude from results
|
|
2963
|
+
* @returns Response with structured_response containing:
|
|
2964
|
+
* - candidates: Validated and scored candidates
|
|
2965
|
+
* - criteria: Generated/reused criteria definitions and classification
|
|
2966
|
+
* - searchStats: Search execution statistics
|
|
2967
|
+
*/
|
|
2968
|
+
deepPeopleSearch(query: string, options?: {
|
|
2969
|
+
requestedCandidates?: number;
|
|
2970
|
+
dataSources?: string[];
|
|
2971
|
+
reuseCriteriaFrom?: string;
|
|
2972
|
+
criteriaDefinitions?: CriterionDefinition[];
|
|
2973
|
+
criteriaClassification?: CriteriaClassification;
|
|
2974
|
+
runSingleCriterion?: string;
|
|
2975
|
+
addCriterion?: {
|
|
2976
|
+
columnName: string;
|
|
2977
|
+
criterionText: string;
|
|
2978
|
+
criterionType?: CriterionType;
|
|
2979
|
+
weight?: number;
|
|
2980
|
+
};
|
|
2981
|
+
addAndRunCriterion?: string;
|
|
2982
|
+
excludeProfiles?: string[];
|
|
2983
|
+
excludePreviouslyContacted?: boolean;
|
|
2984
|
+
excludeNames?: string[];
|
|
2985
|
+
}): Promise<CreateResponseResponse>;
|
|
2986
|
+
/**
|
|
2987
|
+
* Score provided candidates against AI-generated or provided criteria
|
|
2988
|
+
* @param query - Natural language description of ideal candidate criteria
|
|
2989
|
+
* @param candidateProfiles - List of candidates to score (each must have linkedin_url or email)
|
|
2990
|
+
* @param options - Optional scoring parameters
|
|
2991
|
+
* @param options.reuseCriteriaFrom - Response ID to reuse criteria from
|
|
2992
|
+
* @param options.criteriaDefinitions - Pre-defined criteria definitions
|
|
2993
|
+
* @param options.criteriaClassification - Pre-defined criteria classification
|
|
2994
|
+
* @param options.runSingleCriterion - Run only a single criterion by ID
|
|
2995
|
+
* @param options.addCriterion - Add a new criterion to existing criteria
|
|
2996
|
+
* @param options.addAndRunCriterion - Add criterion from text and run only that criterion
|
|
2997
|
+
* @returns Response with structured_response containing:
|
|
2998
|
+
* - candidates: Scored candidates with validation results
|
|
2999
|
+
* - criteria: Generated/reused criteria definitions and classification
|
|
3000
|
+
*/
|
|
3001
|
+
peopleScoring(query: string, candidateProfiles: Array<Record<string, any>>, options?: {
|
|
3002
|
+
reuseCriteriaFrom?: string;
|
|
3003
|
+
criteriaDefinitions?: CriterionDefinition[];
|
|
3004
|
+
criteriaClassification?: CriteriaClassification;
|
|
3005
|
+
runSingleCriterion?: string;
|
|
3006
|
+
addCriterion?: {
|
|
3007
|
+
columnName: string;
|
|
3008
|
+
criterionText: string;
|
|
3009
|
+
criterionType?: CriterionType;
|
|
3010
|
+
weight?: number;
|
|
3011
|
+
};
|
|
3012
|
+
addAndRunCriterion?: string;
|
|
3013
|
+
}): Promise<CreateResponseResponse>;
|
|
2881
3014
|
}
|
|
2882
3015
|
|
|
2883
3016
|
declare class SkillsResource {
|
|
@@ -3331,4 +3464,4 @@ declare class ProgressTracker {
|
|
|
3331
3464
|
*/
|
|
3332
3465
|
declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
|
|
3333
3466
|
|
|
3334
|
-
export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
|
|
3467
|
+
export { ACTION_DELAYS, type AddCriterionRequest, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type CriteriaClassification, type CriteriaMetadata, type CriterionDefinition, type CriterionType, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type StructuredResponse, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
|
package/dist/index.d.mts
CHANGED
|
@@ -638,11 +638,44 @@ interface AgentConfig {
|
|
|
638
638
|
interface ModelOverrides {
|
|
639
639
|
[key: string]: string;
|
|
640
640
|
}
|
|
641
|
+
type CriterionType = 'universal' | 'varying' | 'validation_only';
|
|
642
|
+
interface CriterionDefinition {
|
|
643
|
+
criterionId: string;
|
|
644
|
+
columnName: string;
|
|
645
|
+
criterionText: string;
|
|
646
|
+
criterionType: CriterionType;
|
|
647
|
+
weight: number;
|
|
648
|
+
}
|
|
649
|
+
interface CriteriaClassification {
|
|
650
|
+
universalCriteria: CriterionDefinition[];
|
|
651
|
+
varyingCriteria: CriterionDefinition[];
|
|
652
|
+
validationOnlyCriteria: CriterionDefinition[];
|
|
653
|
+
universalReasoning?: string;
|
|
654
|
+
varyingReasoning?: string;
|
|
655
|
+
validationReasoning?: string;
|
|
656
|
+
}
|
|
657
|
+
interface AddCriterionRequest {
|
|
658
|
+
columnName: string;
|
|
659
|
+
criterionText: string;
|
|
660
|
+
criterionType?: CriterionType;
|
|
661
|
+
weight?: number;
|
|
662
|
+
}
|
|
663
|
+
interface CriteriaMetadata {
|
|
664
|
+
version: number;
|
|
665
|
+
createdAt: string;
|
|
666
|
+
source: 'generated' | 'reused' | 'provided';
|
|
667
|
+
sourceResponseId?: string;
|
|
668
|
+
criteriaDefinitions: CriterionDefinition[];
|
|
669
|
+
criteriaClassification: CriteriaClassification;
|
|
670
|
+
}
|
|
671
|
+
interface StructuredResponse extends Record<string, any> {
|
|
672
|
+
criteria?: CriteriaMetadata;
|
|
673
|
+
}
|
|
641
674
|
/**
|
|
642
675
|
* Available specialized agents
|
|
643
676
|
* Using a union type that can be extended with any string to support future agents
|
|
644
677
|
*/
|
|
645
|
-
type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | (string & {});
|
|
678
|
+
type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | 'people_scoring' | (string & {});
|
|
646
679
|
/**
|
|
647
680
|
* Parameters for specialized agent execution
|
|
648
681
|
* This is a flexible interface that supports any agent-specific parameters
|
|
@@ -677,6 +710,35 @@ interface SpecializedAgentParams {
|
|
|
677
710
|
* Names to exclude from results (passed through to CrustData post-processing when supported).
|
|
678
711
|
*/
|
|
679
712
|
excludeNames?: string[];
|
|
713
|
+
/**
|
|
714
|
+
* Response ID to reuse criteria from.
|
|
715
|
+
*/
|
|
716
|
+
reuseCriteriaFrom?: string;
|
|
717
|
+
/**
|
|
718
|
+
* Pre-defined criteria definitions to use.
|
|
719
|
+
*/
|
|
720
|
+
criteriaDefinitions?: CriterionDefinition[];
|
|
721
|
+
/**
|
|
722
|
+
* Pre-defined criteria classification to use.
|
|
723
|
+
*/
|
|
724
|
+
criteriaClassification?: CriteriaClassification;
|
|
725
|
+
/**
|
|
726
|
+
* Run validation against a single criterion ID.
|
|
727
|
+
*/
|
|
728
|
+
runSingleCriterion?: string;
|
|
729
|
+
/**
|
|
730
|
+
* Add a new criterion to existing criteria.
|
|
731
|
+
*/
|
|
732
|
+
addCriterion?: AddCriterionRequest;
|
|
733
|
+
/**
|
|
734
|
+
* Add a new criterion from English text and run only that criterion.
|
|
735
|
+
*/
|
|
736
|
+
addAndRunCriterion?: string;
|
|
737
|
+
/**
|
|
738
|
+
* List of candidate profiles to score (for people_scoring agent).
|
|
739
|
+
* Each candidate must include at least one identifier: linkedin_url or email/emails.
|
|
740
|
+
*/
|
|
741
|
+
candidateProfiles?: Array<Record<string, any>>;
|
|
680
742
|
/**
|
|
681
743
|
* Additional parameters for any specialized agent
|
|
682
744
|
* This allows flexibility for future agents without SDK updates
|
|
@@ -695,7 +757,7 @@ interface CreateResponseRequest {
|
|
|
695
757
|
modelOverrides?: ModelOverrides;
|
|
696
758
|
/**
|
|
697
759
|
* Route to a specialized agent instead of the main Lumnis agent
|
|
698
|
-
* Known agents: 'quick_people_search', 'deep_people_search'
|
|
760
|
+
* Known agents: 'quick_people_search', 'deep_people_search', 'people_scoring'
|
|
699
761
|
* Accepts any string to support future agents without SDK updates
|
|
700
762
|
*/
|
|
701
763
|
specializedAgent?: SpecializedAgentType;
|
|
@@ -728,7 +790,7 @@ interface ResponseObject {
|
|
|
728
790
|
outputText?: string | null;
|
|
729
791
|
content?: string | null;
|
|
730
792
|
responseTitle?: string | null;
|
|
731
|
-
structuredResponse?:
|
|
793
|
+
structuredResponse?: StructuredResponse | null;
|
|
732
794
|
artifacts?: ResponseArtifact[] | null;
|
|
733
795
|
createdAt: string;
|
|
734
796
|
completedAt?: string | null;
|
|
@@ -2806,6 +2868,11 @@ declare class PeopleResource {
|
|
|
2806
2868
|
declare class ResponsesResource {
|
|
2807
2869
|
private readonly http;
|
|
2808
2870
|
constructor(http: Http);
|
|
2871
|
+
private _getParamValue;
|
|
2872
|
+
private _isPlainObject;
|
|
2873
|
+
private _validateCriteriaDefinitions;
|
|
2874
|
+
private _validateCriteriaClassification;
|
|
2875
|
+
private _validateCriteriaParams;
|
|
2809
2876
|
private _validateFileReference;
|
|
2810
2877
|
/**
|
|
2811
2878
|
* Create a new response request for asynchronous processing
|
|
@@ -2878,6 +2945,72 @@ declare class ResponsesResource {
|
|
|
2878
2945
|
limit?: number;
|
|
2879
2946
|
dataSources?: string[];
|
|
2880
2947
|
}): Promise<CreateResponseResponse>;
|
|
2948
|
+
/**
|
|
2949
|
+
* Perform a deep people search with AI-generated criteria and validation
|
|
2950
|
+
* @param query - Natural language search query describing ideal candidates
|
|
2951
|
+
* @param options - Optional search parameters
|
|
2952
|
+
* @param options.requestedCandidates - Number of candidates to find (default: 100)
|
|
2953
|
+
* @param options.dataSources - Specific data sources to use: ["PDL", "CORESIGNAL", "CRUST_DATA"]
|
|
2954
|
+
* @param options.reuseCriteriaFrom - Response ID to reuse criteria from
|
|
2955
|
+
* @param options.criteriaDefinitions - Pre-defined criteria definitions
|
|
2956
|
+
* @param options.criteriaClassification - Pre-defined criteria classification
|
|
2957
|
+
* @param options.runSingleCriterion - Run only a single criterion by ID
|
|
2958
|
+
* @param options.addCriterion - Add a new criterion to existing criteria
|
|
2959
|
+
* @param options.addAndRunCriterion - Add criterion from text and run only that criterion
|
|
2960
|
+
* @param options.excludeProfiles - LinkedIn URLs to exclude from results
|
|
2961
|
+
* @param options.excludePreviouslyContacted - Exclude previously contacted people
|
|
2962
|
+
* @param options.excludeNames - Names to exclude from results
|
|
2963
|
+
* @returns Response with structured_response containing:
|
|
2964
|
+
* - candidates: Validated and scored candidates
|
|
2965
|
+
* - criteria: Generated/reused criteria definitions and classification
|
|
2966
|
+
* - searchStats: Search execution statistics
|
|
2967
|
+
*/
|
|
2968
|
+
deepPeopleSearch(query: string, options?: {
|
|
2969
|
+
requestedCandidates?: number;
|
|
2970
|
+
dataSources?: string[];
|
|
2971
|
+
reuseCriteriaFrom?: string;
|
|
2972
|
+
criteriaDefinitions?: CriterionDefinition[];
|
|
2973
|
+
criteriaClassification?: CriteriaClassification;
|
|
2974
|
+
runSingleCriterion?: string;
|
|
2975
|
+
addCriterion?: {
|
|
2976
|
+
columnName: string;
|
|
2977
|
+
criterionText: string;
|
|
2978
|
+
criterionType?: CriterionType;
|
|
2979
|
+
weight?: number;
|
|
2980
|
+
};
|
|
2981
|
+
addAndRunCriterion?: string;
|
|
2982
|
+
excludeProfiles?: string[];
|
|
2983
|
+
excludePreviouslyContacted?: boolean;
|
|
2984
|
+
excludeNames?: string[];
|
|
2985
|
+
}): Promise<CreateResponseResponse>;
|
|
2986
|
+
/**
|
|
2987
|
+
* Score provided candidates against AI-generated or provided criteria
|
|
2988
|
+
* @param query - Natural language description of ideal candidate criteria
|
|
2989
|
+
* @param candidateProfiles - List of candidates to score (each must have linkedin_url or email)
|
|
2990
|
+
* @param options - Optional scoring parameters
|
|
2991
|
+
* @param options.reuseCriteriaFrom - Response ID to reuse criteria from
|
|
2992
|
+
* @param options.criteriaDefinitions - Pre-defined criteria definitions
|
|
2993
|
+
* @param options.criteriaClassification - Pre-defined criteria classification
|
|
2994
|
+
* @param options.runSingleCriterion - Run only a single criterion by ID
|
|
2995
|
+
* @param options.addCriterion - Add a new criterion to existing criteria
|
|
2996
|
+
* @param options.addAndRunCriterion - Add criterion from text and run only that criterion
|
|
2997
|
+
* @returns Response with structured_response containing:
|
|
2998
|
+
* - candidates: Scored candidates with validation results
|
|
2999
|
+
* - criteria: Generated/reused criteria definitions and classification
|
|
3000
|
+
*/
|
|
3001
|
+
peopleScoring(query: string, candidateProfiles: Array<Record<string, any>>, options?: {
|
|
3002
|
+
reuseCriteriaFrom?: string;
|
|
3003
|
+
criteriaDefinitions?: CriterionDefinition[];
|
|
3004
|
+
criteriaClassification?: CriteriaClassification;
|
|
3005
|
+
runSingleCriterion?: string;
|
|
3006
|
+
addCriterion?: {
|
|
3007
|
+
columnName: string;
|
|
3008
|
+
criterionText: string;
|
|
3009
|
+
criterionType?: CriterionType;
|
|
3010
|
+
weight?: number;
|
|
3011
|
+
};
|
|
3012
|
+
addAndRunCriterion?: string;
|
|
3013
|
+
}): Promise<CreateResponseResponse>;
|
|
2881
3014
|
}
|
|
2882
3015
|
|
|
2883
3016
|
declare class SkillsResource {
|
|
@@ -3331,4 +3464,4 @@ declare class ProgressTracker {
|
|
|
3331
3464
|
*/
|
|
3332
3465
|
declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
|
|
3333
3466
|
|
|
3334
|
-
export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
|
|
3467
|
+
export { ACTION_DELAYS, type AddCriterionRequest, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type CriteriaClassification, type CriteriaMetadata, type CriterionDefinition, type CriterionType, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type StructuredResponse, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -638,11 +638,44 @@ interface AgentConfig {
|
|
|
638
638
|
interface ModelOverrides {
|
|
639
639
|
[key: string]: string;
|
|
640
640
|
}
|
|
641
|
+
type CriterionType = 'universal' | 'varying' | 'validation_only';
|
|
642
|
+
interface CriterionDefinition {
|
|
643
|
+
criterionId: string;
|
|
644
|
+
columnName: string;
|
|
645
|
+
criterionText: string;
|
|
646
|
+
criterionType: CriterionType;
|
|
647
|
+
weight: number;
|
|
648
|
+
}
|
|
649
|
+
interface CriteriaClassification {
|
|
650
|
+
universalCriteria: CriterionDefinition[];
|
|
651
|
+
varyingCriteria: CriterionDefinition[];
|
|
652
|
+
validationOnlyCriteria: CriterionDefinition[];
|
|
653
|
+
universalReasoning?: string;
|
|
654
|
+
varyingReasoning?: string;
|
|
655
|
+
validationReasoning?: string;
|
|
656
|
+
}
|
|
657
|
+
interface AddCriterionRequest {
|
|
658
|
+
columnName: string;
|
|
659
|
+
criterionText: string;
|
|
660
|
+
criterionType?: CriterionType;
|
|
661
|
+
weight?: number;
|
|
662
|
+
}
|
|
663
|
+
interface CriteriaMetadata {
|
|
664
|
+
version: number;
|
|
665
|
+
createdAt: string;
|
|
666
|
+
source: 'generated' | 'reused' | 'provided';
|
|
667
|
+
sourceResponseId?: string;
|
|
668
|
+
criteriaDefinitions: CriterionDefinition[];
|
|
669
|
+
criteriaClassification: CriteriaClassification;
|
|
670
|
+
}
|
|
671
|
+
interface StructuredResponse extends Record<string, any> {
|
|
672
|
+
criteria?: CriteriaMetadata;
|
|
673
|
+
}
|
|
641
674
|
/**
|
|
642
675
|
* Available specialized agents
|
|
643
676
|
* Using a union type that can be extended with any string to support future agents
|
|
644
677
|
*/
|
|
645
|
-
type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | (string & {});
|
|
678
|
+
type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | 'people_scoring' | (string & {});
|
|
646
679
|
/**
|
|
647
680
|
* Parameters for specialized agent execution
|
|
648
681
|
* This is a flexible interface that supports any agent-specific parameters
|
|
@@ -677,6 +710,35 @@ interface SpecializedAgentParams {
|
|
|
677
710
|
* Names to exclude from results (passed through to CrustData post-processing when supported).
|
|
678
711
|
*/
|
|
679
712
|
excludeNames?: string[];
|
|
713
|
+
/**
|
|
714
|
+
* Response ID to reuse criteria from.
|
|
715
|
+
*/
|
|
716
|
+
reuseCriteriaFrom?: string;
|
|
717
|
+
/**
|
|
718
|
+
* Pre-defined criteria definitions to use.
|
|
719
|
+
*/
|
|
720
|
+
criteriaDefinitions?: CriterionDefinition[];
|
|
721
|
+
/**
|
|
722
|
+
* Pre-defined criteria classification to use.
|
|
723
|
+
*/
|
|
724
|
+
criteriaClassification?: CriteriaClassification;
|
|
725
|
+
/**
|
|
726
|
+
* Run validation against a single criterion ID.
|
|
727
|
+
*/
|
|
728
|
+
runSingleCriterion?: string;
|
|
729
|
+
/**
|
|
730
|
+
* Add a new criterion to existing criteria.
|
|
731
|
+
*/
|
|
732
|
+
addCriterion?: AddCriterionRequest;
|
|
733
|
+
/**
|
|
734
|
+
* Add a new criterion from English text and run only that criterion.
|
|
735
|
+
*/
|
|
736
|
+
addAndRunCriterion?: string;
|
|
737
|
+
/**
|
|
738
|
+
* List of candidate profiles to score (for people_scoring agent).
|
|
739
|
+
* Each candidate must include at least one identifier: linkedin_url or email/emails.
|
|
740
|
+
*/
|
|
741
|
+
candidateProfiles?: Array<Record<string, any>>;
|
|
680
742
|
/**
|
|
681
743
|
* Additional parameters for any specialized agent
|
|
682
744
|
* This allows flexibility for future agents without SDK updates
|
|
@@ -695,7 +757,7 @@ interface CreateResponseRequest {
|
|
|
695
757
|
modelOverrides?: ModelOverrides;
|
|
696
758
|
/**
|
|
697
759
|
* Route to a specialized agent instead of the main Lumnis agent
|
|
698
|
-
* Known agents: 'quick_people_search', 'deep_people_search'
|
|
760
|
+
* Known agents: 'quick_people_search', 'deep_people_search', 'people_scoring'
|
|
699
761
|
* Accepts any string to support future agents without SDK updates
|
|
700
762
|
*/
|
|
701
763
|
specializedAgent?: SpecializedAgentType;
|
|
@@ -728,7 +790,7 @@ interface ResponseObject {
|
|
|
728
790
|
outputText?: string | null;
|
|
729
791
|
content?: string | null;
|
|
730
792
|
responseTitle?: string | null;
|
|
731
|
-
structuredResponse?:
|
|
793
|
+
structuredResponse?: StructuredResponse | null;
|
|
732
794
|
artifacts?: ResponseArtifact[] | null;
|
|
733
795
|
createdAt: string;
|
|
734
796
|
completedAt?: string | null;
|
|
@@ -2806,6 +2868,11 @@ declare class PeopleResource {
|
|
|
2806
2868
|
declare class ResponsesResource {
|
|
2807
2869
|
private readonly http;
|
|
2808
2870
|
constructor(http: Http);
|
|
2871
|
+
private _getParamValue;
|
|
2872
|
+
private _isPlainObject;
|
|
2873
|
+
private _validateCriteriaDefinitions;
|
|
2874
|
+
private _validateCriteriaClassification;
|
|
2875
|
+
private _validateCriteriaParams;
|
|
2809
2876
|
private _validateFileReference;
|
|
2810
2877
|
/**
|
|
2811
2878
|
* Create a new response request for asynchronous processing
|
|
@@ -2878,6 +2945,72 @@ declare class ResponsesResource {
|
|
|
2878
2945
|
limit?: number;
|
|
2879
2946
|
dataSources?: string[];
|
|
2880
2947
|
}): Promise<CreateResponseResponse>;
|
|
2948
|
+
/**
|
|
2949
|
+
* Perform a deep people search with AI-generated criteria and validation
|
|
2950
|
+
* @param query - Natural language search query describing ideal candidates
|
|
2951
|
+
* @param options - Optional search parameters
|
|
2952
|
+
* @param options.requestedCandidates - Number of candidates to find (default: 100)
|
|
2953
|
+
* @param options.dataSources - Specific data sources to use: ["PDL", "CORESIGNAL", "CRUST_DATA"]
|
|
2954
|
+
* @param options.reuseCriteriaFrom - Response ID to reuse criteria from
|
|
2955
|
+
* @param options.criteriaDefinitions - Pre-defined criteria definitions
|
|
2956
|
+
* @param options.criteriaClassification - Pre-defined criteria classification
|
|
2957
|
+
* @param options.runSingleCriterion - Run only a single criterion by ID
|
|
2958
|
+
* @param options.addCriterion - Add a new criterion to existing criteria
|
|
2959
|
+
* @param options.addAndRunCriterion - Add criterion from text and run only that criterion
|
|
2960
|
+
* @param options.excludeProfiles - LinkedIn URLs to exclude from results
|
|
2961
|
+
* @param options.excludePreviouslyContacted - Exclude previously contacted people
|
|
2962
|
+
* @param options.excludeNames - Names to exclude from results
|
|
2963
|
+
* @returns Response with structured_response containing:
|
|
2964
|
+
* - candidates: Validated and scored candidates
|
|
2965
|
+
* - criteria: Generated/reused criteria definitions and classification
|
|
2966
|
+
* - searchStats: Search execution statistics
|
|
2967
|
+
*/
|
|
2968
|
+
deepPeopleSearch(query: string, options?: {
|
|
2969
|
+
requestedCandidates?: number;
|
|
2970
|
+
dataSources?: string[];
|
|
2971
|
+
reuseCriteriaFrom?: string;
|
|
2972
|
+
criteriaDefinitions?: CriterionDefinition[];
|
|
2973
|
+
criteriaClassification?: CriteriaClassification;
|
|
2974
|
+
runSingleCriterion?: string;
|
|
2975
|
+
addCriterion?: {
|
|
2976
|
+
columnName: string;
|
|
2977
|
+
criterionText: string;
|
|
2978
|
+
criterionType?: CriterionType;
|
|
2979
|
+
weight?: number;
|
|
2980
|
+
};
|
|
2981
|
+
addAndRunCriterion?: string;
|
|
2982
|
+
excludeProfiles?: string[];
|
|
2983
|
+
excludePreviouslyContacted?: boolean;
|
|
2984
|
+
excludeNames?: string[];
|
|
2985
|
+
}): Promise<CreateResponseResponse>;
|
|
2986
|
+
/**
|
|
2987
|
+
* Score provided candidates against AI-generated or provided criteria
|
|
2988
|
+
* @param query - Natural language description of ideal candidate criteria
|
|
2989
|
+
* @param candidateProfiles - List of candidates to score (each must have linkedin_url or email)
|
|
2990
|
+
* @param options - Optional scoring parameters
|
|
2991
|
+
* @param options.reuseCriteriaFrom - Response ID to reuse criteria from
|
|
2992
|
+
* @param options.criteriaDefinitions - Pre-defined criteria definitions
|
|
2993
|
+
* @param options.criteriaClassification - Pre-defined criteria classification
|
|
2994
|
+
* @param options.runSingleCriterion - Run only a single criterion by ID
|
|
2995
|
+
* @param options.addCriterion - Add a new criterion to existing criteria
|
|
2996
|
+
* @param options.addAndRunCriterion - Add criterion from text and run only that criterion
|
|
2997
|
+
* @returns Response with structured_response containing:
|
|
2998
|
+
* - candidates: Scored candidates with validation results
|
|
2999
|
+
* - criteria: Generated/reused criteria definitions and classification
|
|
3000
|
+
*/
|
|
3001
|
+
peopleScoring(query: string, candidateProfiles: Array<Record<string, any>>, options?: {
|
|
3002
|
+
reuseCriteriaFrom?: string;
|
|
3003
|
+
criteriaDefinitions?: CriterionDefinition[];
|
|
3004
|
+
criteriaClassification?: CriteriaClassification;
|
|
3005
|
+
runSingleCriterion?: string;
|
|
3006
|
+
addCriterion?: {
|
|
3007
|
+
columnName: string;
|
|
3008
|
+
criterionText: string;
|
|
3009
|
+
criterionType?: CriterionType;
|
|
3010
|
+
weight?: number;
|
|
3011
|
+
};
|
|
3012
|
+
addAndRunCriterion?: string;
|
|
3013
|
+
}): Promise<CreateResponseResponse>;
|
|
2881
3014
|
}
|
|
2882
3015
|
|
|
2883
3016
|
declare class SkillsResource {
|
|
@@ -3331,4 +3464,4 @@ declare class ProgressTracker {
|
|
|
3331
3464
|
*/
|
|
3332
3465
|
declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
|
|
3333
3466
|
|
|
3334
|
-
export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
|
|
3467
|
+
export { ACTION_DELAYS, type AddCriterionRequest, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type CriteriaClassification, type CriteriaMetadata, type CriterionDefinition, type CriterionType, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type StructuredResponse, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
|
package/dist/index.mjs
CHANGED
|
@@ -1960,6 +1960,148 @@ class ResponsesResource {
|
|
|
1960
1960
|
constructor(http) {
|
|
1961
1961
|
this.http = http;
|
|
1962
1962
|
}
|
|
1963
|
+
_getParamValue(obj, camel, snake) {
|
|
1964
|
+
if (!obj)
|
|
1965
|
+
return void 0;
|
|
1966
|
+
if (Object.prototype.hasOwnProperty.call(obj, camel))
|
|
1967
|
+
return obj[camel];
|
|
1968
|
+
if (Object.prototype.hasOwnProperty.call(obj, snake))
|
|
1969
|
+
return obj[snake];
|
|
1970
|
+
return void 0;
|
|
1971
|
+
}
|
|
1972
|
+
_isPlainObject(value) {
|
|
1973
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
1974
|
+
}
|
|
1975
|
+
_validateCriteriaDefinitions(criteriaDefinitions) {
|
|
1976
|
+
if (!Array.isArray(criteriaDefinitions))
|
|
1977
|
+
throw new ValidationError("criteria_definitions must be a list");
|
|
1978
|
+
if (criteriaDefinitions.length === 0)
|
|
1979
|
+
throw new ValidationError("criteria_definitions cannot be empty");
|
|
1980
|
+
const criterionIds = /* @__PURE__ */ new Set();
|
|
1981
|
+
const columnNames = /* @__PURE__ */ new Set();
|
|
1982
|
+
const validTypes = ["universal", "varying", "validation_only"];
|
|
1983
|
+
criteriaDefinitions.forEach((criterion, index) => {
|
|
1984
|
+
if (!this._isPlainObject(criterion))
|
|
1985
|
+
throw new ValidationError(`Criterion ${index} must be an object`);
|
|
1986
|
+
const criterionId = this._getParamValue(criterion, "criterionId", "criterion_id");
|
|
1987
|
+
const columnName = this._getParamValue(criterion, "columnName", "column_name");
|
|
1988
|
+
const criterionText = this._getParamValue(criterion, "criterionText", "criterion_text");
|
|
1989
|
+
const criterionType = this._getParamValue(criterion, "criterionType", "criterion_type");
|
|
1990
|
+
const weightRaw = this._getParamValue(criterion, "weight", "weight");
|
|
1991
|
+
if (!criterionId || typeof criterionId !== "string")
|
|
1992
|
+
throw new ValidationError(`Criterion ${index} criterion_id must be a non-empty string`);
|
|
1993
|
+
if (criterionIds.has(criterionId))
|
|
1994
|
+
throw new ValidationError(`Duplicate criterion_id: ${criterionId}`);
|
|
1995
|
+
criterionIds.add(criterionId);
|
|
1996
|
+
if (!columnName || typeof columnName !== "string")
|
|
1997
|
+
throw new ValidationError(`Criterion ${index} column_name must be a non-empty string`);
|
|
1998
|
+
if (columnNames.has(columnName))
|
|
1999
|
+
throw new ValidationError(`Duplicate column_name: ${columnName}`);
|
|
2000
|
+
columnNames.add(columnName);
|
|
2001
|
+
if (!criterionText || typeof criterionText !== "string")
|
|
2002
|
+
throw new ValidationError(`Criterion ${index} criterion_text must be a non-empty string`);
|
|
2003
|
+
if (!criterionType || !validTypes.includes(criterionType))
|
|
2004
|
+
throw new ValidationError(`Criterion ${index} has invalid criterion_type: ${String(criterionType)}`);
|
|
2005
|
+
const weight = Number(weightRaw);
|
|
2006
|
+
if (!Number.isFinite(weight))
|
|
2007
|
+
throw new ValidationError(`Criterion ${index} weight must be a number`);
|
|
2008
|
+
if (weight <= 0)
|
|
2009
|
+
throw new ValidationError(`Criterion ${index} weight must be positive`);
|
|
2010
|
+
});
|
|
2011
|
+
}
|
|
2012
|
+
_validateCriteriaClassification(criteriaClassification) {
|
|
2013
|
+
if (!this._isPlainObject(criteriaClassification))
|
|
2014
|
+
throw new ValidationError("criteria_classification must be an object");
|
|
2015
|
+
const universalCriteria = this._getParamValue(criteriaClassification, "universalCriteria", "universal_criteria");
|
|
2016
|
+
const varyingCriteria = this._getParamValue(criteriaClassification, "varyingCriteria", "varying_criteria");
|
|
2017
|
+
const validationOnlyCriteria = this._getParamValue(criteriaClassification, "validationOnlyCriteria", "validation_only_criteria");
|
|
2018
|
+
if (!Array.isArray(universalCriteria))
|
|
2019
|
+
throw new ValidationError("criteria_classification missing or invalid universal_criteria");
|
|
2020
|
+
if (!Array.isArray(varyingCriteria))
|
|
2021
|
+
throw new ValidationError("criteria_classification missing or invalid varying_criteria");
|
|
2022
|
+
if (!Array.isArray(validationOnlyCriteria))
|
|
2023
|
+
throw new ValidationError("criteria_classification missing or invalid validation_only_criteria");
|
|
2024
|
+
}
|
|
2025
|
+
_validateCriteriaParams(params, specializedAgent) {
|
|
2026
|
+
if (!params)
|
|
2027
|
+
return;
|
|
2028
|
+
const rawParams = params;
|
|
2029
|
+
const reuseCriteriaFrom = this._getParamValue(rawParams, "reuseCriteriaFrom", "reuse_criteria_from");
|
|
2030
|
+
const criteriaDefinitions = this._getParamValue(
|
|
2031
|
+
rawParams,
|
|
2032
|
+
"criteriaDefinitions",
|
|
2033
|
+
"criteria_definitions"
|
|
2034
|
+
);
|
|
2035
|
+
const criteriaClassification = this._getParamValue(
|
|
2036
|
+
rawParams,
|
|
2037
|
+
"criteriaClassification",
|
|
2038
|
+
"criteria_classification"
|
|
2039
|
+
);
|
|
2040
|
+
const runSingleCriterion = this._getParamValue(rawParams, "runSingleCriterion", "run_single_criterion");
|
|
2041
|
+
const addCriterion = this._getParamValue(rawParams, "addCriterion", "add_criterion");
|
|
2042
|
+
const addAndRunCriterion = this._getParamValue(rawParams, "addAndRunCriterion", "add_and_run_criterion");
|
|
2043
|
+
const candidateProfiles = this._getParamValue(
|
|
2044
|
+
rawParams,
|
|
2045
|
+
"candidateProfiles",
|
|
2046
|
+
"candidate_profiles"
|
|
2047
|
+
);
|
|
2048
|
+
const hasCriteria = !!criteriaDefinitions && !!criteriaClassification;
|
|
2049
|
+
if (criteriaDefinitions && !criteriaClassification || !criteriaDefinitions && criteriaClassification) {
|
|
2050
|
+
throw new ValidationError(
|
|
2051
|
+
"When providing criteria directly, both criteria_definitions and criteria_classification must be provided."
|
|
2052
|
+
);
|
|
2053
|
+
}
|
|
2054
|
+
if (criteriaDefinitions || criteriaClassification) {
|
|
2055
|
+
this._validateCriteriaDefinitions(criteriaDefinitions);
|
|
2056
|
+
this._validateCriteriaClassification(criteriaClassification);
|
|
2057
|
+
}
|
|
2058
|
+
if (runSingleCriterion) {
|
|
2059
|
+
if (!reuseCriteriaFrom && !hasCriteria) {
|
|
2060
|
+
throw new ValidationError(
|
|
2061
|
+
"run_single_criterion requires reuse_criteria_from or explicit criteria_definitions/criteria_classification."
|
|
2062
|
+
);
|
|
2063
|
+
}
|
|
2064
|
+
if (typeof runSingleCriterion !== "string" || !runSingleCriterion.trim()) {
|
|
2065
|
+
throw new ValidationError("run_single_criterion must be a non-empty string");
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
if (addCriterion) {
|
|
2069
|
+
if (!reuseCriteriaFrom && !hasCriteria)
|
|
2070
|
+
throw new ValidationError("add_criterion requires existing criteria (reuse or direct criteria).");
|
|
2071
|
+
if (!this._isPlainObject(addCriterion))
|
|
2072
|
+
throw new ValidationError("add_criterion must be an object");
|
|
2073
|
+
const columnName = this._getParamValue(addCriterion, "columnName", "column_name");
|
|
2074
|
+
const criterionText = this._getParamValue(addCriterion, "criterionText", "criterion_text");
|
|
2075
|
+
if (!columnName || typeof columnName !== "string")
|
|
2076
|
+
throw new ValidationError("add_criterion requires column_name");
|
|
2077
|
+
if (!criterionText || typeof criterionText !== "string")
|
|
2078
|
+
throw new ValidationError("add_criterion requires criterion_text");
|
|
2079
|
+
}
|
|
2080
|
+
if (addAndRunCriterion !== void 0) {
|
|
2081
|
+
if (!reuseCriteriaFrom && !hasCriteria)
|
|
2082
|
+
throw new ValidationError("add_and_run_criterion requires existing criteria (reuse or direct criteria).");
|
|
2083
|
+
if (typeof addAndRunCriterion !== "string" || !addAndRunCriterion.trim())
|
|
2084
|
+
throw new ValidationError("add_and_run_criterion must be a non-empty string");
|
|
2085
|
+
}
|
|
2086
|
+
if (specializedAgent === "people_scoring") {
|
|
2087
|
+
if (!candidateProfiles || !Array.isArray(candidateProfiles) || candidateProfiles.length === 0)
|
|
2088
|
+
throw new ValidationError("candidate_profiles is required for people_scoring agent and must be a non-empty list");
|
|
2089
|
+
const missingIds = [];
|
|
2090
|
+
candidateProfiles.forEach((candidate, index) => {
|
|
2091
|
+
const c = candidate || {};
|
|
2092
|
+
const linkedinUrl = c.linkedin_url || c.linkedinUrl;
|
|
2093
|
+
const email = c.email;
|
|
2094
|
+
const emails = c.emails;
|
|
2095
|
+
if (!linkedinUrl && !email && (!emails || !Array.isArray(emails) || emails.length === 0))
|
|
2096
|
+
missingIds.push({ index, name: c.name });
|
|
2097
|
+
});
|
|
2098
|
+
if (missingIds.length > 0) {
|
|
2099
|
+
throw new ValidationError(
|
|
2100
|
+
`Each candidate in candidate_profiles must include at least one identifier: linkedin_url or email. Missing identifiers for ${missingIds.length} candidates: ${JSON.stringify(missingIds)}`
|
|
2101
|
+
);
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
1963
2105
|
_validateFileReference(uri) {
|
|
1964
2106
|
if (uri.startsWith("artifact_"))
|
|
1965
2107
|
return;
|
|
@@ -2000,6 +2142,8 @@ class ResponsesResource {
|
|
|
2000
2142
|
for (const file of request.files)
|
|
2001
2143
|
this._validateFileReference(file.uri);
|
|
2002
2144
|
}
|
|
2145
|
+
if (request.specializedAgentParams)
|
|
2146
|
+
this._validateCriteriaParams(request.specializedAgentParams, request.specializedAgent);
|
|
2003
2147
|
return this.http.post("/responses", request);
|
|
2004
2148
|
}
|
|
2005
2149
|
/**
|
|
@@ -2098,6 +2242,99 @@ class ResponsesResource {
|
|
|
2098
2242
|
}
|
|
2099
2243
|
return this.create(request);
|
|
2100
2244
|
}
|
|
2245
|
+
/**
|
|
2246
|
+
* Perform a deep people search with AI-generated criteria and validation
|
|
2247
|
+
* @param query - Natural language search query describing ideal candidates
|
|
2248
|
+
* @param options - Optional search parameters
|
|
2249
|
+
* @param options.requestedCandidates - Number of candidates to find (default: 100)
|
|
2250
|
+
* @param options.dataSources - Specific data sources to use: ["PDL", "CORESIGNAL", "CRUST_DATA"]
|
|
2251
|
+
* @param options.reuseCriteriaFrom - Response ID to reuse criteria from
|
|
2252
|
+
* @param options.criteriaDefinitions - Pre-defined criteria definitions
|
|
2253
|
+
* @param options.criteriaClassification - Pre-defined criteria classification
|
|
2254
|
+
* @param options.runSingleCriterion - Run only a single criterion by ID
|
|
2255
|
+
* @param options.addCriterion - Add a new criterion to existing criteria
|
|
2256
|
+
* @param options.addAndRunCriterion - Add criterion from text and run only that criterion
|
|
2257
|
+
* @param options.excludeProfiles - LinkedIn URLs to exclude from results
|
|
2258
|
+
* @param options.excludePreviouslyContacted - Exclude previously contacted people
|
|
2259
|
+
* @param options.excludeNames - Names to exclude from results
|
|
2260
|
+
* @returns Response with structured_response containing:
|
|
2261
|
+
* - candidates: Validated and scored candidates
|
|
2262
|
+
* - criteria: Generated/reused criteria definitions and classification
|
|
2263
|
+
* - searchStats: Search execution statistics
|
|
2264
|
+
*/
|
|
2265
|
+
async deepPeopleSearch(query, options) {
|
|
2266
|
+
const request = {
|
|
2267
|
+
messages: [{ role: "user", content: query }],
|
|
2268
|
+
specializedAgent: "deep_people_search"
|
|
2269
|
+
};
|
|
2270
|
+
if (options) {
|
|
2271
|
+
const params = {};
|
|
2272
|
+
if (options.requestedCandidates !== void 0)
|
|
2273
|
+
params.requestedCandidates = options.requestedCandidates;
|
|
2274
|
+
if (options.dataSources)
|
|
2275
|
+
params.dataSources = options.dataSources;
|
|
2276
|
+
if (options.reuseCriteriaFrom)
|
|
2277
|
+
params.reuseCriteriaFrom = options.reuseCriteriaFrom;
|
|
2278
|
+
if (options.criteriaDefinitions)
|
|
2279
|
+
params.criteriaDefinitions = options.criteriaDefinitions;
|
|
2280
|
+
if (options.criteriaClassification)
|
|
2281
|
+
params.criteriaClassification = options.criteriaClassification;
|
|
2282
|
+
if (options.runSingleCriterion)
|
|
2283
|
+
params.runSingleCriterion = options.runSingleCriterion;
|
|
2284
|
+
if (options.addCriterion)
|
|
2285
|
+
params.addCriterion = options.addCriterion;
|
|
2286
|
+
if (options.addAndRunCriterion)
|
|
2287
|
+
params.addAndRunCriterion = options.addAndRunCriterion;
|
|
2288
|
+
if (options.excludeProfiles)
|
|
2289
|
+
params.excludeProfiles = options.excludeProfiles;
|
|
2290
|
+
if (options.excludePreviouslyContacted !== void 0)
|
|
2291
|
+
params.excludePreviouslyContacted = options.excludePreviouslyContacted;
|
|
2292
|
+
if (options.excludeNames)
|
|
2293
|
+
params.excludeNames = options.excludeNames;
|
|
2294
|
+
if (Object.keys(params).length > 0)
|
|
2295
|
+
request.specializedAgentParams = params;
|
|
2296
|
+
}
|
|
2297
|
+
return this.create(request);
|
|
2298
|
+
}
|
|
2299
|
+
/**
|
|
2300
|
+
* Score provided candidates against AI-generated or provided criteria
|
|
2301
|
+
* @param query - Natural language description of ideal candidate criteria
|
|
2302
|
+
* @param candidateProfiles - List of candidates to score (each must have linkedin_url or email)
|
|
2303
|
+
* @param options - Optional scoring parameters
|
|
2304
|
+
* @param options.reuseCriteriaFrom - Response ID to reuse criteria from
|
|
2305
|
+
* @param options.criteriaDefinitions - Pre-defined criteria definitions
|
|
2306
|
+
* @param options.criteriaClassification - Pre-defined criteria classification
|
|
2307
|
+
* @param options.runSingleCriterion - Run only a single criterion by ID
|
|
2308
|
+
* @param options.addCriterion - Add a new criterion to existing criteria
|
|
2309
|
+
* @param options.addAndRunCriterion - Add criterion from text and run only that criterion
|
|
2310
|
+
* @returns Response with structured_response containing:
|
|
2311
|
+
* - candidates: Scored candidates with validation results
|
|
2312
|
+
* - criteria: Generated/reused criteria definitions and classification
|
|
2313
|
+
*/
|
|
2314
|
+
async peopleScoring(query, candidateProfiles, options) {
|
|
2315
|
+
const request = {
|
|
2316
|
+
messages: [{ role: "user", content: query }],
|
|
2317
|
+
specializedAgent: "people_scoring",
|
|
2318
|
+
specializedAgentParams: {
|
|
2319
|
+
candidateProfiles
|
|
2320
|
+
}
|
|
2321
|
+
};
|
|
2322
|
+
if (options) {
|
|
2323
|
+
if (options.reuseCriteriaFrom)
|
|
2324
|
+
request.specializedAgentParams.reuseCriteriaFrom = options.reuseCriteriaFrom;
|
|
2325
|
+
if (options.criteriaDefinitions)
|
|
2326
|
+
request.specializedAgentParams.criteriaDefinitions = options.criteriaDefinitions;
|
|
2327
|
+
if (options.criteriaClassification)
|
|
2328
|
+
request.specializedAgentParams.criteriaClassification = options.criteriaClassification;
|
|
2329
|
+
if (options.runSingleCriterion)
|
|
2330
|
+
request.specializedAgentParams.runSingleCriterion = options.runSingleCriterion;
|
|
2331
|
+
if (options.addCriterion)
|
|
2332
|
+
request.specializedAgentParams.addCriterion = options.addCriterion;
|
|
2333
|
+
if (options.addAndRunCriterion)
|
|
2334
|
+
request.specializedAgentParams.addAndRunCriterion = options.addAndRunCriterion;
|
|
2335
|
+
}
|
|
2336
|
+
return this.create(request);
|
|
2337
|
+
}
|
|
2101
2338
|
}
|
|
2102
2339
|
|
|
2103
2340
|
class SkillsResource {
|