1from typing import Iterator # noqa
2
3from kern.agent import Agent, RunOutputEvent # noqa
4from kern.models.azure import AzureAIFoundry
5
6agent = Agent(
7 model=AzureAIFoundry(
8 id="Phi-4",
9 azure_endpoint="",
10 ),
11 markdown=True,
12)
13
14# Get the response in a variable
15# run_response: Iterator[RunOutputEvent] = agent.run("Share a 2 sentence horror story", stream=True)
16# for chunk in run_response:
17# print(chunk.content)
18
19# Print the response on the terminal
20agent.print_response("Share a 2 sentence horror story", stream=True)