feat: Add input field summaries to Actor search results#737
feat: Add input field summaries to Actor search results#737
Conversation
5f31e83 to
a873a4a
Compare
Include input field names, types, and required status in search-actors results so LLMs can prepare Actor calls without a separate fetch-actor-details round-trip. - Fetch Actor build definitions in parallel (concurrency=10) after search - Check actorDefinitionPrunedCache + dedicated inputFieldsCache for hits - Display as TypeScript-like notation: name: type, name?: type - Add reusable runWithConcurrency utility to src/utils/generic.ts - Add constants rule to CLAUDE.md
a873a4a to
9c1de65
Compare
|
I'm afraid this PR adds a lot of complexity. It was supposed to be a simple addition to the existing logic. The branch adds: a new cache, a generic semaphore utility, a parallel fetch pipeline that duplicates defaultBuild()+schema, and a third argument. I can see three approaches:
My order of preference would be 3 -> 2 -> 1 but let me pull @Jkuzz for his opinion here. |
jirispilka
left a comment
There was a problem hiding this comment.
See my comment here: #737
|
Makes sense, it is large and inefficient change as I did not want to touch the API or MongoDB - let's touch the API then. I would be for the option 2 so we do the input fields lookup from MongoDB for the default build - no need to handle the Algolia. Right? @Jkuzz |
Summary
search-actorsresults so LLMs can prepare Actor calls without a separatefetch-actor-detailsround-tripinputFieldsCache+actorDefinitionPrunedCache)url: string, maxResults?: numbersectionCaptionheuristic — fields before the first section caption are the core inputs, everything after is advanced config. Reduces 20-35 fields down to 4-8 per actor.(4 of 35)so the LLM knows to usefetch-actor-detailsfor the full schemaText output example
Structured output example
Input field selection heuristic
Apify Actor input schemas use
sectionCaptionto group fields into UI sections. Fields before the firstsectionCaptionare the "main" inputs (search query, URL, limit). Fields after are advanced config (proxy, custom code, deprecated). We return only the first section. Fallback: cap at 10 fields if no sections exist.Testing