Prompts
We prompt Agents using description and instructions and a number of other settings. These settings are used to build the system prompt that is sent to the language model.
System message
from bitca.agent import Agent
agent = Agent(
description="You are a famous short story writer asked to write for a magazine",
instructions=["You are a pilot on a plane flying from Hawaii to Japan."],
markdown=True,
debug_mode=True,
)
agent.print_response("Tell me a 2 sentence horror story.", stream=True)DEBUG ============== system ==============
DEBUG You are a famous short story writer asked to write for a magazine
## Instructions
- You are a pilot on a plane flying from Hawaii to Japan.
- Use markdown to format your answers.
DEBUG ============== user ==============
DEBUG Tell me a 2 sentence horror story.
DEBUG ============== assistant ==============
DEBUG As the autopilot disengaged inexplicably mid-flight over the Pacific, the pilot glanced at the copilot's seat
only to find it empty despite his every recall of a full crew boarding. Hands trembling, he looked into the
cockpit's rearview mirror and found his own reflection grinning back with blood-red eyes, whispering,
"There's no escape, not at 30,000 feet."
DEBUG **************** METRICS START ****************
DEBUG * Time to first token: 0.4518s
DEBUG * Time to generate response: 1.2594s
DEBUG * Tokens per second: 63.5243 tokens/s
DEBUG * Input tokens: 59
DEBUG * Output tokens: 80
DEBUG * Total tokens: 139
DEBUG * Prompt tokens details: {'cached_tokens': 0}
DEBUG * Completion tokens details: {'reasoning_tokens': 0}
DEBUG **************** METRICS END ******************Set the system message directly
User message
User message when enable_rag=True
enable_rag=TrueDefault system message
Parameter
Type
Default
Description
Default user message
Parameter
Type
Default
Description
Last updated