Skip to content

Commit eff4f1a

Browse files
committed
fix: reduce bedrock throttling in member enrichment llm activities
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
1 parent 33caf49 commit eff4f1a

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

services/apps/members_enrichment_worker/src/workflows/processMemberSources.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ const {
1010
normalizeEnrichmentData,
1111
fetchMemberDataForLLMSquashing,
1212
findWhichLinkedinProfileToUseAmongScraperResult,
13-
squashMultipleValueAttributesWithLLM,
14-
squashWorkExperiencesWithLLM,
1513
updateMemberUsingSquashedPayload,
1614
cleanAttributeValue,
1715
touchMemberEnrichmentLastTriedAt,
@@ -25,6 +23,18 @@ const {
2523
},
2624
})
2725

26+
const { squashMultipleValueAttributesWithLLM, squashWorkExperiencesWithLLM } = proxyActivities<
27+
typeof activities
28+
>({
29+
startToCloseTimeout: '10 minutes',
30+
retry: {
31+
initialInterval: '30s',
32+
backoffCoefficient: 2.0,
33+
maximumInterval: '5 minutes',
34+
maximumAttempts: 6,
35+
},
36+
})
37+
2838
export async function processMemberSources(args: IProcessMemberSourcesArgs): Promise<boolean> {
2939
// without contributions since they take a lot of space
3040
const toBeSquashed = {}

services/libs/types/src/llm.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ export const LLM_SETTINGS: Record<LlmQueryType, ILlmSettings> = {
7979
[LlmQueryType.MEMBER_ENRICHMENT_SQUASH_MULTIPLE_VALUE_ATTRIBUTES]: {
8080
modelId: LlmModelType.CLAUDE_SONNET_4,
8181
arguments: {
82-
max_tokens: 40000,
82+
max_tokens: 2000,
8383
anthropic_version: 'bedrock-2023-05-31',
8484
temperature: 0,
8585
},
8686
},
8787
[LlmQueryType.MEMBER_ENRICHMENT_SQUASH_WORK_EXPERIENCES_FROM_MULTIPLE_SOURCES]: {
8888
modelId: LlmModelType.CLAUDE_SONNET_4,
8989
arguments: {
90-
max_tokens: 40000,
90+
max_tokens: 8000,
9191
anthropic_version: 'bedrock-2023-05-31',
9292
temperature: 0,
9393
},

0 commit comments

Comments
 (0)