Crawl/update env variables (#931)

* 📝 add env variable for crawl

* 🐛 make CharQuestion with optional attributes

* 💡 make chatQustion config optional
This commit is contained in:
Zineb El Bachiri 2023-08-18 11:59:20 +02:00 committed by GitHub
parent 9eb25a4d17
commit 74da7dde2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -19,3 +19,5 @@ MODEL_PATH=./local_models/ggml-gpt4all-j-v1.3-groovy.bin
#RESEND #RESEND
RESEND_API_KEY=<change-me> RESEND_API_KEY=<change-me>
RESEND_EMAIL_ADDRESS=onboarding@resend.dev RESEND_EMAIL_ADDRESS=onboarding@resend.dev
CRAWL_DEPTH=1

View File

@ -17,8 +17,8 @@ class ChatMessage(BaseModel):
class ChatQuestion(BaseModel): class ChatQuestion(BaseModel):
model: str = "gpt-3.5-turbo"
question: str question: str
temperature: float = 0.0 model: Optional[str]
max_tokens: int = 256 temperature: Optional[float]
max_tokens: Optional[int]
brain_id: Optional[UUID] brain_id: Optional[UUID]

View File

@ -29,7 +29,7 @@ export const useChat = () => {
const { createChat } = useChatApi(); const { createChat } = useChatApi();
const { addStreamQuestion } = useQuestion(); const { addStreamQuestion } = useQuestion();
const { t } = useTranslation(['chat']); const { t } = useTranslation(["chat"]);
const addQuestion = async (question: string, callback?: () => void) => { const addQuestion = async (question: string, callback?: () => void) => {
try { try {
@ -43,6 +43,7 @@ export const useChat = () => {
const chat = await createChat(chatName); const chat = await createChat(chatName);
currentChatId = chat.chat_id; currentChatId = chat.chat_id;
setChatId(currentChatId); setChatId(currentChatId);
//TODO: update chat list here
} }
void track('QUESTION_ASKED'); void track('QUESTION_ASKED');