Skip to content

Commit

Permalink
update tool and chat copy to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Parker-Stafford committed Oct 21, 2024
1 parent dcc85cb commit e946c00
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
28 changes: 17 additions & 11 deletions app/src/pages/playground/PlaygroundChatTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,13 @@ function SortableMessageItem({
/>
)
}
{message.content != null && (
<CopyToClipboardButton text={message.content} />
)}
<CopyToClipboardButton
text={
messageMode === "toolCalls"
? JSON.stringify(message.toolCalls)
: (message.content ?? "")
}
/>
<Button
aria-label="Delete message"
icon={<Icon svg={<Icons.TrashOutline />} />}
Expand Down Expand Up @@ -445,14 +449,16 @@ function SortableMessageItem({
</Flex>
}
>
<MessageEditor
message={message}
messageMode={messageMode}
playgroundInstanceId={playgroundInstanceId}
template={template}
templateLanguage={templateLanguage}
updateMessage={updateMessage}
/>
<div>
<MessageEditor
message={message}
messageMode={messageMode}
playgroundInstanceId={playgroundInstanceId}
template={template}
templateLanguage={templateLanguage}
updateMessage={updateMessage}
/>
</div>
</Card>
</li>
);
Expand Down
1 change: 0 additions & 1 deletion app/src/pages/playground/PlaygroundTool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export function PlaygroundTool({
}
>
<JSONEditor
height={"100%"}
value={toolDefinition}
onChange={onChange}
jsonSchema={openAIToolJSONSchema as JSONSchema7}
Expand Down

0 comments on commit e946c00

Please sign in to comment.