Skip to content

CodeExecutorAgent Prompt Misuse #6558

@Dormiveglia-elf

Description

@Dormiveglia-elf

What happened?

Describe the bug
Related Lines
Currently, the instruction about code block format ("Python code should be provided in python code blocks, and sh shell scripts should be provided in sh code blocks for execution") is placed in DEFAULT_AGENT_DESCRIPTION, which is only used as the agent's description and not passed to the model_client.
However, this instruction is crucial for the model_client to generate properly formatted code blocks. Therefore, it should be moved to DEFAULT_SYSTEM_MESSAGE which is actually used as the system prompt for the model_client when generating code. This change will ensure that the model receives the correct instructions about code block formatting, leading to more reliable code generation.

Which packages was the bug in?

Python AgentChat (autogen-agentchat>=0.4.0)

AutoGen library version.

Python dev (main branch)

Other library version.

No response

Model used

gpt-4o-mini

Model provider

OpenAI

Other model provider

No response

Python version

3.12

.NET version

None

Operating system

Ubuntu

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions