-
Notifications
You must be signed in to change notification settings - Fork 286
patch() next attempt #538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
patch() next attempt #538
Changes from all commits
983490c
84a0996
5d301e4
cab72c0
edf0f48
e0e1f49
e0e1471
5ededfd
27226c4
8ed9b39
bb02970
d4082b6
e883a97
e057d9a
e04b0d3
2b3d4e7
cb2e643
2219089
3cafef1
b5443f2
a52ac40
52aaad8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import React, { useMemo } from "react"; | ||
import React, { useCallback, useMemo } from "react"; | ||
import { | ||
PATCH_LIKE_FUNCTIONS, | ||
useAppDispatch, | ||
|
@@ -88,6 +88,10 @@ export const ToolConfirmation: React.FC<ToolConfirmationProps> = ({ | |
confirmToolUsage(); | ||
}; | ||
|
||
const handleReject = useCallback(() => { | ||
rejectToolUsage(toolCallIds); | ||
}, [rejectToolUsage, toolCallIds]); | ||
|
||
const message = getConfirmationMessage( | ||
commands, | ||
rules, | ||
|
@@ -101,7 +105,7 @@ export const ToolConfirmation: React.FC<ToolConfirmationProps> = ({ | |
return ( | ||
<PatchConfirmation | ||
handleAllowForThisChat={handleAllowForThisChat} | ||
rejectToolUsage={rejectToolUsage} | ||
rejectToolUsage={handleReject} | ||
confirmToolUsage={confirmToolUsage} | ||
/> | ||
); | ||
|
@@ -167,9 +171,9 @@ export const ToolConfirmation: React.FC<ToolConfirmationProps> = ({ | |
color="red" | ||
variant="surface" | ||
size="1" | ||
onClick={rejectToolUsage} | ||
onClick={handleReject} | ||
> | ||
Deny | ||
Stop | ||
</Button> | ||
)} | ||
</Flex> | ||
|
@@ -258,7 +262,7 @@ const PatchConfirmation: React.FC<PatchConfirmationProps> = ({ | |
size="1" | ||
onClick={rejectToolUsage} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we trying to prompt model to stop responding, or should we stop the stream if user clicks this button? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stop => "The user rejected the changes.", don't add this, should go for /v1/chat/completions with tools_confirmation==false |
||
> | ||
Deny | ||
Stop | ||
</Button> | ||
</Flex> | ||
</Flex> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one doesn't work, model still tries to recreate file, it doesn't stop responding
