mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-05-19 16:31:36 +00:00
enhance: start chat after replay
This commit is contained in:
parent
28837b4c96
commit
da65d3a520
3 changed files with 9 additions and 1 deletions
|
|
@ -61,6 +61,9 @@ async def post(data: Chat, request: Request):
|
|||
if data.is_cloud():
|
||||
os.environ["cloud_api_key"] = data.api_key
|
||||
|
||||
# Put initial action in queue to start processing
|
||||
await task_lock.put_queue(ActionImproveData(data=data.question))
|
||||
|
||||
chat_logger.info(f"Chat session initialized, starting streaming response for project_id: {data.project_id}")
|
||||
return StreamingResponse(step_solve(data, request, task_lock), media_type="text/event-stream")
|
||||
|
||||
|
|
|
|||
|
|
@ -213,7 +213,9 @@ export default function ChatBox(): JSX.Element {
|
|||
);
|
||||
|
||||
// Only start a new task if: pending, no messages processed yet
|
||||
if (chatStore.tasks[_taskId as string].status === "pending" && !hasSimpleResponse && !hasComplexTask && !isFinished) {
|
||||
// OR while or after replaying a project
|
||||
if ((chatStore.tasks[_taskId as string].status === "pending" && !hasSimpleResponse && !hasComplexTask && !isFinished)
|
||||
|| chatStore.tasks[_taskId].type === "replay") {
|
||||
setMessage("");
|
||||
// Pass the message content to startTask instead of adding it to current chatStore
|
||||
const attachesToSend = JSON.parse(JSON.stringify(chatStore.tasks[_taskId]?.attaches)) || [];
|
||||
|
|
|
|||
|
|
@ -429,6 +429,9 @@ const chatStore = (initial?: Partial<ChatStore>) => createStore<ChatStore>()(
|
|||
|
||||
targetChatStore.getState().setIsPending(newTaskId, false);
|
||||
|
||||
targetChatStore.getState().setDelayTime(newTaskId, delayTime as number);
|
||||
targetChatStore.getState().setType(newTaskId, "replay");
|
||||
|
||||
//From handleSend if message is given
|
||||
// Add the message to the new chatStore if provided
|
||||
if (question) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue