Skip to content

Commit 3abab00

Browse files
committed
renaming, adding 2 api functions for word suggestions, return to word tab after all sentence submission
1 parent f658a19 commit 3abab00

14 files changed

+73
-49
lines changed

index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5-
<link rel="icon" href="/occam-logo.svg">
5+
<link rel="icon" href="/ossia-logo.svg">
66
<link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8-
<title>Occam</title>
8+
<title>Ossia</title>
99
</head>
1010
<body>
1111
<div id="app"></div>

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "occam",
2+
"name": "ossia",
33
"version": "0.0.0",
44
"private": true,
55
"type": "module",
File renamed without changes.
File renamed without changes.

src/assets/theme.scss

+25-25
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
$occam-white: #ffffff;
2-
$occam-white-soft: #f8f8f8;
3-
$occam-white-mute: #f2f2f2;
1+
$ossia-white: #ffffff;
2+
$ossia-white-soft: #f8f8f8;
3+
$ossia-white-mute: #f2f2f2;
44

5-
$occam-light-background-1: #ffffff;
6-
$occam-light-background-2: rgb(243, 239, 243);
5+
$ossia-light-background-1: #ffffff;
6+
$ossia-light-background-2: rgb(243, 239, 243);
77

8-
$occam-black: #181818;
9-
$occam-black-soft: #222222;
10-
$occam-black-mute: #282828;
8+
$ossia-black: #181818;
9+
$ossia-black-soft: #222222;
10+
$ossia-black-mute: #282828;
1111

12-
$occam-dark-background-1: rgba(12, 12, 12, 0.29);
13-
$occam-dark-background-2: rgba(21, 21, 21, 0.29);
12+
$ossia-dark-background-1: rgba(12, 12, 12, 0.29);
13+
$ossia-dark-background-2: rgba(21, 21, 21, 0.29);
1414

15-
$occam-indigo: #111b26;
15+
$ossia-indigo: #111b26;
1616

17-
$occam-divider-light-1: #c5c5c5;
18-
$occam-divider-light-2: #a6a6a6;
19-
$occam-divider-dark-1: rgba(84, 84, 84, 0.65);
20-
$occam-divider-dark-2: rgba(84, 84, 84, 0.48);
17+
$ossia-divider-light-1: #c5c5c5;
18+
$ossia-divider-light-2: #a6a6a6;
19+
$ossia-divider-dark-1: rgba(84, 84, 84, 0.65);
20+
$ossia-divider-dark-2: rgba(84, 84, 84, 0.48);
2121

22-
$occam-text-light-1: $occam-indigo;
23-
$occam-text-light-2: rgba(60, 60, 60, 0.66);
24-
$occam-text-dark-1: $occam-white;
25-
$occam-text-dark-2: rgba(235, 235, 235, 0.64);
22+
$ossia-text-light-1: $ossia-indigo;
23+
$ossia-text-light-2: rgba(60, 60, 60, 0.66);
24+
$ossia-text-dark-1: $ossia-white;
25+
$ossia-text-dark-2: rgba(235, 235, 235, 0.64);
2626

2727
////// To share with vuetify components
2828
$primary: #00b600;
@@ -43,17 +43,17 @@ $text-color-inverted-muted: #464646;
4343
//}
4444

4545
@mixin light-mode {
46-
background-color: $occam-white;
46+
background-color: $ossia-white;
4747
* {
48-
color: $occam-text-light-1;
49-
border-color: $occam-divider-light-1;
48+
color: $ossia-text-light-1;
49+
border-color: $ossia-divider-light-1;
5050
}
5151
}
5252

5353
@mixin dark-mode {
54-
background-color: $occam-black;
54+
background-color: $ossia-black;
5555
* {
56-
color: $occam-text-dark-1;
57-
border-color: $occam-divider-dark-2;
56+
color: $ossia-text-dark-1;
57+
border-color: $ossia-divider-dark-2;
5858
}
5959
}

src/components/InterpreterView/MessageBuilder/tabs/BuildSentence.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function addWord(){
119119
}
120120
121121
.extra-words-input {
122-
background-color: theme.$occam-light-background-1;
122+
background-color: theme.$ossia-light-background-1;
123123
124124
&:deep(.v-field) {
125125
border: 2px solid #00a6ff;

src/components/InterpreterView/MessageBuilder/tabs/NewSentence.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function wordClicked(word) {
120120
}
121121
122122
.extra-words-input {
123-
background-color: theme.$occam-light-background-1;
123+
background-color: theme.$ossia-light-background-1;
124124
125125
&:deep(.v-field) {
126126
border: 2px solid #ecc502;

src/components/InterpreterView/MessageOptions.vue

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const messageStore = useMessageStore()
77
function submitMessage(sentence, hint) {
88
if (sentence && hint) {
99
messageStore.editSingleResponseWithHint(sentence, hint)
10+
messageStore.generateWordsForSingleResponseFromHint(sentence, hint)
1011
messageStore.editInstruction = null
1112
}
1213
else if (sentence) {
@@ -18,12 +19,15 @@ function submitMessage(sentence, hint) {
1819
messageStore.generateWordSuggestionsFromHint(hint)
1920
messageStore.generateSentenceSuggestionsFromHint(hint)
2021
}
22+
messageStore.messageTab = 'build'
2123
}
2224
2325
function editAllMessages() {
2426
let hint = messageStore.editInstruction
2527
messageStore.editAllResponsesWithHint(hint)
28+
messageStore.generateWordsForAllResponsesFromHint(hint)
2629
messageStore.editInstruction = null
30+
messageStore.messageTab = 'build'
2731
}
2832
2933
</script>
@@ -36,7 +40,8 @@ function editAllMessages() {
3640
hide-details
3741
id="message-input"
3842
v-model="messageStore.scriberPhrase"
39-
@keydown.enter="submitMessage(messageStore.scriberPhrase)"
43+
@keydown.enter="submitMessage(messageStore.scriberPhrase); messageStore.scriberPhrase = ''
44+
"
4045
density="comfortable"
4146
style="max-width: 100%"
4247
>

src/main.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import * as directives from 'vuetify/directives'
1515

1616
const app = createApp(App)
1717

18-
const OccamLightTheme = {
18+
const OssiaLightTheme = {
1919
dark: false,
2020
colors: {
2121
'primary': '#00b600',
@@ -27,9 +27,9 @@ const OccamLightTheme = {
2727

2828
const vuetify = createVuetify({
2929
theme: {
30-
defaultTheme: 'OccamLightTheme',
30+
defaultTheme: 'OssiaLightTheme',
3131
themes: {
32-
OccamLightTheme: OccamLightTheme,
32+
OssiaLightTheme: OssiaLightTheme,
3333
},
3434
},
3535
icons: {

src/router/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ const router = createRouter({
88
routes: [
99
{
1010
path: '/',
11-
name: 'Occam - Interpreter',
11+
name: 'Ossia - Interpreter',
1212
component: InterpreterView
1313
},
1414
{
1515
path: '/about',
16-
name: 'Occam - About',
16+
name: 'Ossia - About',
1717
component: AboutView
1818
}
1919
]

src/stores/MessageStore.js

+23-4
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ export const useMessageStore = defineStore('messages', () => {
6363

6464
// New Sentence
6565
async function generateWordSuggestionsFromNewTopic(topic) {
66-
const command = `Generate a short list of key words and connector words the
67-
assistant can select from to build a new sentence, based around a new topic: '${topic}'`
66+
const command = `Ignore all previous conversation. Generate a short list of key words and connector words
67+
the assistant can select from to build a new sentence, based around a new topic: '${topic}'`
6868
wordSuggestions.value = await client.getResponse(messageHistory.value, command, currentContext.value,
6969
true, false)
7070
}
7171

7272
async function generateSentenceSuggestionsFromNewTopic(topic) {
73-
const command = `Generate a list of 3 to 5 short generic sentences the
73+
const command = `Ignore all previous conversation. Generate a list of 3 to 5 short generic sentences the
7474
assistant may want to say, based around a new topic: '${topic}'`
7575
sentenceSuggestions.value = await client.getResponse(messageHistory.value, command, currentContext.value,
7676
false, true)
@@ -82,7 +82,7 @@ export const useMessageStore = defineStore('messages', () => {
8282

8383
// Edit Sentence
8484
async function editSingleResponseWithHint(response, hint) {
85-
const command = `The response '${response}' was close, but change it slightly using the following hint':
85+
const command = `The response '${response}' was close. Suggest similar sentences based on the following hint':
8686
\n'${hint}'`
8787
const messages = messageHistory.value.concat(activeEditHistory.value)
8888
sentenceSuggestions.value = await client.getResponse(messages, command, currentContext.value,
@@ -93,6 +93,14 @@ export const useMessageStore = defineStore('messages', () => {
9393
])
9494
}
9595

96+
async function generateWordsForSingleResponseFromHint(response, hint) {
97+
const command = `The response '${response}' was close. Generate a short list of key words and connector
98+
words or very short phrases the assistant can select from to build a similar sentence, based on the hint: '${hint}'`
99+
const messages = messageHistory.value.concat(activeEditHistory.value)
100+
wordSuggestions.value = await client.getResponse(messages, command, currentContext.value,
101+
true, false)
102+
}
103+
96104
async function editAllResponsesWithHint(hint) {
97105
const command = `Try again, using the following hint:\n'${hint}'`
98106
const messages = messageHistory.value.concat(activeEditHistory.value)
@@ -104,6 +112,15 @@ export const useMessageStore = defineStore('messages', () => {
104112
])
105113
}
106114

115+
async function generateWordsForAllResponsesFromHint(hint) {
116+
const command = `None of those suggestions were very useful. This time, instead of full sentences, generate
117+
a short list of key words and connector words or very short phrases, that the assistant can select from to build
118+
alternative sentences. Here is a hint to help guide you: '${hint}'`
119+
const messages = messageHistory.value.concat(activeEditHistory.value)
120+
wordSuggestions.value = await client.getResponse(messages, command, currentContext.value,
121+
true, false)
122+
}
123+
107124
// Generate Response
108125
async function generateNewResponses() {
109126
const command = `Try again, providing 3 to 5 alternative suggestions`
@@ -153,7 +170,9 @@ export const useMessageStore = defineStore('messages', () => {
153170
generateWordSuggestionsFromNewTopic,
154171
generateSentenceSuggestionsFromNewTopic,
155172
editSingleResponseWithHint,
173+
generateWordsForSingleResponseFromHint,
156174
editAllResponsesWithHint,
175+
generateWordsForAllResponsesFromHint,
157176
generateNewResponses,
158177
generateWordSuggestionsFromHint,
159178
generateSentenceSuggestionsFromHint,

src/views/AboutView.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="about">
3-
<img src="@/assets/occam-logo.svg" alt="Occam Logo">
4-
<h1>Occam</h1>
3+
<img src="@/assets/ossia-logo.svg" alt="Ossia Logo">
4+
<h1>Ossia</h1>
55
</div>
66
</template>
77

src/views/InterpreterView.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const loadingStore = useLoadingStore()
7878
}
7979
8080
#interlocutor-panel {
81-
background: theme.$occam-light-background-2;
81+
background: theme.$ossia-light-background-2;
8282
padding: 10px;
8383
height: 100%;
8484
max-height: 100%;
@@ -89,13 +89,13 @@ const loadingStore = useLoadingStore()
8989
}
9090
9191
#message-history {
92-
background: theme.$occam-light-background-1;;
92+
background: theme.$ossia-light-background-1;;
9393
height: 100%;
9494
flex-grow: 1;
9595
}
9696
9797
#message-builder {
98-
background-color: theme.$occam-light-background-1;
98+
background-color: theme.$ossia-light-background-1;
9999
height: 100%;
100100
width: 50%;
101101
overflow: auto;
@@ -105,7 +105,7 @@ const loadingStore = useLoadingStore()
105105
#separator {
106106
flex-grow: 0;
107107
width: 2px;
108-
background-color: theme.$occam-divider-light-1;
108+
background-color: theme.$ossia-divider-light-1;
109109
height: 70%;
110110
align-self: center;
111111
}
@@ -117,7 +117,7 @@ const loadingStore = useLoadingStore()
117117
display: flex;
118118
overflow: auto;
119119
justify-items: stretch;
120-
background-color: theme.$occam-light-background-1;
120+
background-color: theme.$ossia-light-background-1;
121121
}
122122
123123
@media (max-width: 600px) {

0 commit comments

Comments
 (0)