TOML
TOML 是一種用於設定檔的檔案格式。它旨在易於閱讀和編寫,並設計為明確地映射到字典。其規範是開源的。
TOML
在許多程式語言中實作。名稱TOML
是 "Tom's Obvious, Minimal Language" 的縮寫,指的是其創建者 Tom Preston-Werner。
如果您需要載入 Toml
檔案,請使用 TomlLoader
。
from langchain_community.document_loaders import TomlLoader
API 參考:TomlLoader
loader = TomlLoader("example_data/fake_rule.toml")
rule = loader.load()
rule
[Document(page_content='{"internal": {"creation_date": "2023-05-01", "updated_date": "2022-05-01", "release": ["release_type"], "min_endpoint_version": "some_semantic_version", "os_list": ["operating_system_list"]}, "rule": {"uuid": "some_uuid", "name": "Fake Rule Name", "description": "Fake description of rule", "query": "process where process.name : \\"somequery\\"\\n", "threat": [{"framework": "MITRE ATT&CK", "tactic": {"name": "Execution", "id": "TA0002", "reference": "https://attack.mitre.org/tactics/TA0002/"}}]}}', metadata={'source': 'example_data/fake_rule.toml'})]