Introduction Message
Use the introduction parameter to set an initial greeting message.
1"""2Introduction Message3=============================45Use the introduction parameter to set an initial greeting message.6"""78from kern.agent import Agent9from kern.models.openai import OpenAIResponses1011# ---------------------------------------------------------------------------12# Create Agent13# ---------------------------------------------------------------------------14agent = Agent(15 model=OpenAIResponses(id="gpt-5.2"),16 # The introduction is sent as the agent's first message in a conversation17 introduction="Hello! I'm your coding assistant. I can help you write, debug, and explain code. What would you like to work on?",18 markdown=True,19)2021# ---------------------------------------------------------------------------22# Run Agent23# ---------------------------------------------------------------------------24if __name__ == "__main__":25 # The introduction message is available as a property26 print("Introduction:", agent.introduction)27 print()28 agent.print_response(29 "Help me write a Python function to check if a string is a palindrome.",30 stream=True,31 )Run the Example
1# Clone and setup repo2git clone https://github.com/kern-ai/kern.git3cd kern/cookbook/02_agents/03_context_management45# Create and activate virtual environment6./scripts/demo_setup.sh7source .venvs/demo/bin/activate89python introduction_message.py