File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 13
13
from sse_starlette import EventSourceResponse
14
14
15
15
from app .auth .handlers import AuthedUser
16
- from app .storage import get_thread
16
+ from app .storage import get_assistant , get_thread
17
17
from app .lifespan import get_langserve
18
18
19
19
router = APIRouter ()
@@ -50,6 +50,9 @@ async def stream_run(
50
50
thread = await get_thread (user ["user_id" ], payload .thread_id )
51
51
if not thread :
52
52
raise HTTPException (status_code = 404 , detail = "Thread not found" )
53
+ assistant = await get_assistant (user ["user_id" ], thread ["assistant_id" ])
54
+ if not assistant :
55
+ raise HTTPException (status_code = 404 , detail = "Assistant not found" )
53
56
54
57
return EventSourceResponse (
55
58
(
@@ -60,6 +63,11 @@ async def stream_run(
60
63
input = payload .input ,
61
64
config = payload .config ,
62
65
stream_mode = "messages" ,
66
+ interrupt_before = ["action" ]
67
+ if assistant ["config" ]["configurable" ].get (
68
+ "type==agent/interrupt_before_action"
69
+ )
70
+ else None ,
63
71
)
64
72
)
65
73
)
You can’t perform that action at this time.
0 commit comments