from langchain.agents import create_agent
from langchain_nimble import NimbleSearchTool, NimbleExtractTool
from langchain_openai import ChatOpenAI
# Initialize tools
search_tool = NimbleSearchTool()
extract_tool = NimbleExtractTool()
# Create agent with multiple tools
agent = create_agent(
model=ChatOpenAI(model="gpt-5"),
tools=[search_tool, extract_tool],
system_prompt=(
"You are a helpful research assistant with access to "
"real-time web information. You can search the web and "
"extract content from specific URLs."
)
)
# Use the agent
response = agent.invoke({
"messages": [(
"user",
"What are the latest developments in AI agents? "
"Summarize key findings."
)]
})
print(response["messages"][-1].content)