File size: 564 Bytes
3d3d712 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import glob
from os import path
from typing import List
from taskweaver.memory.conversation import Conversation
def load_examples(folder: str) -> List[Conversation]:
"""
Load all the examples from a folder.
Args:
folder: the folder path.
"""
example_file_list: List[str] = glob.glob(path.join(folder, "*.yaml"))
example_conv_pool: List[Conversation] = []
for yaml_path in example_file_list:
conversation = Conversation.from_yaml(yaml_path)
example_conv_pool.append(conversation)
return example_conv_pool
|