base
This commit is contained in:
30
frontend/src/lib/components/chatbotDemo/Chatbot.svelte
Normal file
30
frontend/src/lib/components/chatbotDemo/Chatbot.svelte
Normal file
@@ -0,0 +1,30 @@
|
||||
<script lang="ts">
|
||||
import { Chat } from "./chat"
|
||||
import InputRow from "./InputRow.svelte"
|
||||
import Messages from "./Messages.svelte"
|
||||
function generateUniqueId() {
|
||||
return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)
|
||||
}
|
||||
let chat = $derived(
|
||||
new Chat(generateUniqueId(), {
|
||||
url: "https://2schat-server.robins-spielwiese.de/api/v1/chatbot/stream",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
)
|
||||
</script>
|
||||
|
||||
<div class="chat-wrapper">
|
||||
<Messages {chat} />
|
||||
<InputRow {chat} />
|
||||
</div>
|
||||
|
||||
<style lang="less">
|
||||
.chat-wrapper {
|
||||
min-height: 400px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user