millions-byte-98943
10/31/2025, 7:05 PM\n charecter in the instructions?
I do an api call to get the instructions to for the livekit agent. The instructions are in markdown format. It has \n charecters for new lines. But when I use it in livekit agents and look at the openai platform logs, all new lines have disappeared. It is just one long line of instructions. In contrast, the chatbot I have with same instructions show proper newlines and markdown formatting in openai platform logs.lively-winter-88668
11/03/2025, 8:59 AM\n to the instructions would influence the LLM behaviour?millions-byte-98943
11/04/2025, 9:50 PM\n causing markdown format issueslively-winter-88668
11/05/2025, 10:41 AMasync def llm_node(self, chat_ctx, tools, model_settings):
# Log the input chat context
logger.info(f"LLM Input: {chat_ctx.to_dict()}")
# Insert custom preprocessing here
async for chunk in Agent.default.llm_node(self, chat_ctx, tools, model_settings):
# Insert custom postprocessing here
yield chunk
Based on https://docs.livekit.io/agents/build/nodes/#llm_node. With instructions as
instructions="""
You are a helpful agent.
When the user speaks, you listen and respond.
""",
I see output:
2025-11-05 10:36:37,236 - INFO listen-and-respond - LLM Input: {'items': [{'id': 'lk.agent_task.instructions', 'type': 'message', 'role': 'system', 'content': ['\n You are a helpful agent. \n When the user speaks, you listen and respond.\n '], 'interrupted': False}]}
So, it looks like the new lines are being passed in in this example?millions-byte-98943
11/07/2025, 5:15 AM