Skip to content

Commit

Permalink
add config
Browse files Browse the repository at this point in the history
  • Loading branch information
vbarda committed Jun 26, 2024
1 parent d550365 commit bdb57ec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pandas_rag_langgraph/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get_retriever() -> BaseRetriever:
# LLM / Retriever / Tools
llm = ChatAnthropic(model="claude-3-5-sonnet-20240620", temperature=0)
retriever = get_retriever()
tavily_search_tool = TavilySearchResults(max_results=1)
tavily_search_tool = TavilySearchResults(max_results=3)

# Prompts / data models

Expand Down Expand Up @@ -146,6 +146,10 @@ class GraphState(TypedDict):
web_fallback: bool


class GraphConfig(TypedDict):
max_retries: int


def document_search(state: GraphState):
"""
Retrieve documents
Expand Down Expand Up @@ -275,7 +279,7 @@ def finalize_response(state: GraphState):

# Define graph

workflow = StateGraph(GraphState)
workflow = StateGraph(GraphState, config_schema=GraphConfig)

# Define the nodes
workflow.add_node("document_search", document_search)
Expand Down

0 comments on commit bdb57ec

Please sign in to comment.