-
Notifications
You must be signed in to change notification settings - Fork 749
Implemented __deepcopy__
on all Environment
s
#614
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
Conversation
|
||
|
||
@pytest.mark.asyncio | ||
async def test_deepcopy_env(agent_test_settings: Settings) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This unit test should be considered really baller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
|
||
def __deepcopy__(self, memo) -> Self: | ||
copy_state = deepcopy(self.state, memo) | ||
# We don't know the side effects of deep copying a litellm.Router, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smart
0a79341
to
6b17656
Compare
__deepcopy__
onPaperQAEnvironment
andGradablePaperQAEnvironment
, with a testmake_tools
, so I decomposedPaperQAEnvironment.make_initial_state_and_tools
for it. Note this is a breaking changeLitQAEvaluation.from_question
, as its inner workings were requiring too much thoughtmodel_config
not being at the top I missed in Moved Pydanticmodel_config
to top of each class #607