Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switches to multilingual Elevenlabs #181

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update sendMessage/editMessage to use new structure
- Text only for now
  • Loading branch information
jp-ipu committed Nov 11, 2023
commit 4bc428aa68b12c2f7cd0f0a521fe8410fee147ff
34 changes: 15 additions & 19 deletions app/src/core/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function useCreateAppContext(): Context {
const dispatch = useAppDispatch();

intl = useIntl();

const { pathname } = useLocation();
const isHome = pathname === '/';
const isShare = pathname.startsWith('/s/');
Expand Down Expand Up @@ -77,7 +77,7 @@ export function useCreateAppContext(): Context {

const onNewMessage = useCallback(async (message?: string) => {
resetAudioContext();

if (isShare) {
return false;
}
Expand Down Expand Up @@ -114,22 +114,12 @@ export function useCreateAppContext(): Context {
}
}

// if (chatManager.has(id)) {
// chatManager.sendMessage({
// chatID: id,
// content: message.trim(),
// requestedParameters: {
// ...parameters,
// apiKey: openaiApiKey,
// },
// parentID: currentChat.leaf?.id,
// });
// } else {
// await chatManager.createChat(id);

chatManager.sendMessage({
chatID: id,
content: message.trim(),
content: {
type: "text",
text: message.trim(),
},
requestedParameters: {
...parameters,
apiKey: openaiApiKey,
Expand Down Expand Up @@ -171,7 +161,7 @@ export function useCreateAppContext(): Context {

const editMessage = useCallback(async (message: Message, content: string) => {
resetAudioContext();

if (isShare) {
return false;
}
Expand All @@ -196,7 +186,10 @@ export function useCreateAppContext(): Context {
if (id && chatManager.has(id)) {
await chatManager.sendMessage({
chatID: id,
content: content.trim(),
content: {
type: "text",
text: message.trim(),
},
requestedParameters: {
...parameters,
apiKey: openaiApiKey,
Expand All @@ -207,7 +200,10 @@ export function useCreateAppContext(): Context {
const id = await chatManager.createChat();
await chatManager.sendMessage({
chatID: id,
content: content.trim(),
content: {
type: "text",
text: message.trim(),
},
requestedParameters: {
...parameters,
apiKey: openaiApiKey,
Expand Down