MCPcopy Create free account
hub / github.com/serverless/examples / chatbot_node

Function chatbot_node

aws-bedrock-agentcore/python/langgraph-gateway/agent.py:45–51  ·  view source on GitHub ↗

Main chatbot node that invokes the LLM. The LLM can decide to use gateway tools or respond directly.

(state: State, llm_with_tools)

Source from the content-addressed store, hash-verified

43
44
45async def chatbot_node(state: State, llm_with_tools):
46 """
47 Main chatbot node that invokes the LLM.
48 The LLM can decide to use gateway tools or respond directly.
49 """
50 response = await llm_with_tools.ainvoke(state["messages"])
51 return {"messages": [response]}
52
53
54async def run_agent_with_gateway(user_message: str) -> str:

Callers 1

async_chatbotFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected