autogen icon indicating copy to clipboard operation
autogen copied to clipboard

[Feature Request]: Support More core language and make extension DOCKER

Open asandez1 opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

Is your feature request related to a problem? Please describe. The test_commandline_code_executor was modified and merged to support multiples languages #2464 We need to change the docker implementation to support languages like in Local. https://github.com/microsoft/autogen/blob/main/autogen/coding/docker_commandline_code_executor.py#L179

Describe the solution you'd like

I will modify the docker_commandline_code_executor to support languages like local executor changes.

can I make a PR, support changing:

autogen/coding/docker_commandline_code_executor.py

Error encountered using Docker executor.

>>>>>>>> EXECUTING 2 CODE BLOCKS (inferred languages are [html, sh])...
Traceback (most recent call last):
  File "/home/jobfox/LLM/AutogenConda/codeexecutor/code3docker.py", line 66, in <module>
    chat_result = code_executor_agent_using_docker.initiate_chat(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jobfox/anaconda3/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 990, in initiate_chat
    self.send(msg2send, recipient, silent=silent)
  File "/home/jobfox/anaconda3/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 631, in send
    recipient.receive(message, self, request_reply, silent)
  File "/home/jobfox/anaconda3/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 793, in receive
    self.send(reply, sender, silent=silent)
  File "/home/jobfox/anaconda3/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 631, in send
    recipient.receive(message, self, request_reply, silent)
  File "/home/jobfox/anaconda3/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 791, in receive
    reply = self.generate_reply(messages=self.chat_messages[sender], sender=sender)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jobfox/anaconda3/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 1912, in generate_reply
    final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jobfox/anaconda3/lib/python3.11/site-packages/autogen/agentchat/conversable_agent.py", line 1410, in _generate_code_execution_reply_using_executor
    code_result = self._code_executor.execute_code_blocks(code_blocks)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jobfox/anaconda3/lib/python3.11/site-packages/autogen/coding/docker_commandline_code_executor.py", line 185, in execute_code_blocks
    command = ["timeout", str(self._timeout), _cmd(lang), filename]
                                              ^^^^^^^^^^
  File "/home/jobfox/anaconda3/lib/python3.11/site-packages/autogen/code_utils.py", line 255, in _cmd
    raise NotImplementedError(f"{lang} not recognized in code execution")
NotImplementedError: html not recognized in code execution
^CException ignored in atexit callback: <function DockerCommandLineCodeExecutor.__init__.<locals>.cleanup at 0x78d528c60040>
Traceback (most recent call last):
  File "/home/jobfox/anaconda3/lib/python3.11/site-packages/autogen/coding/docker_commandline_code_executor.py", line 118, in cleanup
    container.stop()
  File "/home/jobfox/anaconda3/lib/python3.11/site-packages/docker/models/containers.py", line 449, in stop
    return self.client.api.stop(self.id, **kwargs)

Additional context

I already implement the changes in docker_commandline_code_executor.py and it works correctly

asandez1 avatar Apr 26 '24 01:04 asandez1

@ekzhu I need to change the docker executor

PR https://github.com/microsoft/autogen/tree/asandez1-docker-executor-save-files

asandez1 avatar Apr 26 '24 01:04 asandez1