def fetchstocklist(self): """获取股票列表""" try: logger.info("Fetching stock list...")…
- User
def fetch_stock_list(self): """获取股票列表""" try: logger.info("Fetching stock list...") stock_list = ak.stock_zh_a_spot() return stock_list except Exception as e: logger.error(f"Failed to fetch stock list: {e}") raise DataFetchError(f"Failed to fetch stock list: {e}")
这里面的逻辑要改一下 获取股票列表之前先看上一次写入的CSV文件存不存在 如果写入CSV文件还在一百天以内 那么就直接 读取CSV文件就行了
包括fetch_index_list也是一样的
Assistant
I'll help you modify the code to add caching logic for both and methods. Here's the improved version:
- User
config在src/core/config.py里面啊。为什么还要自己写stock_csv_path 呢?
Assistant
您说得对,我们应该使用已有的配置系统。让我们修改一下代码:
- 首先在 中添加相关配置项:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.