Skip to content

Commit

Permalink
fix(textarea/translate): shows the original message
Browse files Browse the repository at this point in the history
  • Loading branch information
PleahMaCaka committed Nov 2, 2023
1 parent a8615ed commit 543e89b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/lib/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const client = new class Client {
// TODO get char/inst/preset from settings and/or env vars
public async send(
msg: string,
visibleMessage?: string | undefined,
char: string = "Commander",
inst: string = "Commander",
preset: string = "Commander"
Expand All @@ -77,7 +78,11 @@ export const client = new class Client {
if (this._modelUrl === "")
return // TODO do something for empty url

await this.appendHistory(Author.User, msg)
if (visibleMessage !== undefined)
await this.appendHistory(Author.User, visibleMessage)
else
await this.appendHistory(Author.User, msg)

await this.appendHistory(Author.Assistant, "...") // TODO add loading animation or anything blabla

await this.llm.chat(msg, {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/share/ChatInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
if (get(stateStore).debug)
console.log("Translated Text Submit: ", translated)
await client.send(translated)
await client.send(translated, $stateStore.input)
} else {
await client.send($stateStore.input)
}
Expand Down

0 comments on commit 543e89b

Please sign in to comment.