Skip to main content
Version: 1.10.x

Code Agents

Bundles contain custom components that support specific third-party integrations with Langflow.

Langflow integrates with OpenDsStar through a bundle of code-writing agent components that can iteratively plan, write, and execute Python code to solve complex tasks.

info

Code Agents components are in beta and can change in future releases.

Prerequisites

  • OpenDsStar package: Code Agents components require the OpenDsStar package and Python 3.11 or later.

    Install the dependency with:


    _10
    uv pip install OpenDsStar

    For more information, see Install custom dependencies.

Use Code Agents components in a flow

For an example of using this component, see the Structured Data Agent starter template.

Code Agents components

The following sections describe the purpose and configuration options for each component in the Code Agents bundle.

CodeAct Agent (Smolagents)

The CodeAct Agent (Smolagents) component is a code-writing agent that uses the smolagents CodeAgent to solve tasks by iteratively generating and executing Python code.

At each step the agent writes code, executes it in a sandboxed interpreter, and uses the output to determine the next action until it reaches a final answer.

The component outputs a Message containing the final answer.

CodeAct Agent (Smolagents) parameters

NameTypeDescription
input_valueStringInput parameter. The message or query to send to the agent.
llmLanguageModelInput parameter. The language model to use for code generation. Required.
toolsToolInput parameter. Optional tools the agent can call in addition to executing code.
max_iterationsIntegerInput parameter. Maximum number of agent iterations. Default: 5. Range: 1–50.
system_promptStringInput parameter. A system message to customize agent behavior.
code_timeoutIntegerInput parameter. Maximum time in seconds for each code execution step. Default: 30. Range: 5–300.
show_code_stepsStringInput parameter. How to display coding steps in the Playground: All Steps, Final Code Only, or None. Default: All Steps.
handle_parsing_errorsBooleanInput parameter. Whether the agent should attempt to recover from input parsing errors. Default: true.
verboseBooleanInput parameter. Enable verbose logging. Default: true.
chat_historyDataInput parameter. Chat history for multi-turn conversations.
agent_descriptionStringInput parameter. Description of the agent shown when used in Tool Mode.

OpenDsStar Agent

The OpenDsStar Agent component is a structured data analysis agent that uses OpenDsStar and LangGraph to answer complex questions over structured data files.

The agent executes a multi-step LangGraph workflow: planning → code generation → code execution → verification → routing → finalization. Each step is streamed to the Playground as it runs. Charts and images returned by the agent are rendered inline.

The component outputs a Message containing the final answer.

OpenDsStar Agent parameters

NameTypeDescription
input_valueStringInput parameter. The message or query to send to the agent.
llmLanguageModelInput parameter. The language model to use for the agent. Required.
toolsToolInput parameter. Optional tools the agent can use, such as File Content Retriever or vector store search.
max_iterationsIntegerInput parameter. Maximum number of agent steps. Default: 10. Range: 1–100.
code_execution_modeStringInput parameter. Code execution mode. stepwise executes each step separately; full executes all steps together. Default: stepwise.
system_promptStringInput parameter. A system message to customize agent behavior.
handle_parsing_errorsBooleanInput parameter. Whether the agent should attempt to recover from input parsing errors. Default: true.
code_timeoutIntegerInput parameter. Maximum execution time in seconds for each code step. Default: 60. Range: 10–300.
verboseBooleanInput parameter. Enable verbose logging. Default: true.
chat_historyDataInput parameter. Chat history for multi-turn conversations.
agent_descriptionStringInput parameter. Description of the agent shown when used in Tool Mode.

See also

Search