An example of in-context learning is when a language model translates a sentence and then summarizes a text within the same session, based on examples provided in the prompt. The model adapts to each task in real time without needing any retraining or parameter updates.