Skip to content

Commit 6fb4e4b

Browse files
committed
refactor: Improve documentation and simplify dataset default properties assignment
1 parent 4741ef4 commit 6fb4e4b

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/tools/structured_output_schemas.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,8 @@ export function buildEnrichedDirectActorOutputSchema(itemProperties: Record<stri
402402
properties: itemProperties,
403403
};
404404
const clone = structuredClone(getActorRunOutputSchema);
405-
(clone.properties.storages.properties.datasets.properties.default.properties as Record<string, unknown>).itemsSchema = itemsSchema;
405+
const datasetDefaultProps = clone.properties.storages.properties.datasets.properties.default.properties as Record<string, unknown>;
406+
datasetDefaultProps.itemsSchema = itemsSchema;
406407
return clone;
407408
}
408409

src/utils/schema_generation.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ export type SchemaGenerationOptions = {
2121
clean?: boolean;
2222
};
2323

24-
// Local counterpart to the dataset API's `clean=true` — empty arrays carry no schema info.
25-
// Strips only empty arrays; keeps null / '' / empty objects so schema inference still sees those fields.
26-
// Stricter sibling: `cleanEmptyProperties` in `src/tools/common/get_actor_output.ts` also strips nullish and empty strings.
24+
/**
25+
* Local counterpart to the dataset API's `clean=true` — empty arrays carry no schema info.
26+
* Strips only empty arrays; keeps null / '' / empty objects so schema inference still sees those fields.
27+
* Stricter sibling: `cleanEmptyProperties` in `src/tools/common/get_actor_output.ts` also strips nullish and empty strings.
28+
*/
2729
export function cleanEmptyArrays(obj: unknown): unknown {
2830
if (Array.isArray(obj)) {
2931
return obj.map(cleanEmptyArrays);

0 commit comments

Comments
 (0)