async langgraph_agent_toolkit.service.routes.info(request)[source][source]
Parameters:

request (Request)

Return type:

ServiceMetadata

async langgraph_agent_toolkit.service.routes.invoke(user_input, agent_id=None, request=None)[source][source]

Invoke an agent with user input to retrieve a final response.

If agent_id is not provided, the default agent will be used. Use thread_id to persist and continue a multi-turn conversation. run_id kwarg is also attached to messages for recording feedback.

Parameters:
Return type:

ChatMessage

async langgraph_agent_toolkit.service.routes.stream(user_input, agent_id=None, request=None)[source][source]

Stream an agent’s response to a user input, including intermediate messages and tokens.

If agent_id is not provided, the default agent will be used. Use thread_id to persist and continue a multi-turn conversation. run_id kwarg is also attached to all messages for recording feedback.

Set stream_tokens=false to return intermediate messages but not token-by-token.

Parameters:
Return type:

StreamingResponse

async langgraph_agent_toolkit.service.routes.feedback(feedback, agent_id=None, request=None)[source][source]

Record feedback for a run to the configured observability platform.

This routes the feedback to the appropriate platform based on the agent’s configuration.

Parameters:
Return type:

FeedbackResponse

async langgraph_agent_toolkit.service.routes.history(input=Depends(), agent_id=None, request=None)[source][source]

Get chat history.

Parameters:
Return type:

ChatHistory

async langgraph_agent_toolkit.service.routes.clear_history(input, agent_id=None, request=None)[source][source]

Clear chat history.

Parameters:
Return type:

ClearHistoryResponse

async langgraph_agent_toolkit.service.routes.add_messages(input, agent_id=None, request=None)[source][source]

Add messages to the end of chat history.

Parameters:
Return type:

AddMessagesResponse

async langgraph_agent_toolkit.service.routes.redirect_to_docs()[source][source]
Return type:

RedirectResponse

async langgraph_agent_toolkit.service.routes.health_check()[source][source]

Health check endpoint.

Return type:

HealthCheck