mirror of
https://github.com/microsoft/graphrag.git
synced 2026-01-14 09:07:20 +08:00
Some checks failed
Python Build and Type Check / python-ci (ubuntu-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (ubuntu-latest, 3.12) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.12) (push) Has been cancelled
Python Integration Tests / python-ci (ubuntu-latest, 3.12) (push) Has been cancelled
Python Integration Tests / python-ci (windows-latest, 3.12) (push) Has been cancelled
Python Notebook Tests / python-ci (ubuntu-latest, 3.12) (push) Has been cancelled
Python Notebook Tests / python-ci (windows-latest, 3.12) (push) Has been cancelled
Python Smoke Tests / python-ci (ubuntu-latest, 3.12) (push) Has been cancelled
Python Smoke Tests / python-ci (windows-latest, 3.12) (push) Has been cancelled
Python Unit Tests / python-ci (ubuntu-latest, 3.12) (push) Has been cancelled
Python Unit Tests / python-ci (windows-latest, 3.12) (push) Has been cancelled
* Add load_config to graphrag-common package.
28 lines
827 B
Python
28 lines
827 B
Python
# Copyright (c) 2024 Microsoft Corporation.
|
|
# Licensed under the MIT License
|
|
|
|
"""Config models for load_config unit tests."""
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class TestNestedModel(BaseModel):
|
|
"""Test nested model."""
|
|
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
nested_str: str = Field(description="A nested field.")
|
|
nested_int: int = Field(description="Another nested field.")
|
|
|
|
|
|
class TestConfigModel(BaseModel):
|
|
"""Test configuration model."""
|
|
|
|
model_config = ConfigDict(extra="forbid")
|
|
__test__ = False # type: ignore
|
|
|
|
name: str = Field(description="Name field.")
|
|
value: int = Field(description="Value field.")
|
|
nested: TestNestedModel = Field(description="Nested model field.")
|
|
nested_list: list[TestNestedModel] = Field(description="List of nested models.")
|