styling
This commit is contained in:
parent
57f5bffac6
commit
565113ff41
@ -1,48 +1,52 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="input_containter">
|
<div class="input_containter">
|
||||||
<input class="input_text" type="text" v-model="input_text" @keyup.enter="image_generation($event)" />
|
<input
|
||||||
<img class="responded_image" :src="responded_image"/>
|
class="input_text"
|
||||||
</div>
|
type="text"
|
||||||
</template>
|
v-model="input_text"
|
||||||
<script>
|
@keyup.enter="image_generation($event)"
|
||||||
import { LabApi } from '@/utils/index'
|
/>
|
||||||
export default {
|
<img class="responded_image" :src="responded_image" />
|
||||||
name: 'ImageGeneration',
|
</div>
|
||||||
components: {},
|
</template>
|
||||||
computed: {},
|
<script>
|
||||||
mounted() { },
|
import { LabApi } from '@/utils/index'
|
||||||
methods: {
|
export default {
|
||||||
image_generation($event) {
|
name: 'ImageGeneration',
|
||||||
LabApi.image_generation(this.input_text)
|
components: {},
|
||||||
.then((response) => {
|
computed: {},
|
||||||
this.responded_image = response.data
|
mounted() {},
|
||||||
})
|
methods: {
|
||||||
.catch((error) => {
|
image_generation($event) {
|
||||||
this.mnx_backendErrorHandler(error)
|
LabApi.image_generation(this.input_text)
|
||||||
})
|
.then((response) => {
|
||||||
}
|
this.responded_image = response.data
|
||||||
},
|
})
|
||||||
data() {
|
.catch((error) => {
|
||||||
return {
|
this.mnx_backendErrorHandler(error)
|
||||||
input_text: null,
|
})
|
||||||
responded_image: null
|
}
|
||||||
}
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
input_text: null,
|
||||||
|
responded_image: null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
}
|
||||||
|
</script>
|
||||||
<style scoped lang="scss">
|
|
||||||
.input_containter {
|
<style scoped lang="scss">
|
||||||
@extend .container;
|
.input_containter {
|
||||||
@extend .m-3;
|
@extend .container;
|
||||||
}
|
@extend .m-3;
|
||||||
|
}
|
||||||
.input_text {
|
|
||||||
@extend .w-100;
|
.input_text {
|
||||||
}
|
@extend .w-100;
|
||||||
|
}
|
||||||
.responded_image {
|
|
||||||
@extend .w-100;
|
.responded_image {
|
||||||
}
|
@extend .w-100;
|
||||||
</style>
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@ -10,19 +10,19 @@ export default {
|
|||||||
name: 'MultiturnChat',
|
name: 'MultiturnChat',
|
||||||
components: {},
|
components: {},
|
||||||
computed: {},
|
computed: {},
|
||||||
mounted() { },
|
mounted() {},
|
||||||
methods: {
|
methods: {
|
||||||
lets_chat($event) {
|
lets_chat($event) {
|
||||||
this.messages.push({
|
this.messages.push({
|
||||||
"role": "user",
|
role: 'user',
|
||||||
"content": this.input_text
|
content: this.input_text
|
||||||
})
|
})
|
||||||
LabApi.multiturn_chat(this.messages)
|
LabApi.multiturn_chat(this.messages)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.responded_text = response.data
|
this.responded_text = response.data
|
||||||
this.messages.push({
|
this.messages.push({
|
||||||
"role": "assistant",
|
role: 'assistant',
|
||||||
"content": this.responded_text
|
content: this.responded_text
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@ -33,15 +33,13 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
input_text: null,
|
input_text: null,
|
||||||
messages: [
|
messages: [{ role: 'system', content: 'You are a helpful assistant.' }],
|
||||||
{ "role": "system", "content": "You are a helpful assistant." }
|
|
||||||
],
|
|
||||||
responded_text: null
|
responded_text: null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.input_containter {
|
.input_containter {
|
||||||
@extend .container;
|
@extend .container;
|
||||||
@ -56,4 +54,3 @@ export default {
|
|||||||
@extend .w-100;
|
@extend .w-100;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@ -1,6 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="input_containter">
|
<div class="input_containter">
|
||||||
<input class="input_text" type="text" v-model="input_text" @keyup.enter="task_completion($event)" />
|
<input
|
||||||
|
class="input_text"
|
||||||
|
type="text"
|
||||||
|
v-model="input_text"
|
||||||
|
@keyup.enter="task_completion($event)"
|
||||||
|
/>
|
||||||
<p class="responded_text">{{ responded_text }}</p>
|
<p class="responded_text">{{ responded_text }}</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -10,7 +15,7 @@ export default {
|
|||||||
name: 'TaskCompletion',
|
name: 'TaskCompletion',
|
||||||
components: {},
|
components: {},
|
||||||
computed: {},
|
computed: {},
|
||||||
mounted() { },
|
mounted() {},
|
||||||
methods: {
|
methods: {
|
||||||
task_completion($event) {
|
task_completion($event) {
|
||||||
LabApi.task_completion(this.input_text)
|
LabApi.task_completion(this.input_text)
|
||||||
@ -30,7 +35,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.input_containter {
|
.input_containter {
|
||||||
@extend .container;
|
@extend .container;
|
||||||
@ -45,4 +50,3 @@ export default {
|
|||||||
@extend .w-100;
|
@extend .w-100;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
conversations() {
|
conversations() {
|
||||||
return this.$store.getters['basic/conversations']
|
return this.$store.getters['basic/conversations']
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
conversations(n_val) {
|
conversations(n_val) {
|
||||||
|
|||||||
@ -66,13 +66,17 @@ const basicStore = {
|
|||||||
if (data.event !== 'connected') {
|
if (data.event !== 'connected') {
|
||||||
updateLength = conversations.length - state.conversations.length
|
updateLength = conversations.length - state.conversations.length
|
||||||
if (updateLength === 0) updateLength = 1
|
if (updateLength === 0) updateLength = 1
|
||||||
for (let i = 0; i<updateLength; i++) {
|
for (let i = 0; i < updateLength; i++) {
|
||||||
conversations[i].unread = true
|
conversations[i].unread = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const conversation = conversations[0]
|
const conversation = conversations[0]
|
||||||
if (conversation?.id) {
|
if (conversation?.id) {
|
||||||
MessageHubApi.fetchMessages(conversation.id, conversation.message_update_time ? conversation.message_update_time : GWT, token).then((response) => {
|
MessageHubApi.fetchMessages(
|
||||||
|
conversation.id,
|
||||||
|
conversation.message_update_time ? conversation.message_update_time : GWT,
|
||||||
|
token
|
||||||
|
).then((response) => {
|
||||||
conversations[0].messages = response?.data || []
|
conversations[0].messages = response?.data || []
|
||||||
conversations[0].message_update_time = new Date().toISOString()
|
conversations[0].message_update_time = new Date().toISOString()
|
||||||
state.conversations = conversations
|
state.conversations = conversations
|
||||||
@ -92,7 +96,7 @@ const basicStore = {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
readMessageBy(state, conversation_id) {
|
readMessageBy(state, conversation_id) {
|
||||||
for (let i = 0; i < state.conversations.length; i ++) {
|
for (let i = 0; i < state.conversations.length; i++) {
|
||||||
if (conversation_id === state.conversations[i].id) {
|
if (conversation_id === state.conversations[i].id) {
|
||||||
const nsc = Object.assign([], state.conversations)
|
const nsc = Object.assign([], state.conversations)
|
||||||
nsc[i].unread = false
|
nsc[i].unread = false
|
||||||
|
|||||||
@ -53,7 +53,6 @@ class LabApi {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
return request
|
return request
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export { LabApi }
|
export { LabApi }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user