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 types to include image or text content
  • Loading branch information
jp-ipu committed Nov 11, 2023
commit a7fd44ca37e46c140f40584dacd6b04446679ed7
22 changes: 19 additions & 3 deletions app/src/core/chat/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,44 @@ export interface Parameters {
model: string;
}

export type TextContentItem = {
type: 'text';
text: string;
}

export type ImageContentItem = {
type: 'image_url';
image_url: {
url: string;
};
};

export type ContentItem = TextContentItem | ImageContentItem;

export type MessageContent = string | ContentItem[];

export interface Message {
id: string;
chatID: string;
parentID?: string;
timestamp: number;
role: string;
model?: string;
content: string;
content: MessageContent;
parameters?: Parameters;
done?: boolean;
}

export interface UserSubmittedMessage {
chatID: string;
parentID?: string;
content: string;
content: MessageContent;
requestedParameters: Parameters;
}

export interface OpenAIMessage {
role: string;
content: string;
content: MessageContent;
}

export function getOpenAIMessageFromMessage(message: Message): OpenAIMessage {
Expand Down