Skip to content

Commit

Permalink
feat:add code assistant type for the future
Browse files Browse the repository at this point in the history
  • Loading branch information
Onelevenvy committed Oct 7, 2024
1 parent 81e8876 commit ac2e5a7
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 364 deletions.
8 changes: 4 additions & 4 deletions backend/app/core/graph/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def should_continue(state: TeamState) -> str:
if messages and isinstance(messages[-1], AIMessage) and messages[-1].tool_calls:
# TODO: what if multiple tool_calls?
for tool_call in messages[-1].tool_calls:
if tool_call["name"] == "AskHuman":
if tool_call["name"] == "ask_human":
return "call_human"
else:
return "call_tools"
Expand Down Expand Up @@ -816,10 +816,10 @@ async def generator(
ToolMessage(
tool_call_id=tool_call["id"],
content=interrupt.tool_message,
name="AskHuman",
name="ask_human",
)
for tool_call in tool_calls
if tool_call["name"] == "AskHuman"
if tool_call["name"] == "ask_human"
]
}
async for event in root.astream_events(state, version="v2", config=config):
Expand All @@ -836,7 +836,7 @@ async def generator(
return
# Determine if should return default or askhuman interrupt based on whether AskHuman tool was called.
for tool_call in message.tool_calls:
if tool_call["name"] == "AskHuman":
if tool_call["name"] == "ask_human":
response = ChatResponse(
type="interrupt",
name="human",
Expand Down
2 changes: 1 addition & 1 deletion backend/app/core/graph/checkpoint/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def convert_checkpoint_tuple_to_messages(
if last_message.type == "ai" and last_message.tool_calls:
# Check if any tool in last message is asking for human input
for tool_call in last_message.tool_calls:
if tool_call["name"] == "AskHuman":
if tool_call["name"] == "ask_human":
formatted_messages.append(
ChatResponse(
type="interrupt",
Expand Down
2 changes: 1 addition & 1 deletion backend/app/core/workflow/init_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def should_continue(state: TeamState) -> str:
messages: list[AnyMessage] = state["messages"]
if messages and isinstance(messages[-1], AIMessage) and messages[-1].tool_calls:
for tool_call in messages[-1].tool_calls:
if tool_call["name"] == "AskHuman":
if tool_call["name"] == "ask_human":
return "call_human"
# 使用工具名称到节点ID的映射
tool_name = tool_call["name"].lower()
Expand Down
7 changes: 1 addition & 6 deletions web/src/app/(applayout)/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ function Dashboard() {
Hi, {currentUser?.full_name || currentUser?.email} 👋🏼
</Text>
<Text>Welcome back, nice to see you again!</Text>
<Image
src={'https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/outputs/f967b5c9-c3c8-4f4b-9f1f-708e2dfda39c_0.png'}
alt="aaa"
width={"auto"}
height={"auto"}
/>

</Box>
</Container>
</>
Expand Down
32 changes: 0 additions & 32 deletions web/src/app/flow/gen/page.tsx

This file was deleted.

22 changes: 0 additions & 22 deletions web/src/app/flow/show/ShowFlow.tsx

This file was deleted.

256 changes: 0 additions & 256 deletions web/src/app/flow/show/graphConfig.ts

This file was deleted.

8 changes: 0 additions & 8 deletions web/src/app/flow/show/page.tsx

This file was deleted.

Loading

0 comments on commit ac2e5a7

Please sign in to comment.