-
Notifications
You must be signed in to change notification settings - Fork 71
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
chore(weave): Add call chat to playground page #2993
Conversation
Preview this PR with FeatureBee: https://beta.wandb.ai/?betaVersion=446bad369b3b47c37e168624331676918e65414e |
…siah/add-call-chat
editMessage: (messageIndex: number, newMessage: any) => void; | ||
deleteChoice: (choiceIndex: number) => void; | ||
editChoice: (choiceIndex: number, newChoice: any) => void; | ||
addMessage: (newMessage: any) => void; |
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.
I feel like add -> edit -> delete is a more natural order to list these. Can these any
be made more restrictive?
editChoice: (choiceIndex, newChoice) => | ||
editChoice(idx, choiceIndex, newChoice), | ||
retry: (messageIndex: number, isChoice?: boolean) => | ||
console.log('retry', messageIndex, isChoice), |
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.
I'm assuming console.log are left in intentionally while under construction
}; | ||
|
||
export const useChatFunctions = ( | ||
setPlaygroundStateField: ( |
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.
I found this a little hard to read, maybe pull out the type of the setPlaygroundStateField as an explicit type definition above?
) => { | ||
setPlaygroundStateField(callIndex, 'traceCall', prevTraceCall => { | ||
const newTraceCall = clearTraceCall( | ||
JSON.parse(JSON.stringify(prevTraceCall)) |
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.
Could you use _.deepClone
? That would be more readable and is probably safer for various types of values
const output = newTraceCall?.output as TraceCallOutput; | ||
if (output && Array.isArray(output.choices)) { | ||
// Remove the choice | ||
output.choices = output.choices.filter( |
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.
Could this be e.g.
output.choices.splice(choiceIndex, 1)
Description
i know its ugly but this
more wiring up is needed, and a lot of usability is in the chat view styling revamp, eg auto scroll to last message when the message is added
Screen.Recording.2024-11-15.at.7.19.02.AM.mov