mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
update SPO code
This commit is contained in:
parent
8888cf9652
commit
2528581c4c
2 changed files with 11 additions and 5 deletions
|
|
@ -11,11 +11,19 @@ def set_file_name(name):
|
|||
|
||||
|
||||
def load_meta_data(k=SAMPLE_K):
|
||||
|
||||
# load yaml file
|
||||
config_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'settings', FILE_NAME)
|
||||
with open(config_path, 'r', encoding='utf-8') as file:
|
||||
data = yaml.safe_load(file)
|
||||
|
||||
if not os.path.exists(config_path):
|
||||
raise FileNotFoundError(f"Configuration file '{FILE_NAME}' not found in settings directory")
|
||||
|
||||
try:
|
||||
with open(config_path, 'r', encoding='utf-8') as file:
|
||||
data = yaml.safe_load(file)
|
||||
except yaml.YAMLError as e:
|
||||
raise ValueError(f"Error parsing YAML file '{FILE_NAME}': {str(e)}")
|
||||
except Exception as e:
|
||||
raise Exception(f"Error reading file '{FILE_NAME}': {str(e)}")
|
||||
|
||||
qa = []
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,4 @@ class PromptUtils:
|
|||
|
||||
with open(os.path.join(directory, "prompt.txt"), "w", encoding="utf-8") as file:
|
||||
file.write(prompt)
|
||||
with open(os.path.join(directory, "__init__.py"), "w", encoding="utf-8") as file:
|
||||
file.write("")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue