Skip to content

Commit

Permalink
feat(F-M-G): features/clear button
Browse files Browse the repository at this point in the history
  • Loading branch information
PleahMaCaka committed Nov 2, 2023
1 parent 746cbf0 commit 8c09f45
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions src/lib/components/debug/FakeMessageGenerator.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,49 @@
const sendAs = async () => {
await client.appendHistory(isBot ? Author.Assistant : Author.User, content)
}
const sendWeather = async () => {
await client.appendHistory(Author.Assistant, " ` weather` Yes sir!")
}
const clearChat = async () => {
await client.clearHistory()
}
</script>

{#if $stateStore.debug}
<div id="fmsg">
<div id="fmsg-is-this">
<div id="fake-msg-input">
<h3>Is this a bot?</h3>
<input type="checkbox" bind:value={isBot} />
</div>
<div id="fmsg-is-this">
<div id="fake-msg-input">
<input bind:value={content} />
<button on:click={sendAs}>Send</button>
</div>
<div id="fake-msg-input">
<input type="button" value="Weather" on:click={sendWeather} />
<input type="button" value="Clear History" on:click={clearChat} />
</div>
</div>
{/if}

<style>
#fmsg-is-this {
#fake-msg-input {
display: flex;
flex-direction: row;
justify-content: space-between;
}
#fake-msg-input input[type="button"] {
padding: 4px 8px;
margin: 4px 0;
}
#fake-msg-input input {
padding: 2px 2px;
}
#fmsg {
display: flex;
flex-direction: column;
Expand Down

0 comments on commit 8c09f45

Please sign in to comment.