It works!

This commit is contained in:
Brandon Hancock
2025-02-12 17:28:35 -05:00
parent 7910dc9337
commit a38483e1b4
4 changed files with 131 additions and 107 deletions

22
byoa_tools.py Normal file
View File

@@ -0,0 +1,22 @@
# Initialize a ChatOpenAI model
llm = ChatOpenAI(model="gpt-4o", temperature=0)
from langgraph.prebuilt import create_react_agent
from langgraph.checkpoint.memory import MemorySaver
# Create the agent with LangGraph
memory = MemorySaver()
agent_executor = create_react_agent(
llm,
tools,
checkpointer=memory
)
# Pass the LangGraph agent to the adapter
wrapped_agent = LangChainAgentAdapter(
langchain_agent=agent_executor,
tools=tools,
role="San Francisco Travel Advisor",
goal="Curate a detailed list of the best neighborhoods to live in, restaurants to dine at, and attractions to visit in San Francisco.",
backstory="An expert travel advisor with insider knowledge of San Francisco's vibrant culture, culinary delights, and hidden gems.",
)