Context Management

Examples for instructions, system messages, introduction messages, and context shaping.

ExampleDescription
Custom Datetime FormatFormat the injected time with a matching timezone or offset.
Few Shot LearningUse additional_input with an Agent.
Filter Tool Calls From HistoryLimit historical tool calls sent to the model while preserving full stored runs.
InstructionsManage agent instructions and context.
Instructions With StateExample demonstrating how to use a function as instructions for an agent.
Introduction MessageUse the introduction parameter to set an initial greeting message.
System MessageCustomize the agent's system message and role.