Possible dependency on undefined variable at Coding and Financial Analysis, on section " User-Defined Functions"

On Lesson 5, Coding and Financial Analysis, on section " User-Defined Functions", specifically part with text “Let’s update the agents with the new system message” the code_writer_agent uses system_message parameter a variable named “code_writer_agent_system_message”,

code_writer_agent = ConversableAgent(
    name="code_writer_agent",
    system_message=code_writer_agent_system_message,
    llm_config=llm_config,
    code_execution_config=False,
    human_input_mode="NEVER",
)

but code_writer_agent_system_message variable, previously, is a reference to the “code_writer_agent” agent that is not defined on that moment:

code_writer_agent_system_message = code_writer_agent.system_message.

If is defined this line before code_writer_agent definition, I will not have defined code_writer_agent agent. I am having errors on both scenarios.

So, I am having errors related if is not declared code_writer_agent_system_message first as an emtpy string. I hope comment be useful, or sorry if I am not understanding correctly the code.

Hi @cigotete
Please take a look at L5 notebook and you will see that it runs with no error.
Keep learning!

Carlosr,
In L5 Ai Agentic design financials. The following function will not place the ytd. png file in Coding sub directory. Please advise. Along with course notebook, I’ve tried it with Jupyter notebook and it will appear, but not able to display png. Working in Win 10.
Thanks, Tony

import os
from IPython.display import Image

Image(os.path.join(“coding”, “ytd_stock_gains.png”))