Skip to content

Commit 01de757

Browse files
authored
fix: Actor tool input schema, docs search normalized query (#168)
* revert Actor tool input filtering (keep all fields), docs search normalized query to lower case * docstring
1 parent 980738f commit 01de757

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/tools/actor.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,6 @@ export async function getNormalActorsAsTools(
123123
if (actorDefinitionPruned) {
124124
const schemaID = getToolSchemaID(actorDefinitionPruned.actorFullName);
125125
if (actorDefinitionPruned.input && 'properties' in actorDefinitionPruned.input && actorDefinitionPruned.input) {
126-
// Filter non-required properties except integers if `required` is defined in the input schema and not empty.
127-
const { required } = actorDefinitionPruned.input;
128-
if (Array.isArray(required) && required.length > 0) {
129-
actorDefinitionPruned.input.properties = Object.fromEntries(
130-
Object.entries(actorDefinitionPruned.input.properties)
131-
// Keep all integer properties, as these include
132-
// properties related to output item counts that users
133-
// might want to change if they need more results than the default limit.
134-
.filter(([key, value]) => required.includes(key) || value.type === 'integer'),
135-
);
136-
}
137-
138126
actorDefinitionPruned.input.properties = markInputPropertiesAsRequired(actorDefinitionPruned.input);
139127
actorDefinitionPruned.input.properties = buildNestedProperties(actorDefinitionPruned.input.properties);
140128
actorDefinitionPruned.input.properties = filterSchemaProperties(actorDefinitionPruned.input.properties);

src/utils/apify-docs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,13 @@ export async function searchApifyDocs(query: string): Promise<ApifyDocsSearchRes
7979
* If the query has been previously searched, it returns cached results.
8080
* Otherwise, it performs a new search and caches the results for future use.
8181
*
82+
* Note: The query is normalized to lowercase for case-insensitive caching.
83+
*
8284
* @param {string} query - The search query string.
8385
* @returns {Promise<ApifyDocsSearchResult[]>} Array of search results with URL, optional fragment, and content.
8486
*/
8587
export async function searchApifyDocsCached(query: string): Promise<ApifyDocsSearchResult[]> {
86-
const normalizedQuery = query.trim();
88+
const normalizedQuery = query.trim().toLowerCase();
8789
const cachedResults = searchApifyDocsCache.get(normalizedQuery);
8890
if (cachedResults) {
8991
return cachedResults;

0 commit comments

Comments
 (0)