Skip to content

Instantly share code, notes, and snippets.

@christopherbauer
Last active May 18, 2024 16:16
Show Gist options
  • Save christopherbauer/bc1aa909871782767e857e1bb79f6d47 to your computer and use it in GitHub Desktop.
Save christopherbauer/bc1aa909871782767e857e1bb79f6d47 to your computer and use it in GitHub Desktop.
export type Message = { text: string; sent: Date; source: string };
export type Conversation = Message[];
export type ConversationListEntry = {
id: string;
persona: string;
firstMessage: Message;
};
export type ConversationList = ConversationListEntry[];
export interface ConversationService {
getConversationList: () => Promise<ConversationList>;
getConversation: (id: string) => Promise<Conversation>;
createConversation: (
id: string,
persona: string,
initial: Message
) => Promise<Conversation>;
updateConversation: (id: string, message: Message) => Promise<Conversation>;
deleteConversation: (id: string) => Promise<boolean>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment