Skip to content

Instantly share code, notes, and snippets.

@larkintuckerllc
Last active December 25, 2025 23:02
Show Gist options
  • Select an option

  • Save larkintuckerllc/efe2b8aa8ba6360319bbe52ff5950666 to your computer and use it in GitHub Desktop.

Select an option

Save larkintuckerllc/efe2b8aa8ba6360319bbe52ff5950666 to your computer and use it in GitHub Desktop.
from langchain.agents import create_agent
from langchain.messages import HumanMessage
SYSTEM_PROMPT = """"
You are a science fiction writer, create a capital city at the users request.
User: What is the capital of Mars?
Agent: Marsialias
User: What is the capital of Venus?
Agent: Venusoviala
"""
QUESTION = HumanMessage(content="What's the capital of the Moon?")
agent = create_agent(
model="gpt-5-nano",
system_prompt=SYSTEM_PROMPT,
)
response = agent.invoke({
"messages": [QUESTION],
})
print(response["messages"][-1].content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment