mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-31 19:15:17 +02:00
Autorun chat in playground to show greeting
This commit is contained in:
parent
d15eddc951
commit
3ea08895b8
4 changed files with 47 additions and 41 deletions
|
|
@ -25,6 +25,7 @@ export function App({
|
|||
}) {
|
||||
const [counter, setCounter] = useState<number>(0);
|
||||
const [testProfile, setTestProfile] = useState<z.infer<typeof TestProfile> | null>(null);
|
||||
const [systemMessage, setSystemMessage] = useState<string>(defaultSystemMessage);
|
||||
const [chat, setChat] = useState<z.infer<typeof PlaygroundChat>>({
|
||||
projectId,
|
||||
createdAt: new Date().toISOString(),
|
||||
|
|
@ -33,6 +34,11 @@ export function App({
|
|||
systemMessage: defaultSystemMessage,
|
||||
});
|
||||
|
||||
function handleSystemMessageChange(message: string) {
|
||||
setSystemMessage(message);
|
||||
setCounter(counter + 1);
|
||||
}
|
||||
|
||||
function handleTestProfileChange(profile: WithStringId<z.infer<typeof TestProfile>> | null) {
|
||||
setTestProfile(profile);
|
||||
setCounter(counter + 1);
|
||||
|
|
@ -105,6 +111,8 @@ export function App({
|
|||
testProfile={testProfile}
|
||||
messageSubscriber={messageSubscriber}
|
||||
onTestProfileChange={handleTestProfileChange}
|
||||
systemMessage={systemMessage}
|
||||
onSystemMessageChange={handleSystemMessageChange}
|
||||
/>
|
||||
</div>
|
||||
</Pane>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue