build: use tsconfig bundler (#3581)

This commit is contained in:
Alex Yang
2023-08-04 17:00:36 -07:00
committed by GitHub
parent bbf5f0efe0
commit 97de0ef5b4
21 changed files with 116 additions and 221 deletions

View File

@@ -13,7 +13,7 @@ import { IndexedDBChatMessageHistory } from './langchain/message-history';
import { chatPrompt, followupQuestionPrompt } from './prompts';
import { followupQuestionParser } from './prompts/output-parser';
type ChatAI = {
export type ChatAI = {
// Core chat AI
conversationChain: ConversationChain;
// Followup AI, used to generate followup questions

View File

@@ -9,7 +9,7 @@ import type { BaseMessage } from 'langchain/schema';
import { AIMessage } from 'langchain/schema';
import { HumanMessage } from 'langchain/schema';
import type { ChatAIConfig } from '../chat';
import type { ChatAI, ChatAIConfig } from '../chat';
import { createChatAI } from '../chat';
import type { IndexedDBChatMessageHistory } from '../langchain/message-history';
import { followupQuestionParser } from '../prompts/output-parser';
@@ -28,7 +28,7 @@ const conversationWeakMap = new WeakMap<
WritableAtom<BaseMessage[], [string], Promise<void>>
>();
export const chatAtom = atom(async get => {
export const chatAtom = atom<Promise<ChatAI>>(async get => {
const openAIApiKey = get(openAIApiKeyAtom);
if (!openAIApiKey) {
throw new Error('OpenAI API key not set, chat will not work');