feat: upgrade langchain (#430)

Co-authored-by: jyong <718720800@qq.com>
This commit is contained in:
John Wang 2023-06-25 16:49:14 +08:00 • committed by GitHub
commit 3241e4015b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
91 changed files with 2703 additions and 3153 deletions

View file

@ -3,6 +3,7 @@ import re
import subprocess
import uuid
from datetime import datetime
from hashlib import sha256
from zoneinfo import available_timezones
import random
import string
@ -147,3 +148,8 @@ def get_remote_ip(request):
return request.headers.getlist("X-Forwarded-For")[0]
else:
return request.remote_addr
def generate_text_hash(text: str) -> str:
hash_text = str(text) + 'None'
return sha256(hash_text.encode()).hexdigest()