Skip to content

create_react_agent without tools #2147

Answered by vbarda
FahriBilici asked this question in Q&A
Discussion options

You must be logged in to vote

@FahriBilici you would need to do something like

from langgraph.graph import StateGraph, START
from langgraph.graph.message import MessagesState

def call_model(state: MessagesState):
    # add any logic to customize model system message etc here
    response = model.invoke(state["messages"])
    return {"messages": [response]}
    
builder = StateGraph(MessagesState)
builder.add_node(call_model)
builder.add_edge(START, "call_model")

graph = builder.compile()

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@FahriBilici
Comment options

@vbarda
Comment options

@FahriBilici
Comment options

@vbarda
Comment options

Answer selected by FahriBilici
@FahriBilici
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants