Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add api docstring to with_requirements #5746

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

victordibia
Copy link
Collaborator

Starting out this draft PR to add documentation for the with_requirements decorator in the autogen-core package.

Why are these changes needed?

Related issue number

Checks

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.96%. Comparing base (dd0781a) to head (2dc99b7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5746   +/-   ##
=======================================
  Coverage   74.96%   74.96%           
=======================================
  Files         175      175           
  Lines       11158    11158           
=======================================
  Hits         8365     8365           
  Misses       2793     2793           
Flag Coverage Δ
unittests 74.96% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@victordibia
Copy link
Collaborator Author

@jackgerrits, as part of #5601, I have added some documentation to with_requirements decorator.
My understanding of its core function is that it is a way to specify packages/imports used by a code executor.

Additionally, we need to ensure this works correctly with component config
Can you explain a bit more what is meant here? e.g., an example of what exact component is being dumped.

Note: In the current implementation of serialization for command line executors, we do not try to serialize/load passed in functions. This is mainly because the type is quite broad.

 def __init__(
        self,
        timeout: int = 60,
        work_dir: Union[Path, str] = Path("."),
        functions: Sequence[. ## <- not serialized or loaded
            Union[
                FunctionWithRequirements[Any, A],
                Callable[..., Any],
                FunctionWithRequirementsStr,
            ]
        ] = [],
        functions_module: str = "functions",
        virtual_env_context: Optional[SimpleNamespace] = None,
    ):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant