2024-06-12 15:12:11 +08:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
from pathlib import Path
|
2024-05-21 22:48:41 +08:00
|
|
|
|
2024-06-12 15:12:11 +08:00
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
|
|
|
|
# TODO: use pydantic for other modules in Qlib
|
|
|
|
|
# from pydantic_settings import BaseSettings
|
2024-05-21 22:48:41 +08:00
|
|
|
|
|
|
|
|
|
2024-06-14 12:59:44 +08:00
|
|
|
class RDAgentSettings(BaseSettings):
|
2024-07-16 20:35:42 +08:00
|
|
|
# TODO: (xiao) I think LLMSetting may be a better name.
|
2024-07-01 14:24:47 +08:00
|
|
|
# TODO: (xiao) I think most of the config should be in oai.config
|
2024-07-16 20:35:42 +08:00
|
|
|
# Log configs
|
2024-07-17 15:00:13 +08:00
|
|
|
# TODO: (xiao) think it can be a separate config.
|
2024-07-16 20:35:42 +08:00
|
|
|
log_trace_path: str | None = None
|
2024-05-30 10:33:07 +08:00
|
|
|
|
2024-06-18 11:50:03 +08:00
|
|
|
# azure document intelligence configs
|
2024-05-30 10:33:07 +08:00
|
|
|
azure_document_intelligence_key: str = ""
|
|
|
|
|
azure_document_intelligence_endpoint: str = ""
|
|
|
|
|
# factor extraction conf
|
2024-08-15 18:52:37 +08:00
|
|
|
max_input_duplicate_factor_group: int = 300
|
2024-05-30 10:33:07 +08:00
|
|
|
max_output_duplicate_factor_group: int = 20
|
2024-08-21 16:48:09 +08:00
|
|
|
max_kmeans_group_number: int = 40
|
2024-06-14 12:59:44 +08:00
|
|
|
|
2024-07-17 15:00:13 +08:00
|
|
|
# workspace conf
|
|
|
|
|
workspace_path: Path = Path.cwd() / "git_ignore_folder" / "RD-Agent_workspace"
|
|
|
|
|
|
|
|
|
|
# multi processing conf
|
|
|
|
|
multi_proc_n: int = 1
|
|
|
|
|
|
2024-10-14 17:34:09 +08:00
|
|
|
# pickle cache conf
|
|
|
|
|
cache_with_pickle: bool = True # whether to use pickle cache
|
|
|
|
|
pickle_cache_folder_path_str: str = str(
|
|
|
|
|
Path.cwd() / "pickle_cache/",
|
|
|
|
|
) # the path of the folder to store the pickle cache
|
|
|
|
|
use_file_lock: bool = (
|
|
|
|
|
True # when calling the function with same parameters, whether to use file lock to avoid
|
|
|
|
|
# executing the function multiple times
|
|
|
|
|
)
|
|
|
|
|
|
2024-06-18 11:50:03 +08:00
|
|
|
|
|
|
|
|
RD_AGENT_SETTINGS = RDAgentSettings()
|