Skip to content

Commit

Permalink
fix: move chat store into ui and use published libertai-js
Browse files Browse the repository at this point in the history
  • Loading branch information
amiller68 committed Apr 10, 2024
1 parent 2873215 commit 4ea9bae
Show file tree
Hide file tree
Showing 14 changed files with 19,805 additions and 209 deletions.
19,206 changes: 19,206 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"build": "quasar build"
},
"dependencies": {
"@libertai/libertai-js": "^0.0.0",
"@quasar/extras": "^1.16.4",
"@solana/web3.js": "^1.90.0",
"aleph-sdk-ts": "^3.9.2",
Expand All @@ -28,9 +29,10 @@
"dompurify": "^3.0.9",
"ethers": "^5",
"highlight.js": "^11.9.0",
"libertai-js": "https://github.com/Libertai/libertai-js",
"localforage": "^1.10.0",
"marked": "^12.0.0",
"marked-highlight": "^2.1.1",
"openai": "^4.33.0",
"pinia": "^2.0.11",
"quasar": "^2.6.0",
"stream": "^0.0.2",
Expand Down
5 changes: 1 addition & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@

<script>
import { defineComponent, onMounted } from "vue";
import { useModelsStore } from "stores/models-store";
import { useChatsStore } from "stores/chats-store";
import { useKnowledgeStore } from "./stores/knowledge-store";
export default defineComponent({
name: "App",
setup() {
console.log("App.vue::setup");
const modelsStore = useModelsStore();
const chatsStore = useChatsStore();
const knowledgeStore = useKnowledgeStore();
onMounted(() => {
// Set the knowledge store and chats store to load when the app is mounted
knowledgeStore.load();
chatsStore.loadAndUpdate(modelsStore.models);
chatsStore.load();
});
return {};
},
Expand Down
7 changes: 3 additions & 4 deletions src/layouts/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
Chats
</q-item-label>
<q-item
v-for="chat of partialChats.slice().reverse()"
v-for="chat of chats.slice().reverse()"
:key="chat.id"
:to="`/chat/${chat.id}`"
exact
Expand Down Expand Up @@ -193,7 +193,7 @@ export default defineComponent({
const route = useRoute();
// Reference to the chat-store state
const { partialChats } = storeToRefs(chatsStore);
const { chats } = storeToRefs(chatsStore);
const addressPoints = computed(() => {
if (account.active) {
Expand All @@ -213,7 +213,6 @@ export default defineComponent({
});
// Delete a chat
// NOTE: the underlying state of partialChatsRef is updated as a result of the watch above
async function deleteChat(chat_id) {
console.log("layouts::MainLayout::deleteChat: ", chat_id);
await chatsStore.deleteChat(chat_id);
Expand All @@ -223,7 +222,7 @@ export default defineComponent({
}
return {
partialChats,
chats,
modelsStore,
account,
points,
Expand Down
Loading

0 comments on commit 4ea9bae

Please sign in to comment.