Skip to content

Commit

Permalink
fix: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lucgagan committed Jun 27, 2023
1 parent 47620e7 commit 689b2fa
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/createChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,16 @@ interface SendMessage {
<T extends MessageOptions>(
prompt: string,
messageOptions: T
// @ts-expect-error TODO
// @ts-expect-error TODO
): Promise<StructuredChoice<FromSchema<T["expect"]["schema"]>>>;

(
prompt: string,
messageOptions?: MessageOptions
): Promise<Choice>;

(prompt: string, messageOptions?: MessageOptions): Promise<Choice>;
}

export type Chat = {
addMessage: (message: Message) => void;
getMessages: () => Message[];
sendMessage: SendMessage;

};

/**
Expand Down Expand Up @@ -230,4 +226,4 @@ export const createChat = (
getMessages: () => messages,
sendMessage,
};
};
};

0 comments on commit 689b2fa

Please sign in to comment.