Skip to content

Commit 0d1fc36

Browse files
committed
bug fix
1 parent 6b353da commit 0d1fc36

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/main.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ def get_redis():
9494
def refresh_page(r: redis.Redis = Depends(get_redis)):
9595
"""刷新页面,清空redis缓存"""
9696
r.flushdb()
97-
# redis_pool = redis.ConnectionPool(host='localhost', port=6379, db=1)
98-
# r = redis.Redis(connection_pool=redis_pool)
9997
return {"message": "Redis db=1 cache cleared!"}
10098

10199

@@ -255,13 +253,6 @@ async def event_generator():
255253
return EventSourceResponse(event_generator())
256254

257255

258-
# def add_to_message(role: str, content: str, message):
259-
# """
260-
# 将用户输入的问题添加到message中
261-
# """
262-
# message[0].append({"role": role, "content": content})
263-
# return message
264-
265256
@app.get("/multi-round-chat")
266257
async def multi_chat_stream(input: Optional[str] = None) \
267258
-> EventSourceResponse:

utils/abiDecoder.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import json
2+
import os
23

34
import requests
5+
from dotenv import load_dotenv
6+
7+
load_dotenv()
8+
etherscan_api_key = os.getenv("ETHERSCAN_API_KEY")
49

510

611
def get_abi(address):
7-
etherscan_api_key = '9SA795JPYP95TBMSVQT1KEWNUV3VI7Y7ZE'
812
url = f"https://api.etherscan.io/api?module=contract&action=getabi" \
913
f"&address={address}&apikey={etherscan_api_key}"
1014
response = requests.get(url)

0 commit comments

Comments
 (0)