Error using PruningContentFilter in Playground: "Nested function calls are not permitted" #1958
|
Hi everyone, I'm encountering an issue while trying to use the following configuration in the Playground: CrawlerRunConfig( When running this setup, I consistently receive the following error: { From the error message, it seems like the problem might be related to how the configuration is being interpreted or executed internally—possibly due to nested calls within the markdown_generator or content_filter. Has anyone experienced a similar issue or knows if this configuration is currently unsupported in the Playground environment? Any guidance or workaround would be greatly appreciated. Thanks in advance! |
Replies: 1 comment
|
Hi! You’re reading the error correctly, this is expected behavior in the Playground right now. For security hardening, we explicitly disabled nested function calls in Playground config parsing, so expressions like:
are blocked and return:
In
This restriction was introduced in security commit:
So yes, this pattern is currently unsupported in Playground by design (security reasons), not a bug in your specific config. The config should work normally. |
Hi! You’re reading the error correctly, this is expected behavior in the Playground right now.
For security hardening, we explicitly disabled nested function calls in Playground config parsing, so expressions like:
CrawlerRunConfig(markdown_generator=DefaultMarkdownGenerator(content_filter=PruningContentFilter(...)))are blocked and return:
Nested function calls are not permitted.In
deploy/docker/server.py,_safe_eval_config()walks the AST and rejects any nestedast.Call:if isinstance(node, ast.Call) and node is not call:raise ValueError("Nested function calls are not permitted")This restriction was introduced in security commit:
2fc39cb— fix(security): remove eval() from compute…