@@ -39,7 +39,7 @@ import {
39
39
TemplateEditor ,
40
40
TemplateEditorWrap ,
41
41
} from "@phoenix/components/templateEditor" ;
42
- import { TemplateLanguage } from "@phoenix/components/templateEditor/types" ;
42
+ import { TemplateFormat } from "@phoenix/components/templateEditor/types" ;
43
43
import { usePlaygroundContext } from "@phoenix/contexts/PlaygroundContext" ;
44
44
import { useChatMessageStyles } from "@phoenix/hooks/useChatMessageStyles" ;
45
45
import { ChatMessage , PlaygroundState } from "@phoenix/store" ;
@@ -85,9 +85,7 @@ interface PlaygroundChatTemplateProps extends PlaygroundInstanceProps {}
85
85
export function PlaygroundChatTemplate ( props : PlaygroundChatTemplateProps ) {
86
86
const id = props . playgroundInstanceId ;
87
87
88
- const templateLanguage = usePlaygroundContext (
89
- ( state ) => state . templateLanguage
90
- ) ;
88
+ const templateFormat = usePlaygroundContext ( ( state ) => state . templateFormat ) ;
91
89
const updateInstance = usePlaygroundContext ( ( state ) => state . updateInstance ) ;
92
90
const instanceSelector = useMemo ( ( ) => selectPlaygroundInstance ( id ) , [ id ] ) ;
93
91
const playgroundInstance = usePlaygroundContext ( instanceSelector ) ;
@@ -156,7 +154,7 @@ export function PlaygroundChatTemplate(props: PlaygroundChatTemplateProps) {
156
154
return (
157
155
< SortableMessageItem
158
156
playgroundInstanceId = { id }
159
- templateLanguage = { templateLanguage }
157
+ templateFormat = { templateFormat }
160
158
key = { messageId }
161
159
messageId = { messageId }
162
160
/>
@@ -191,13 +189,13 @@ export function PlaygroundChatTemplate(props: PlaygroundChatTemplateProps) {
191
189
function MessageEditor ( {
192
190
message,
193
191
updateMessage,
194
- templateLanguage ,
192
+ templateFormat ,
195
193
playgroundInstanceId,
196
194
messageMode,
197
195
} : {
198
196
playgroundInstanceId : number ;
199
197
message : ChatMessage ;
200
- templateLanguage : TemplateLanguage ;
198
+ templateFormat : TemplateFormat ;
201
199
updateMessage : ( patch : Partial < ChatMessage > ) => void ;
202
200
messageMode : MessageMode ;
203
201
} ) {
@@ -277,7 +275,7 @@ function MessageEditor({
277
275
height = "100%"
278
276
defaultValue = { message . content || "" }
279
277
aria-label = "Message content"
280
- templateLanguage = { templateLanguage }
278
+ templateFormat = { templateFormat }
281
279
onChange = { onChange }
282
280
placeholder = {
283
281
message . role === "system"
@@ -293,12 +291,12 @@ function MessageEditor({
293
291
294
292
function SortableMessageItem ( {
295
293
playgroundInstanceId,
296
- templateLanguage ,
294
+ templateFormat ,
297
295
messageId,
298
296
} : PropsWithChildren < {
299
297
playgroundInstanceId : number ;
300
298
messageId : number ;
301
- templateLanguage : TemplateLanguage ;
299
+ templateFormat : TemplateFormat ;
302
300
} > ) {
303
301
const updateMessage = usePlaygroundContext ( ( state ) => state . updateMessage ) ;
304
302
const deleteMessage = usePlaygroundContext ( ( state ) => state . deleteMessage ) ;
@@ -482,7 +480,7 @@ function SortableMessageItem({
482
480
message = { message }
483
481
messageMode = { aiMessageMode }
484
482
playgroundInstanceId = { playgroundInstanceId }
485
- templateLanguage = { templateLanguage }
483
+ templateFormat = { templateFormat }
486
484
updateMessage = { onMessageUpdate }
487
485
/>
488
486
</ div >
0 commit comments