mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
build: use tsconfig bundler (#3581)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user