File size: 713 Bytes
99a3f34
760d7c9
99a3f34
5b3feea
99a3f34
 
 
10330bc
 
 
5b3feea
 
10330bc
99a3f34
1cb46fc
5b3feea
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
from langchain_openai import OpenAIEmbeddings
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.memory import ChatMessageHistory, ConversationBufferMemory



class Config:
    temperature = 0
    streaming = True
    max_size_mb=20
    timeout=180
    chain_type = "stuff"
    max_token_limit = 4098
    embeddings = OpenAIEmbeddings()
    text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=100)
    model_name="gpt-3.5-turbo"
    message_history = ChatMessageHistory()
    memory = ConversationBufferMemory(
        memory_key="chat_history",
        output_key="answer",
        chat_memory=message_history,
        return_messages=True
    )