-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ShiranAbir/feature/reading-answers
Feature: reading answers
- Loading branch information
Showing
19 changed files
with
397 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { createStore } from "vuex" | ||
import { getAnswer, getSpeechUrl } from '@/services/chatService.ts' | ||
|
||
const store = createStore({ | ||
state: { | ||
messages: [], | ||
lastId: 1 | ||
}, | ||
mutations: { | ||
addMessage(state, { message }) { | ||
state.messages.push(message) | ||
}, | ||
advanceId(state) { | ||
state.lastId++ | ||
}, | ||
}, | ||
getters: { | ||
messages({ messages }) { | ||
if (!messages) return | ||
return messages | ||
}, | ||
lastId({ lastId }) { | ||
return lastId | ||
}, | ||
}, | ||
actions: { | ||
async loadAnswer({ commit, getters }, param) { | ||
var message = {id: getters.lastId, type: 'question', txt:param.question}; | ||
commit({ type: 'addMessage', message }) | ||
commit({ type: 'advanceId', message }) | ||
|
||
const answer = await getAnswer(param.question); | ||
message = {id: getters.lastId, type: 'answer', txt:answer} | ||
commit({ type: 'addMessage', message }) | ||
commit({ type: 'advanceId', message }) | ||
return message | ||
}, | ||
async getSpeechUrl({commit}, param) { | ||
return await getSpeechUrl(param.text) | ||
} | ||
}, | ||
}) | ||
|
||
export default store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,63 @@ | ||
{ | ||
"name": "chaty", | ||
"version": "1.0.0", | ||
"private": true, | ||
"description": "Chaty is an Electron bot that you can use to interact with ChatGPT", | ||
"author": "Shiran Abir", | ||
"repository": "ShiranAbir/chaty", | ||
"main": "main.js", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "run-p type-check build-only", | ||
"preview": "vite preview", | ||
"build-only": "vite build", | ||
"type-check": "vue-tsc --noEmit", | ||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", | ||
"start": "run-p build && electron-forge start", | ||
"package": "run-p build && electron-forge package", | ||
"make": "electron-forge make" | ||
}, | ||
"dependencies": { | ||
"app-env": "^1.0.1", | ||
"axios": "^1.2.1", | ||
"bootstrap": "^5.2.3", | ||
"bootstrap-vue-3": "^0.4.15", | ||
"chatgpt": "^2.5.2", | ||
"clone-deep": "^4.0.1", | ||
"compression": "^1.7.4", | ||
"cors": "^2.8.5", | ||
"electron-squirrel-startup": "^1.0.0", | ||
"express": "^4.18.2", | ||
"pump": "^3.0.0", | ||
"puppeteer": "^19.4.0", | ||
"puppeteer-extra-plugin-stealth": "^2.11.1", | ||
"sass": "^1.56.2", | ||
"scss": "^0.2.4", | ||
"vue": "^3.2.45", | ||
"vue-router": "^4.1.6", | ||
"vuex": "^4.1.0" | ||
}, | ||
"devDependencies": { | ||
"@electron-forge/cli": "^6.0.4", | ||
"@electron-forge/maker-deb": "^6.0.4", | ||
"@electron-forge/maker-dmg": "^6.0.4", | ||
"@electron-forge/maker-rpm": "^6.0.4", | ||
"@electron-forge/maker-squirrel": "^6.0.4", | ||
"@electron-forge/maker-zip": "^6.0.4", | ||
"@electron/rebuild": "^3.2.10", | ||
"@rushstack/eslint-patch": "^1.1.4", | ||
"@types/node": "^18.11.9", | ||
"@types/puppeteer": "^7.0.4", | ||
"@vitejs/plugin-vue": "^4.0.0", | ||
"@vue/eslint-config-typescript": "^11.0.0", | ||
"@vue/tsconfig": "^0.1.3", | ||
"electron": "^23.0.0-alpha.3", | ||
"eslint": "^8.22.0", | ||
"eslint-plugin-vue": "^9.3.0", | ||
"npm-run-all": "^4.1.5", | ||
"typescript": "~4.7.4", | ||
"vite": "^4.0.0", | ||
"vue-tsc": "^1.0.9" | ||
} | ||
} | ||
{ | ||
"name": "chaty", | ||
"version": "1.1.0", | ||
"private": true, | ||
"description": "Chaty is an Electron bot that you can use to interact with ChatGPT", | ||
"author": "Shiran Abir", | ||
"repository": "ShiranAbir/chaty", | ||
"main": "main.ts", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "run-p type-check build-only", | ||
"preview": "vite preview", | ||
"build-only": "vite build", | ||
"type-check": "vue-tsc --noEmit", | ||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", | ||
"start": "run-p build && electron-forge start", | ||
"package": "run-p build && electron-forge package", | ||
"make": "electron-forge make" | ||
}, | ||
"dependencies": { | ||
"app-env": "^1.0.1", | ||
"axios": "^1.2.1", | ||
"bootstrap": "^5.2.3", | ||
"bootstrap-vue-3": "^0.4.15", | ||
"chatgpt": "^2.5.2", | ||
"clone-deep": "^4.0.1", | ||
"compression": "^1.7.4", | ||
"cors": "^2.8.5", | ||
"electron-squirrel-startup": "^1.0.0", | ||
"express": "^4.18.2", | ||
"google-tts-api": "^2.0.2", | ||
"pump": "^3.0.0", | ||
"puppeteer": "^19.4.0", | ||
"puppeteer-extra-plugin-stealth": "^2.11.1", | ||
"sass": "^1.56.2", | ||
"scss": "^0.2.4", | ||
"vue": "^3.2.45", | ||
"vue-router": "^4.1.6", | ||
"vuex": "^4.1.0" | ||
}, | ||
"devDependencies": { | ||
"@electron-forge/cli": "^6.0.4", | ||
"@electron-forge/maker-deb": "^6.0.4", | ||
"@electron-forge/maker-dmg": "^6.0.4", | ||
"@electron-forge/maker-rpm": "^6.0.4", | ||
"@electron-forge/maker-squirrel": "^6.0.4", | ||
"@electron-forge/maker-zip": "^6.0.4", | ||
"@electron/rebuild": "^3.2.10", | ||
"@rushstack/eslint-patch": "^1.1.4", | ||
"@types/node": "^18.11.16", | ||
"@types/puppeteer": "^7.0.4", | ||
"@vitejs/plugin-vue": "^4.0.0", | ||
"@vue/eslint-config-typescript": "^11.0.0", | ||
"@vue/tsconfig": "^0.1.3", | ||
"electron": "^23.0.0-alpha.3", | ||
"eslint": "^8.22.0", | ||
"eslint-plugin-vue": "^9.3.0", | ||
"npm-run-all": "^4.1.5", | ||
"typescript": "~4.7.4", | ||
"vite": "^4.0.0", | ||
"vue-tsc": "^1.0.9" | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<script setup lang="ts"> | ||
import mainView from '@/views/mainView.vue' | ||
</script> | ||
|
||
<template> | ||
<mainView/> | ||
</template> | ||
|
||
|
||
<script setup lang="ts"> | ||
import mainView from '@/views/mainView.vue' | ||
</script> | ||
|
||
<template> | ||
<mainView/> | ||
</template> | ||
|
||
|
Oops, something went wrong.