Proposal to Add a Sample .py File Demonstrating CodeAct vs. JSON Tool Invocation Comparison #8

Open
opened 2026-02-16 07:16:29 -05:00 by yindo · 1 comment
Owner

Originally created by @RyuseiTakahashi on GitHub (Apr 8, 2025).

Dear LangGraph CodeAct Maintainers,

Contributing Intent

I would like to contribute to this OSS repository and hold the maintainers and community in high regard.
I have a lot of respect for the maintainers and the community.
I welcome feedback and design advice from the maintainers and community regarding this proposal.

Background and Current Situation

I hope you are doing well. I would like to propose the addition of a new sample Python file under the /langgraph-codeact/examples directory.

Currently, there is a comparison made between CodeAct (which corresponds to CodeAgent on Hugging Face) and the JSON-based tool invocation method. At present, the examples only demonstrate the execution of CodeAct on its own. I believe that providing examples that contrast the execution of CodeAct with that of invoking tools via a JSON format would help users clearly understand the differences between the two approaches, leading to skill improvement.

Note: I have personally experimented with both methods and have been able to grasp the differences and execution variations between them.

Benefits of the Improvement

By comparing the CodeAct approach with the JSON-based agent, the distinctions between the two methods will be clarified. This comparison will enable users to better understand the available options and choose the most appropriate method for their needs.

Outline of the Proposed Nodes

  1. CodeAct:
  • Demonstrating the current method.
  1. JSON Format:
  • Illustrating the traditional method where tools and their parameters are output in JSON format for integration.

Below are the mermaid diagrams that compare the graphs for both approaches.

Graph for CodeAct:

flowchart TD
    start([__start__]) --> call_model[call_model]
    call_model -.-> end_node([__end__])
    call_model -.-> sandbox[sandbox]
    sandbox --> call_model

    classDef startEndClass fill:#c9a3ff,stroke:#9c6ddb,stroke-width:1px
    classDef nodeClass fill:#d0d0ff,stroke:#8585e0,stroke-width:1px

    class start,end_node startEndClass
    class call_model,sandbox nodeClass

Graph for JSON Format:

flowchart TD
    start([__start__]) --> agent[agent]
    agent -.-> tools[tools]
    agent -.-> end_node([__end__])
    tools --> agent

    classDef startEndClass fill:#c9a3ff,stroke:#9c6ddb,stroke-width:1px
    classDef nodeClass fill:#d0d0ff,stroke:#8585e0,stroke-width:1px

    class start,end_node startEndClass
    class agent,tools nodeClass

I believe that adding this sample file will greatly benefit users by providing clear insights into the differences between the two approaches. Thank you very much for considering my proposal, and please let me know if you require any further information or clarification.

Sincerely,
Ryusei Takahashi

Originally created by @RyuseiTakahashi on GitHub (Apr 8, 2025). Dear LangGraph CodeAct Maintainers, # Contributing Intent I would like to contribute to this OSS repository and hold the maintainers and community in high regard. I have a lot of respect for the maintainers and the community. I welcome feedback and design advice from the maintainers and community regarding this proposal. # Background and Current Situation I hope you are doing well. I would like to propose the addition of a new sample Python file under the /langgraph-codeact/examples directory. Currently, there is a comparison made between CodeAct (which corresponds to CodeAgent on Hugging Face) and the JSON-based tool invocation method. At present, the examples only demonstrate the execution of CodeAct on its own. I believe that providing examples that contrast the execution of CodeAct with that of invoking tools via a JSON format would help users clearly understand the differences between the two approaches, leading to skill improvement. Note: I have personally experimented with both methods and have been able to grasp the differences and execution variations between them. # Benefits of the Improvement By comparing the CodeAct approach with the JSON-based agent, the distinctions between the two methods will be clarified. This comparison will enable users to better understand the available options and choose the most appropriate method for their needs. # Outline of the Proposed Nodes 1. CodeAct: - Demonstrating the current method. 2. JSON Format: - Illustrating the traditional method where tools and their parameters are output in JSON format for integration. Below are the mermaid diagrams that compare the graphs for both approaches. Graph for CodeAct: ```mermaid flowchart TD start([__start__]) --> call_model[call_model] call_model -.-> end_node([__end__]) call_model -.-> sandbox[sandbox] sandbox --> call_model classDef startEndClass fill:#c9a3ff,stroke:#9c6ddb,stroke-width:1px classDef nodeClass fill:#d0d0ff,stroke:#8585e0,stroke-width:1px class start,end_node startEndClass class call_model,sandbox nodeClass ``` Graph for JSON Format: ```mermaid flowchart TD start([__start__]) --> agent[agent] agent -.-> tools[tools] agent -.-> end_node([__end__]) tools --> agent classDef startEndClass fill:#c9a3ff,stroke:#9c6ddb,stroke-width:1px classDef nodeClass fill:#d0d0ff,stroke:#8585e0,stroke-width:1px class start,end_node startEndClass class agent,tools nodeClass ``` I believe that adding this sample file will greatly benefit users by providing clear insights into the differences between the two approaches. Thank you very much for considering my proposal, and please let me know if you require any further information or clarification. Sincerely, Ryusei Takahashi
Author
Owner

@RyuseiTakahashi commented on GitHub (Apr 8, 2025):

If there are no objections, I would be happy to address this issue myself.
Would that be alright with you?

@RyuseiTakahashi commented on GitHub (Apr 8, 2025): If there are no objections, I would be happy to address this issue myself. Would that be alright with you?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph-codeact#8