xiaozhi-esp32-server/libs/o-mem/memory_chain/utils.py
MECREATOR 16ef169036 Add 'libs/o-mem/' from commit '46e131ac39af55d456304c61dfb881717044528e'
git-subtree-dir: libs/o-mem
git-subtree-mainline: 6eb7acaf73
git-subtree-split: 46e131ac39
2025-12-14 01:36:24 +11:00

21 lines
746 B
Python

#!/usr/bin/env python
# coding=utf-8
# Copyright 2025 The OPPO Personal AI team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
def ensure_directory_exists(path):
os.makedirs(os.path.dirname(path), exist_ok=True)