Skip to content

Commit baeeeaf

Browse files
authored
Merge pull request #113 from UiPath/fix/required-state-schema
fix: specify state_schema for every StateGraph
2 parents ad0a44c + 69ab9cc commit baeeeaf

File tree

16 files changed

+1130
-93
lines changed

16 files changed

+1130
-93
lines changed

samples/RAG-quiz-generator/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ dependencies = [
99
"langchain-anthropic>=0.3.8",
1010
"langchain-experimental>=0.3.4",
1111
"tavily-python>=0.5.0",
12-
"uipath-langchain==0.0.105",
12+
"uipath-langchain==0.0.113",
1313
]
1414
requires-python = ">=3.10"

samples/RAG-quiz-generator/src/agents/quiz-generator-RAG-agent.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def return_quiz(state: GraphState) -> GraphOutput:
167167
return GraphOutput(quiz=state["quiz"])
168168

169169
# Build the state graph
170-
builder = StateGraph(input=GraphInput, output=GraphOutput)
170+
builder = StateGraph(GraphState, input=GraphInput, output=GraphOutput)
171171
builder.add_node("invoke_researcher", invoke_researcher)
172172
builder.add_node("create_quiz", create_quiz)
173173
builder.add_node("return_quiz", return_quiz)
@@ -178,7 +178,6 @@ def return_quiz(state: GraphState) -> GraphOutput:
178178
builder.add_conditional_edges("create_quiz", check_quiz_creation)
179179
builder.add_edge("invoke_researcher", "create_quiz")
180180
builder.add_edge("return_quiz", END)
181-
import os
182181

183182
# Compile the graph
184183
graph = builder.compile()

samples/RAG-quiz-generator/src/agents/researcher-RAG-agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async def add_data_to_context_grounding_index(state: GraphState) -> MessagesStat
9090

9191

9292
# Build the state graph
93-
builder = StateGraph(input=GraphInput, output=MessagesState)
93+
builder = StateGraph(GraphState ,input=GraphInput, output=MessagesState)
9494
builder.add_node("research", research_node)
9595
builder.add_node("add_data_to_context_grounding_index", add_data_to_context_grounding_index)
9696
builder.add_node("prepare_input", prepare_input)

samples/RAG-quiz-generator/uv.lock

Lines changed: 476 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/company-research-agent/graph.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
research_agent = create_react_agent(llm, tools=[tavily_tool], prompt=system_prompt)
3636

3737

38-
class GraphInput(BaseModel):
38+
class GraphState(BaseModel):
3939
company_name: str
4040

4141

4242
class GraphOutput(BaseModel):
4343
response: str
4444

4545

46-
async def research_node(state: GraphInput) -> GraphOutput:
46+
async def research_node(state: GraphState) -> GraphOutput:
4747
# Format the user message with the company name
4848
user_message = f"""Please provide a comprehensive analysis and outreach strategy for the company: {state.company_name}. Use the TavilySearchResults tool to gather information. Include detailed research on the company's background, organizational structure, key decision-makers, and a tailored outreach strategy. Format your response using the following section headers:
4949
@@ -64,7 +64,7 @@ async def research_node(state: GraphInput) -> GraphOutput:
6464

6565

6666
# Build the state graph
67-
builder = StateGraph(input=GraphInput, output=GraphOutput)
67+
builder = StateGraph(GraphState, output=GraphOutput)
6868
builder.add_node("researcher", research_node)
6969

7070
builder.add_edge(START, "researcher")

samples/company-research-agent/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies = [
88
"langgraph>=0.2.55",
99
"langchain-anthropic>=0.3.8",
1010
"tavily-python>=0.5.0",
11-
"uipath-langchain==0.0.100"
11+
"uipath-langchain==0.0.113"
1212
]
1313

1414
[project.optional-dependencies]

samples/company-research-agent/uipath.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
"version": "2.0",
3535
"resources": []
3636
}
37-
}
37+
}

samples/company-research-agent/uv.lock

Lines changed: 636 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/multi-agent-planner-researcher-coder-distributed/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies = [
99
"langchain-anthropic>=0.3.8",
1010
"langchain-experimental>=0.3.4",
1111
"tavily-python>=0.5.0",
12-
"uipath-langchain==0.0.100"
12+
"uipath-langchain==0.0.113"
1313
]
1414

1515
[project.optional-dependencies]

samples/multi-agent-planner-researcher-coder-distributed/src/multi-agent-distributed/researcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async def research_node(state: MessagesState) -> GraphOutput:
2424

2525

2626
# Build the state graph
27-
builder = StateGraph(input=MessagesState, output=GraphOutput)
27+
builder = StateGraph(MessagesState, output=GraphOutput)
2828
builder.add_node("researcher", research_node)
2929

3030
builder.add_edge(START, "researcher")

0 commit comments

Comments
 (0)