Skip to content

models

Class info

Classes

Name Children Inherits
BaseResource
llmling.config.models
Base class for all resource types.
BaseToolsetConfig
llmling.config.models
Base configuration for toolsets.
CLIResource
llmling.config.models
Resource from CLI command execution.
    CallableResource
    llmling.config.models
    Resource from executing a Python callable.
      Config
      llmling.config.models
      Root configuration model.
        CustomToolsetConfig
        llmling.config.models
        Configuration for custom toolsets.
          EntryPointToolsetConfig
          llmling.config.models
          Configuration for entry point toolsets.
            GlobalSettings
            llmling.config.models
            Global settings that apply to all components.
              Jinja2Config
              llmling.config.models
              Configuration for Jinja2 environment.
                LLMCapabilitiesConfig
                llmling.config.models
                Configuration for LLM system capabilities.
                  OpenAPIToolsetConfig
                  llmling.config.models
                  Configuration for OpenAPI toolsets.
                    PathResource
                    llmling.config.models
                    Resource loaded from a file or URL.
                      RepositoryResource
                      llmling.config.models
                      Git repository content.
                        SourceResource
                        llmling.config.models
                        Resource from Python source code.
                          TextResource
                          llmling.config.models
                          Raw text resource.
                            ToolConfig
                            llmling.config.models
                            Configuration for a tool.
                              ToolHints
                              llmling.config.models
                              Configuration for tool execution hints.
                                WatchConfig
                                llmling.config.models
                                Watch configuration for resources.

                                  🛈 DocStrings

                                  Configuration models for LLMling.

                                  BaseResource

                                  Bases: Schema

                                  Base class for all resource types.

                                  Source code in src/llmling/config/models.py
                                  class BaseResource(Schema):
                                      """Base class for all resource types."""
                                  
                                      type: str = Field(init=False)
                                      """Type identifier for this resource."""
                                  
                                      description: str = ""
                                      """Human-readable description of the resource."""
                                  
                                      uri: str | None = None
                                      """Canonical URI for this resource, set during registration if unset."""
                                  
                                      processors: list[ProcessingStep] = Field(default_factory=list)
                                      """Processing steps to apply when loading this resource."""
                                  
                                      watch: WatchConfig | None = None
                                      """Configuration for file system watching, if supported."""
                                  
                                      name: str | None = Field(None, exclude=True)
                                      """Technical identifier (automatically set from config key during registration)."""
                                  
                                      # TODO: proper extra="forbid" for all subclasses.
                                      model_config = ConfigDict(frozen=True)
                                  
                                      def validate_resource(self) -> list[str]:
                                          """Validate resource at runtime.
                                  
                                          This validation is intentionally separated from Pydantic's model validation
                                          to handle:
                                          - Remote resources and URLs
                                          - Template/placeholder paths that don't exist during config loading
                                          - Resources that may become available after config loading
                                          - Validation of actual resource availability separate from config structure
                                  
                                          Returns:
                                              List of validation warnings (empty if all valid)
                                          """
                                          return []
                                  
                                      @property
                                      def supports_watching(self) -> bool:
                                          """Whether this resource instance supports watching."""
                                          return False
                                  
                                      def is_watched(self) -> bool:
                                          """Tell if this resource should be watched."""
                                          return self.supports_watching and self.watch is not None and self.watch.enabled
                                  
                                      def is_templated(self) -> bool:
                                          """Whether this resource supports URI templates."""
                                          return False  # Default: resources are static
                                  
                                      def get_watch_path(self) -> str | None:
                                          """Get the path to watch if this resource supports watching."""
                                          return None
                                  
                                      @property
                                      def mime_type(self) -> str:
                                          """Get the MIME type for this resource.
                                  
                                          This should be overridden by subclasses that can determine
                                          their MIME type. Default is text/plain.
                                          """
                                          return "text/plain"
                                  

                                  description class-attribute instance-attribute

                                  description: str = ''
                                  

                                  Human-readable description of the resource.

                                  mime_type property

                                  mime_type: str
                                  

                                  Get the MIME type for this resource.

                                  This should be overridden by subclasses that can determine their MIME type. Default is text/plain.

                                  name class-attribute instance-attribute

                                  name: str | None = Field(None, exclude=True)
                                  

                                  Technical identifier (automatically set from config key during registration).

                                  processors class-attribute instance-attribute

                                  processors: list[ProcessingStep] = Field(default_factory=list)
                                  

                                  Processing steps to apply when loading this resource.

                                  supports_watching property

                                  supports_watching: bool
                                  

                                  Whether this resource instance supports watching.

                                  type class-attribute instance-attribute

                                  type: str = Field(init=False)
                                  

                                  Type identifier for this resource.

                                  uri class-attribute instance-attribute

                                  uri: str | None = None
                                  

                                  Canonical URI for this resource, set during registration if unset.

                                  watch class-attribute instance-attribute

                                  watch: WatchConfig | None = None
                                  

                                  Configuration for file system watching, if supported.

                                  get_watch_path

                                  get_watch_path() -> str | None
                                  

                                  Get the path to watch if this resource supports watching.

                                  Source code in src/llmling/config/models.py
                                  def get_watch_path(self) -> str | None:
                                      """Get the path to watch if this resource supports watching."""
                                      return None
                                  

                                  is_templated

                                  is_templated() -> bool
                                  

                                  Whether this resource supports URI templates.

                                  Source code in src/llmling/config/models.py
                                  def is_templated(self) -> bool:
                                      """Whether this resource supports URI templates."""
                                      return False  # Default: resources are static
                                  

                                  is_watched

                                  is_watched() -> bool
                                  

                                  Tell if this resource should be watched.

                                  Source code in src/llmling/config/models.py
                                  def is_watched(self) -> bool:
                                      """Tell if this resource should be watched."""
                                      return self.supports_watching and self.watch is not None and self.watch.enabled
                                  

                                  validate_resource

                                  validate_resource() -> list[str]
                                  

                                  Validate resource at runtime.

                                  This validation is intentionally separated from Pydantic's model validation to handle: - Remote resources and URLs - Template/placeholder paths that don't exist during config loading - Resources that may become available after config loading - Validation of actual resource availability separate from config structure

                                  Returns:

                                  Type Description
                                  list[str]

                                  List of validation warnings (empty if all valid)

                                  Source code in src/llmling/config/models.py
                                  def validate_resource(self) -> list[str]:
                                      """Validate resource at runtime.
                                  
                                      This validation is intentionally separated from Pydantic's model validation
                                      to handle:
                                      - Remote resources and URLs
                                      - Template/placeholder paths that don't exist during config loading
                                      - Resources that may become available after config loading
                                      - Validation of actual resource availability separate from config structure
                                  
                                      Returns:
                                          List of validation warnings (empty if all valid)
                                      """
                                      return []
                                  

                                  BaseToolsetConfig

                                  Bases: ConfigModel

                                  Base configuration for toolsets.

                                  Source code in src/llmling/config/models.py
                                  class BaseToolsetConfig(ConfigModel):
                                      """Base configuration for toolsets."""
                                  

                                  CLIResource

                                  Bases: BaseResource

                                  Resource from CLI command execution.

                                  Source code in src/llmling/config/models.py
                                  class CLIResource(BaseResource):
                                      """Resource from CLI command execution."""
                                  
                                      type: Literal["cli"] = Field(default="cli", init=False)
                                      """Discriminator field identifying this as a CLI-based resource."""
                                  
                                      command: str | Sequence[str]
                                      """Command to execute (string or sequence of arguments)."""
                                  
                                      shell: bool = False
                                      """Whether to run the command through a shell."""
                                  
                                      cwd: str | None = None
                                      """Working directory for command execution."""
                                  
                                      timeout: float | None = Field(None, ge=0)
                                      """Maximum time in seconds to wait for command completion."""
                                  
                                      @model_validator(mode="after")
                                      def validate_command(self) -> CLIResource:
                                          """Validate command configuration."""
                                          if not self.command:
                                              msg = "Command cannot be empty"
                                              raise ValueError(msg)
                                          if (
                                              isinstance(self.command, list | tuple)
                                              and not self.shell
                                              and not all(isinstance(part, str) for part in self.command)
                                          ):
                                              msg = "When shell=False, all command parts must be strings"
                                              raise ValueError(msg)
                                          return self
                                  

                                  command instance-attribute

                                  command: str | Sequence[str]
                                  

                                  Command to execute (string or sequence of arguments).

                                  cwd class-attribute instance-attribute

                                  cwd: str | None = None
                                  

                                  Working directory for command execution.

                                  shell class-attribute instance-attribute

                                  shell: bool = False
                                  

                                  Whether to run the command through a shell.

                                  timeout class-attribute instance-attribute

                                  timeout: float | None = Field(None, ge=0)
                                  

                                  Maximum time in seconds to wait for command completion.

                                  type class-attribute instance-attribute

                                  type: Literal['cli'] = Field(default='cli', init=False)
                                  

                                  Discriminator field identifying this as a CLI-based resource.

                                  validate_command

                                  validate_command() -> CLIResource
                                  

                                  Validate command configuration.

                                  Source code in src/llmling/config/models.py
                                  @model_validator(mode="after")
                                  def validate_command(self) -> CLIResource:
                                      """Validate command configuration."""
                                      if not self.command:
                                          msg = "Command cannot be empty"
                                          raise ValueError(msg)
                                      if (
                                          isinstance(self.command, list | tuple)
                                          and not self.shell
                                          and not all(isinstance(part, str) for part in self.command)
                                      ):
                                          msg = "When shell=False, all command parts must be strings"
                                          raise ValueError(msg)
                                      return self
                                  

                                  CallableResource

                                  Bases: BaseResource

                                  Resource from executing a Python callable.

                                  Source code in src/llmling/config/models.py
                                  class CallableResource(BaseResource):
                                      """Resource from executing a Python callable."""
                                  
                                      type: Literal["callable"] = Field(default="callable", init=False)
                                      """Discriminator field identifying this as a callable-based resource."""
                                  
                                      import_path: str
                                      """Dotted import path to the callable to execute."""
                                  
                                      keyword_args: dict[str, Any] = Field(default_factory=dict)
                                      """Keyword arguments to pass to the callable."""
                                  
                                      @model_validator(mode="after")
                                      def validate_import_path(self) -> CallableResource:
                                          """Validate that the import path is properly formatted."""
                                          if not all(part.isidentifier() for part in self.import_path.split(".")):
                                              msg = f"Invalid import path: {self.import_path}"
                                              raise ValueError(msg)
                                          return self
                                  
                                      def is_templated(self) -> bool:
                                          """Callable resources are templated if they take parameters."""
                                          fn = import_callable(self.import_path)
                                          sig = inspect.signature(fn, annotation_format=annotationlib.Format.FORWARDREF)
                                          return bool(sig.parameters)
                                  

                                  import_path instance-attribute

                                  import_path: str
                                  

                                  Dotted import path to the callable to execute.

                                  keyword_args class-attribute instance-attribute

                                  keyword_args: dict[str, Any] = Field(default_factory=dict)
                                  

                                  Keyword arguments to pass to the callable.

                                  type class-attribute instance-attribute

                                  type: Literal['callable'] = Field(default='callable', init=False)
                                  

                                  Discriminator field identifying this as a callable-based resource.

                                  is_templated

                                  is_templated() -> bool
                                  

                                  Callable resources are templated if they take parameters.

                                  Source code in src/llmling/config/models.py
                                  def is_templated(self) -> bool:
                                      """Callable resources are templated if they take parameters."""
                                      fn = import_callable(self.import_path)
                                      sig = inspect.signature(fn, annotation_format=annotationlib.Format.FORWARDREF)
                                      return bool(sig.parameters)
                                  

                                  validate_import_path

                                  validate_import_path() -> CallableResource
                                  

                                  Validate that the import path is properly formatted.

                                  Source code in src/llmling/config/models.py
                                  @model_validator(mode="after")
                                  def validate_import_path(self) -> CallableResource:
                                      """Validate that the import path is properly formatted."""
                                      if not all(part.isidentifier() for part in self.import_path.split(".")):
                                          msg = f"Invalid import path: {self.import_path}"
                                          raise ValueError(msg)
                                      return self
                                  

                                  Config

                                  Bases: ConfigModel

                                  Root configuration model.

                                  Source code in src/llmling/config/models.py
                                  class Config(ConfigModel):
                                      """Root configuration model."""
                                  
                                      version: str = "1.0"
                                      """Version string for this configuration format."""
                                  
                                      global_settings: GlobalSettings = Field(default_factory=GlobalSettings)
                                      """Global settings that apply to all components."""
                                  
                                      context_processors: dict[str, ProcessorConfig] = Field(default_factory=dict)
                                      """Content processors available for resource transformation."""
                                  
                                      resources: dict[str, Resource] = Field(default_factory=dict)
                                      """Resource definitions keyed by name."""
                                  
                                      resource_groups: dict[str, list[str]] = Field(default_factory=dict)
                                      """Groups of resources for logical organization."""
                                  
                                      tools: dict[str, ToolConfig] = Field(default_factory=dict)
                                      """Tool definitions keyed by name."""
                                  
                                      toolsets: dict[str, ToolsetConfig] = Field(default_factory=dict)
                                      """Toolset configurations for extensible tool collections."""
                                  
                                      prompts: dict[str, PromptType] = Field(default_factory=dict)
                                      """Prompt definitions keyed by name."""
                                  
                                      model_config = ConfigDict(
                                          frozen=True,
                                          arbitrary_types_allowed=True,
                                          extra="allow",  # extra fields used by the server for example.
                                      )
                                  
                                      # @model_validator(mode="before")
                                      # @classmethod
                                      # def populate_prompt_names(cls, data: dict[str, Any]) -> dict[str, Any]:
                                      #     """Populate prompt names from dictionary keys before validation."""
                                      #     if isinstance(data, dict) and "prompts" in data:
                                      #         prompts = data["prompts"]
                                      #         if isinstance(prompts, dict):
                                      #             # Add name to each prompt's data
                                      #             data["prompts"] = {
                                      #                 key: {
                                      #                     "name": key,
                                      #                     **(val if isinstance(val, dict) else val.model_dump()),
                                      #                 }
                                      #                 for key, val in prompts.items()
                                      #             }
                                      #     return data
                                  
                                      @model_validator(mode="after")
                                      def validate_references(self) -> Config:
                                          """Validate all references between components."""
                                          # Only validate if the optional components are present
                                          if self.resource_groups:
                                              self._validate_resource_groups()
                                          if self.context_processors:
                                              self._validate_processor_references()
                                          return self
                                  
                                      def _validate_resource_groups(self) -> None:
                                          """Validate resource references in groups."""
                                          for group, resources in self.resource_groups.items():
                                              for resource in resources:
                                                  if resource not in self.resources:
                                                      msg = f"Resource {resource} referenced in group {group} not found"
                                                      raise ValueError(msg)
                                  
                                      def _validate_processor_references(self) -> None:
                                          """Validate processor references in resources."""
                                          for resource in self.resources.values():
                                              for processor in resource.processors:
                                                  if processor.name not in self.context_processors:
                                                      msg = f"Processor {processor.name!r} not found"
                                                      raise ValueError(msg)
                                  
                                      @classmethod
                                      def from_file(cls, path: JoinablePathLike) -> Self:
                                          """Load configuration from YAML file.
                                  
                                          This function only handles the basic loading and model validation.
                                          For full validation and management, use ConfigManager.load() instead.
                                  
                                          Args:
                                              path: Path to configuration file
                                  
                                          Returns:
                                              Loaded configuration
                                  
                                          Raises:
                                              ConfigError: If loading fails
                                          """
                                          import yamling
                                  
                                          logger.debug("Loading configuration from %s", path)
                                  
                                          try:
                                              content = yamling.load_yaml_file(path)
                                          except Exception as exc:
                                              msg = f"Failed to load YAML from {path!r}"
                                              raise exceptions.ConfigError(msg) from exc
                                  
                                          # Validate basic structure
                                          if not isinstance(content, dict):
                                              msg = "Configuration must be a dictionary"
                                              raise exceptions.ConfigError(msg)
                                  
                                          try:
                                              config = cls.model_validate(content)
                                          except Exception as exc:
                                              msg = f"Failed to validate configuration from {path}"
                                              raise exceptions.ConfigError(msg) from exc
                                          else:
                                              logger.debug("Loaded raw configuration:")
                                              msg = "version=%s, resources=%d, tools=%d, toolsets=%d, prompts=%d"
                                              logger.debug(
                                                  msg,
                                                  config.version,
                                                  len(config.resources),
                                                  len(config.tools),
                                                  len(config.toolsets),
                                                  len(config.prompts),
                                              )
                                              return config
                                  

                                  context_processors class-attribute instance-attribute

                                  context_processors: dict[str, ProcessorConfig] = Field(default_factory=dict)
                                  

                                  Content processors available for resource transformation.

                                  global_settings class-attribute instance-attribute

                                  global_settings: GlobalSettings = Field(default_factory=GlobalSettings)
                                  

                                  Global settings that apply to all components.

                                  prompts class-attribute instance-attribute

                                  prompts: dict[str, PromptType] = Field(default_factory=dict)
                                  

                                  Prompt definitions keyed by name.

                                  resource_groups class-attribute instance-attribute

                                  resource_groups: dict[str, list[str]] = Field(default_factory=dict)
                                  

                                  Groups of resources for logical organization.

                                  resources class-attribute instance-attribute

                                  resources: dict[str, Resource] = Field(default_factory=dict)
                                  

                                  Resource definitions keyed by name.

                                  tools class-attribute instance-attribute

                                  tools: dict[str, ToolConfig] = Field(default_factory=dict)
                                  

                                  Tool definitions keyed by name.

                                  toolsets class-attribute instance-attribute

                                  toolsets: dict[str, ToolsetConfig] = Field(default_factory=dict)
                                  

                                  Toolset configurations for extensible tool collections.

                                  version class-attribute instance-attribute

                                  version: str = '1.0'
                                  

                                  Version string for this configuration format.

                                  from_file classmethod

                                  from_file(path: JoinablePathLike) -> Self
                                  

                                  Load configuration from YAML file.

                                  This function only handles the basic loading and model validation. For full validation and management, use ConfigManager.load() instead.

                                  Parameters:

                                  Name Type Description Default
                                  path JoinablePathLike

                                  Path to configuration file

                                  required

                                  Returns:

                                  Type Description
                                  Self

                                  Loaded configuration

                                  Raises:

                                  Type Description
                                  ConfigError

                                  If loading fails

                                  Source code in src/llmling/config/models.py
                                  @classmethod
                                  def from_file(cls, path: JoinablePathLike) -> Self:
                                      """Load configuration from YAML file.
                                  
                                      This function only handles the basic loading and model validation.
                                      For full validation and management, use ConfigManager.load() instead.
                                  
                                      Args:
                                          path: Path to configuration file
                                  
                                      Returns:
                                          Loaded configuration
                                  
                                      Raises:
                                          ConfigError: If loading fails
                                      """
                                      import yamling
                                  
                                      logger.debug("Loading configuration from %s", path)
                                  
                                      try:
                                          content = yamling.load_yaml_file(path)
                                      except Exception as exc:
                                          msg = f"Failed to load YAML from {path!r}"
                                          raise exceptions.ConfigError(msg) from exc
                                  
                                      # Validate basic structure
                                      if not isinstance(content, dict):
                                          msg = "Configuration must be a dictionary"
                                          raise exceptions.ConfigError(msg)
                                  
                                      try:
                                          config = cls.model_validate(content)
                                      except Exception as exc:
                                          msg = f"Failed to validate configuration from {path}"
                                          raise exceptions.ConfigError(msg) from exc
                                      else:
                                          logger.debug("Loaded raw configuration:")
                                          msg = "version=%s, resources=%d, tools=%d, toolsets=%d, prompts=%d"
                                          logger.debug(
                                              msg,
                                              config.version,
                                              len(config.resources),
                                              len(config.tools),
                                              len(config.toolsets),
                                              len(config.prompts),
                                          )
                                          return config
                                  

                                  validate_references

                                  validate_references() -> Config
                                  

                                  Validate all references between components.

                                  Source code in src/llmling/config/models.py
                                  @model_validator(mode="after")
                                  def validate_references(self) -> Config:
                                      """Validate all references between components."""
                                      # Only validate if the optional components are present
                                      if self.resource_groups:
                                          self._validate_resource_groups()
                                      if self.context_processors:
                                          self._validate_processor_references()
                                      return self
                                  

                                  CustomToolsetConfig

                                  Bases: BaseToolsetConfig

                                  Configuration for custom toolsets.

                                  Source code in src/llmling/config/models.py
                                  class CustomToolsetConfig(BaseToolsetConfig):
                                      """Configuration for custom toolsets."""
                                  
                                      type: Literal["custom"] = Field("custom", init=False)
                                      """Discriminator field identifying this as a custom toolset."""
                                  
                                      import_path: str = Field(...)
                                      """Dotted import path to the custom toolset implementation class."""
                                  
                                      @field_validator("import_path", mode="after")
                                      @classmethod
                                      def validate_import_path(cls, v: str) -> str:
                                          from llmling.tools.toolsets import ToolSet
                                  
                                          # v is already confirmed to be a str here
                                          try:
                                              cls = import_class(v)
                                              if not issubclass(cls, ToolSet):
                                                  msg = f"{v} must be a ToolSet class"
                                                  raise ValueError(msg)  # noqa: TRY004, TRY301
                                          except Exception as exc:
                                              msg = f"Invalid toolset class: {v}"
                                              raise ValueError(msg) from exc
                                          return v
                                  

                                  import_path class-attribute instance-attribute

                                  import_path: str = Field(...)
                                  

                                  Dotted import path to the custom toolset implementation class.

                                  type class-attribute instance-attribute

                                  type: Literal['custom'] = Field('custom', init=False)
                                  

                                  Discriminator field identifying this as a custom toolset.

                                  EntryPointToolsetConfig

                                  Bases: BaseToolsetConfig

                                  Configuration for entry point toolsets.

                                  Source code in src/llmling/config/models.py
                                  class EntryPointToolsetConfig(BaseToolsetConfig):
                                      """Configuration for entry point toolsets."""
                                  
                                      type: Literal["entry_points"] = Field("entry_points", init=False)
                                      """Discriminator field identifying this as an entry point toolset."""
                                  
                                      module: str = Field(..., description="Python module path")
                                      """Python module path to load tools from via entry points."""
                                  

                                  module class-attribute instance-attribute

                                  module: str = Field(..., description='Python module path')
                                  

                                  Python module path to load tools from via entry points.

                                  type class-attribute instance-attribute

                                  type: Literal['entry_points'] = Field('entry_points', init=False)
                                  

                                  Discriminator field identifying this as an entry point toolset.

                                  GlobalSettings

                                  Bases: ConfigModel

                                  Global settings that apply to all components.

                                  Source code in src/llmling/config/models.py
                                  class GlobalSettings(ConfigModel):
                                      """Global settings that apply to all components."""
                                  
                                      timeout: int = Field(default=30, ge=0)
                                      """Maximum time in seconds to wait for operations"""
                                  
                                      max_retries: int = Field(default=3, ge=0)
                                      """Maximum number of retries for failed operations"""
                                  
                                      requirements: list[str] = Field(default_factory=list)
                                      """List of package requirments for the functions used in this file."""
                                  
                                      pip_index_url: HttpUrl | None = None
                                      """Alternative PyPI index URL for package installation"""
                                  
                                      extra_paths: list[str] = Field(default_factory=list)
                                      """Additional import paths"""
                                  
                                      scripts: list[str] = Field(default_factory=list)
                                      """PEP723 scripts (can be imported and will be scanned for dependencies)"""
                                  
                                      prefer_uv: bool = False
                                      """Explicitely use uv for package installation / management """
                                  
                                      log_level: LogLevel = "INFO"
                                      """Log level for LLMling core."""
                                  
                                      jinja_environment: Jinja2Config = Field(default_factory=Jinja2Config)
                                      """Jinja2 environment configuration"""
                                  
                                      llm_capabilities: LLMCapabilitiesConfig = Field(default_factory=LLMCapabilitiesConfig)
                                      """Control which system capabilities are exposed to LLMs."""
                                  

                                  extra_paths class-attribute instance-attribute

                                  extra_paths: list[str] = Field(default_factory=list)
                                  

                                  Additional import paths

                                  jinja_environment class-attribute instance-attribute

                                  jinja_environment: Jinja2Config = Field(default_factory=Jinja2Config)
                                  

                                  Jinja2 environment configuration

                                  llm_capabilities class-attribute instance-attribute

                                  llm_capabilities: LLMCapabilitiesConfig = Field(default_factory=LLMCapabilitiesConfig)
                                  

                                  Control which system capabilities are exposed to LLMs.

                                  log_level class-attribute instance-attribute

                                  log_level: LogLevel = 'INFO'
                                  

                                  Log level for LLMling core.

                                  max_retries class-attribute instance-attribute

                                  max_retries: int = Field(default=3, ge=0)
                                  

                                  Maximum number of retries for failed operations

                                  pip_index_url class-attribute instance-attribute

                                  pip_index_url: HttpUrl | None = None
                                  

                                  Alternative PyPI index URL for package installation

                                  prefer_uv class-attribute instance-attribute

                                  prefer_uv: bool = False
                                  

                                  Explicitely use uv for package installation / management

                                  requirements class-attribute instance-attribute

                                  requirements: list[str] = Field(default_factory=list)
                                  

                                  List of package requirments for the functions used in this file.

                                  scripts class-attribute instance-attribute

                                  scripts: list[str] = Field(default_factory=list)
                                  

                                  PEP723 scripts (can be imported and will be scanned for dependencies)

                                  timeout class-attribute instance-attribute

                                  timeout: int = Field(default=30, ge=0)
                                  

                                  Maximum time in seconds to wait for operations

                                  Jinja2Config

                                  Bases: ConfigModel

                                  Configuration for Jinja2 environment.

                                  See: https://jinja.palletsprojects.com/en/3.1.x/api/#jinja2.Environment

                                  Source code in src/llmling/config/models.py
                                  class Jinja2Config(ConfigModel):
                                      """Configuration for Jinja2 environment.
                                  
                                      See: https://jinja.palletsprojects.com/en/3.1.x/api/#jinja2.Environment
                                      """
                                  
                                      block_start_string: str = "{%"
                                      """String denoting the beginning of a block (default: '{%')."""
                                  
                                      block_end_string: str = "%}"
                                      """String denoting the end of a block (default: '%}')."""
                                  
                                      variable_start_string: str = "{{"
                                      """String denoting the beginning of a variable (default: '{{')."""
                                  
                                      variable_end_string: str = "}}"
                                      """String denoting the end of a variable (default: '}}')."""
                                  
                                      comment_start_string: str = "{#"
                                      """String denoting the beginning of a comment (default: '{#')."""
                                  
                                      comment_end_string: str = "#}"
                                      """String denoting the end of a comment (default: '#}')."""
                                  
                                      line_statement_prefix: str | None = None
                                      """Prefix that begins a line-based statement (e.g., '#' for line statements)."""
                                  
                                      line_comment_prefix: str | None = None
                                      """Prefix that begins a line-based comment."""
                                  
                                      trim_blocks: bool = False
                                      """Remove first newline after a block (affects whitespace control)."""
                                  
                                      lstrip_blocks: bool = False
                                      """Remove leading spaces and tabs from the start of a line to a block."""
                                  
                                      newline_sequence: Literal["\n", "\r\n", "\r"] = "\n"
                                      """Sequence that starts a newline (default: '\n')."""
                                  
                                      keep_trailing_newline: bool = False
                                      """Preserve the trailing newline when rendering templates."""
                                  
                                      extensions: list[str] = Field(default_factory=list)
                                      """List of Jinja2 extensions to load (e.g., 'jinja2.ext.do')."""
                                  
                                      undefined: Literal["default", "strict", "debug", "chainable"] = "default"
                                      """Behavior when accessing undefined variables (default, strict, debug, chainable)."""
                                  
                                      filters: dict[str, str] = Field(default_factory=dict)
                                      """Custom filters as mapping of names to import paths."""
                                  
                                      tests: dict[str, str] = Field(default_factory=dict)
                                      """Custom tests as mapping of names to import paths."""
                                  
                                      globals: dict[str, Any] = Field(default_factory=dict)
                                      """Global variables available to all templates."""
                                  
                                      def create_environment_kwargs(self) -> dict[str, Any]:
                                          """Convert config to Jinja2 environment kwargs.
                                  
                                          Creates a dictionary of kwargs for jinja2.Environment with proper
                                          conversion of special values.
                                  
                                          Returns:
                                              Dict of kwargs for jinja2.Environment constructor
                                  
                                          Raises:
                                              ValueError: If filter or test imports fail
                                          """
                                          import jinja2
                                  
                                          # Start with basic string/bool config items
                                          kwargs = self.model_dump(exclude={"undefined", "filters", "tests"})
                                  
                                          # Convert undefined to proper class
                                          kwargs["undefined"] = {
                                              "default": jinja2.Undefined,
                                              "strict": jinja2.StrictUndefined,
                                              "debug": jinja2.DebugUndefined,
                                              "chainable": jinja2.ChainableUndefined,
                                          }[self.undefined]
                                  
                                          try:
                                              # Import filters and tests (must be callables)
                                              filters = {name: import_callable(path) for name, path in self.filters.items()}
                                              kwargs["filters"] = filters
                                              tests = {name: import_callable(path) for name, path in self.tests.items()}
                                              kwargs["tests"] = tests
                                          except Exception as exc:
                                              msg = f"Failed to import Jinja2 filters/tests: {exc}"
                                              raise ValueError(msg) from exc
                                  
                                          return kwargs
                                  

                                  block_end_string class-attribute instance-attribute

                                  block_end_string: str = '%}'
                                  

                                  String denoting the end of a block (default: '%}').

                                  block_start_string class-attribute instance-attribute

                                  block_start_string: str = '{%'
                                  

                                  String denoting the beginning of a block (default: '{%').

                                  comment_end_string class-attribute instance-attribute

                                  comment_end_string: str = '#}'
                                  

                                  String denoting the end of a comment (default: '#}').

                                  comment_start_string class-attribute instance-attribute

                                  comment_start_string: str = '{#'
                                  

                                  String denoting the beginning of a comment (default: '{#').

                                  extensions class-attribute instance-attribute

                                  extensions: list[str] = Field(default_factory=list)
                                  

                                  List of Jinja2 extensions to load (e.g., 'jinja2.ext.do').

                                  filters class-attribute instance-attribute

                                  filters: dict[str, str] = Field(default_factory=dict)
                                  

                                  Custom filters as mapping of names to import paths.

                                  globals class-attribute instance-attribute

                                  globals: dict[str, Any] = Field(default_factory=dict)
                                  

                                  Global variables available to all templates.

                                  keep_trailing_newline class-attribute instance-attribute

                                  keep_trailing_newline: bool = False
                                  

                                  Preserve the trailing newline when rendering templates.

                                  line_comment_prefix class-attribute instance-attribute

                                  line_comment_prefix: str | None = None
                                  

                                  Prefix that begins a line-based comment.

                                  line_statement_prefix class-attribute instance-attribute

                                  line_statement_prefix: str | None = None
                                  

                                  Prefix that begins a line-based statement (e.g., '#' for line statements).

                                  lstrip_blocks class-attribute instance-attribute

                                  lstrip_blocks: bool = False
                                  

                                  Remove leading spaces and tabs from the start of a line to a block.

                                  newline_sequence class-attribute instance-attribute

                                  newline_sequence: Literal['\n', '\r\n', '\r'] = '\n'
                                  

                                  Sequence that starts a newline (default: ' ').

                                  tests class-attribute instance-attribute

                                  tests: dict[str, str] = Field(default_factory=dict)
                                  

                                  Custom tests as mapping of names to import paths.

                                  trim_blocks class-attribute instance-attribute

                                  trim_blocks: bool = False
                                  

                                  Remove first newline after a block (affects whitespace control).

                                  undefined class-attribute instance-attribute

                                  undefined: Literal['default', 'strict', 'debug', 'chainable'] = 'default'
                                  

                                  Behavior when accessing undefined variables (default, strict, debug, chainable).

                                  variable_end_string class-attribute instance-attribute

                                  variable_end_string: str = '}}'
                                  

                                  String denoting the end of a variable (default: '}}').

                                  variable_start_string class-attribute instance-attribute

                                  variable_start_string: str = '{{'
                                  

                                  String denoting the beginning of a variable (default: '{{').

                                  create_environment_kwargs

                                  create_environment_kwargs() -> dict[str, Any]
                                  

                                  Convert config to Jinja2 environment kwargs.

                                  Creates a dictionary of kwargs for jinja2.Environment with proper conversion of special values.

                                  Returns:

                                  Type Description
                                  dict[str, Any]

                                  Dict of kwargs for jinja2.Environment constructor

                                  Raises:

                                  Type Description
                                  ValueError

                                  If filter or test imports fail

                                  Source code in src/llmling/config/models.py
                                  def create_environment_kwargs(self) -> dict[str, Any]:
                                      """Convert config to Jinja2 environment kwargs.
                                  
                                      Creates a dictionary of kwargs for jinja2.Environment with proper
                                      conversion of special values.
                                  
                                      Returns:
                                          Dict of kwargs for jinja2.Environment constructor
                                  
                                      Raises:
                                          ValueError: If filter or test imports fail
                                      """
                                      import jinja2
                                  
                                      # Start with basic string/bool config items
                                      kwargs = self.model_dump(exclude={"undefined", "filters", "tests"})
                                  
                                      # Convert undefined to proper class
                                      kwargs["undefined"] = {
                                          "default": jinja2.Undefined,
                                          "strict": jinja2.StrictUndefined,
                                          "debug": jinja2.DebugUndefined,
                                          "chainable": jinja2.ChainableUndefined,
                                      }[self.undefined]
                                  
                                      try:
                                          # Import filters and tests (must be callables)
                                          filters = {name: import_callable(path) for name, path in self.filters.items()}
                                          kwargs["filters"] = filters
                                          tests = {name: import_callable(path) for name, path in self.tests.items()}
                                          kwargs["tests"] = tests
                                      except Exception as exc:
                                          msg = f"Failed to import Jinja2 filters/tests: {exc}"
                                          raise ValueError(msg) from exc
                                  
                                      return kwargs
                                  

                                  LLMCapabilitiesConfig

                                  Bases: ConfigModel

                                  Configuration for LLM system capabilities.

                                  Source code in src/llmling/config/models.py
                                  class LLMCapabilitiesConfig(ConfigModel):
                                      """Configuration for LLM system capabilities."""
                                  
                                      load_resource: bool = False
                                      """Whether the LLM can load and access resource content."""
                                  
                                      get_resources: bool = False
                                      """Whether the LLM can discover available resources."""
                                  
                                      install_package: bool = False
                                      """Whether the LLM can install new Python packages for future tools."""
                                  
                                      register_tool: bool = False
                                      """Whether the LLM can register importable functions as new tools."""
                                  
                                      register_code_tool: bool = False
                                      """Whether the LLM can create new tools from provided Python code."""
                                  
                                      chain_tools: bool = False
                                      """Whether the LLM gains capability to chain multiple tool calls into one."""
                                  

                                  chain_tools class-attribute instance-attribute

                                  chain_tools: bool = False
                                  

                                  Whether the LLM gains capability to chain multiple tool calls into one.

                                  get_resources class-attribute instance-attribute

                                  get_resources: bool = False
                                  

                                  Whether the LLM can discover available resources.

                                  install_package class-attribute instance-attribute

                                  install_package: bool = False
                                  

                                  Whether the LLM can install new Python packages for future tools.

                                  load_resource class-attribute instance-attribute

                                  load_resource: bool = False
                                  

                                  Whether the LLM can load and access resource content.

                                  register_code_tool class-attribute instance-attribute

                                  register_code_tool: bool = False
                                  

                                  Whether the LLM can create new tools from provided Python code.

                                  register_tool class-attribute instance-attribute

                                  register_tool: bool = False
                                  

                                  Whether the LLM can register importable functions as new tools.

                                  OpenAPIToolsetConfig

                                  Bases: BaseToolsetConfig

                                  Configuration for OpenAPI toolsets.

                                  Source code in src/llmling/config/models.py
                                  class OpenAPIToolsetConfig(BaseToolsetConfig):
                                      """Configuration for OpenAPI toolsets."""
                                  
                                      type: Literal["openapi"] = Field("openapi", init=False)
                                      """Discriminator field identifying this as an OpenAPI toolset."""
                                  
                                      spec: str = Field(...)
                                      """URL or path to the OpenAPI specification document."""
                                  
                                      base_url: str | None = Field(default=None)
                                      """Optional base URL for API requests, overrides the one in spec."""
                                  

                                  base_url class-attribute instance-attribute

                                  base_url: str | None = Field(default=None)
                                  

                                  Optional base URL for API requests, overrides the one in spec.

                                  spec class-attribute instance-attribute

                                  spec: str = Field(...)
                                  

                                  URL or path to the OpenAPI specification document.

                                  type class-attribute instance-attribute

                                  type: Literal['openapi'] = Field('openapi', init=False)
                                  

                                  Discriminator field identifying this as an OpenAPI toolset.

                                  PathResource

                                  Bases: BaseResource

                                  Resource loaded from a file or URL.

                                  Source code in src/llmling/config/models.py
                                  class PathResource(BaseResource):
                                      """Resource loaded from a file or URL."""
                                  
                                      type: Literal["path"] = Field(default="path", init=False)
                                      """Discriminator field identifying this as a path-based resource."""
                                  
                                      path: str | os.PathLike[str]
                                      """Path to the file or URL to load."""
                                  
                                      watch: WatchConfig | None = None
                                      """Configuration for watching the file for changes."""
                                  
                                      def validate_resource(self) -> list[str]:
                                          """Check if path exists for local files."""
                                          from upathtools import to_upath
                                  
                                          path = to_upath(self.path)
                                          prefixes = ("http://", "https://")
                                          return [
                                              f"Resource path not found: {path}"
                                              for path in [path]
                                              if not path.exists() and not path.as_uri().startswith(prefixes)
                                          ]
                                  
                                      @property
                                      def supports_watching(self) -> bool:
                                          """Whether this resource instance supports watching."""
                                          from upathtools import to_upath
                                  
                                          path = to_upath(self.path)
                                          if not path.exists():
                                              msg = f"Cannot watch non-existent path: {self.path}"
                                              warnings.warn(msg, UserWarning, stacklevel=2)
                                              return False
                                          return True
                                  
                                      def get_watch_path(self) -> str | None:
                                          """Get the path to watch."""
                                          return str(self.path) if self.supports_watching else None
                                  
                                      @model_validator(mode="after")
                                      def validate_path(self) -> PathResource:
                                          """Validate that the path is not empty."""
                                          if not self.path:
                                              msg = "Path cannot be empty"
                                              raise ValueError(msg)
                                          return self
                                  
                                      def is_templated(self) -> bool:
                                          """Path resources are templated if they contain placeholders."""
                                          return "{" in str(self.path)
                                  
                                      @property
                                      def mime_type(self) -> str:
                                          """Get MIME type based on file extension."""
                                          return guess_mime_type(self.path)
                                  

                                  mime_type property

                                  mime_type: str
                                  

                                  Get MIME type based on file extension.

                                  path instance-attribute

                                  path: str | PathLike[str]
                                  

                                  Path to the file or URL to load.

                                  supports_watching property

                                  supports_watching: bool
                                  

                                  Whether this resource instance supports watching.

                                  type class-attribute instance-attribute

                                  type: Literal['path'] = Field(default='path', init=False)
                                  

                                  Discriminator field identifying this as a path-based resource.

                                  watch class-attribute instance-attribute

                                  watch: WatchConfig | None = None
                                  

                                  Configuration for watching the file for changes.

                                  get_watch_path

                                  get_watch_path() -> str | None
                                  

                                  Get the path to watch.

                                  Source code in src/llmling/config/models.py
                                  def get_watch_path(self) -> str | None:
                                      """Get the path to watch."""
                                      return str(self.path) if self.supports_watching else None
                                  

                                  is_templated

                                  is_templated() -> bool
                                  

                                  Path resources are templated if they contain placeholders.

                                  Source code in src/llmling/config/models.py
                                  def is_templated(self) -> bool:
                                      """Path resources are templated if they contain placeholders."""
                                      return "{" in str(self.path)
                                  

                                  validate_path

                                  validate_path() -> PathResource
                                  

                                  Validate that the path is not empty.

                                  Source code in src/llmling/config/models.py
                                  @model_validator(mode="after")
                                  def validate_path(self) -> PathResource:
                                      """Validate that the path is not empty."""
                                      if not self.path:
                                          msg = "Path cannot be empty"
                                          raise ValueError(msg)
                                      return self
                                  

                                  validate_resource

                                  validate_resource() -> list[str]
                                  

                                  Check if path exists for local files.

                                  Source code in src/llmling/config/models.py
                                  def validate_resource(self) -> list[str]:
                                      """Check if path exists for local files."""
                                      from upathtools import to_upath
                                  
                                      path = to_upath(self.path)
                                      prefixes = ("http://", "https://")
                                      return [
                                          f"Resource path not found: {path}"
                                          for path in [path]
                                          if not path.exists() and not path.as_uri().startswith(prefixes)
                                      ]
                                  

                                  RepositoryResource

                                  Bases: BaseResource

                                  Git repository content.

                                  Source code in src/llmling/config/models.py
                                  class RepositoryResource(BaseResource):
                                      """Git repository content."""
                                  
                                      type: Literal["repository"] = Field("repository", init=False)
                                      repo_url: str
                                      """URL of the git repository."""
                                  
                                      ref: str = "main"
                                      """Git reference (branch, tag, or commit)."""
                                  
                                      path: str = ""
                                      """Path within the repository."""
                                  
                                      sparse_checkout: list[str] | None = None
                                      """Optional list of paths for sparse checkout."""
                                  
                                      user: str | None = None
                                      """Optional user name for authentication."""
                                  
                                      password: SecretStr | None = None
                                      """Optional password for authentication."""
                                  
                                      def validate_resource(self) -> list[str]:
                                          return [
                                              f"Repository {self.repo_url} has user but no password"
                                              for _ in [None]
                                              if self.user and not self.password
                                          ]
                                  

                                  password class-attribute instance-attribute

                                  password: SecretStr | None = None
                                  

                                  Optional password for authentication.

                                  path class-attribute instance-attribute

                                  path: str = ''
                                  

                                  Path within the repository.

                                  ref class-attribute instance-attribute

                                  ref: str = 'main'
                                  

                                  Git reference (branch, tag, or commit).

                                  repo_url instance-attribute

                                  repo_url: str
                                  

                                  URL of the git repository.

                                  sparse_checkout class-attribute instance-attribute

                                  sparse_checkout: list[str] | None = None
                                  

                                  Optional list of paths for sparse checkout.

                                  user class-attribute instance-attribute

                                  user: str | None = None
                                  

                                  Optional user name for authentication.

                                  SourceResource

                                  Bases: BaseResource

                                  Resource from Python source code.

                                  Source code in src/llmling/config/models.py
                                  class SourceResource(BaseResource):
                                      """Resource from Python source code."""
                                  
                                      type: Literal["source"] = Field(default="source", init=False)
                                      """Discriminator field identifying this as a source code resource."""
                                  
                                      import_path: str
                                      """Dotted import path to the Python module or object."""
                                  
                                      recursive: bool = False
                                      """Whether to include submodules recursively."""
                                  
                                      include_tests: bool = False
                                      """Whether to include test files and directories."""
                                  
                                      @model_validator(mode="after")
                                      def validate_import_path(self) -> SourceResource:
                                          """Validate that the import path is properly formatted."""
                                          if not all(part.isidentifier() for part in self.import_path.split(".")):
                                              msg = f"Invalid import path: {self.import_path}"
                                              raise ValueError(msg)
                                          return self
                                  

                                  import_path instance-attribute

                                  import_path: str
                                  

                                  Dotted import path to the Python module or object.

                                  include_tests class-attribute instance-attribute

                                  include_tests: bool = False
                                  

                                  Whether to include test files and directories.

                                  recursive class-attribute instance-attribute

                                  recursive: bool = False
                                  

                                  Whether to include submodules recursively.

                                  type class-attribute instance-attribute

                                  type: Literal['source'] = Field(default='source', init=False)
                                  

                                  Discriminator field identifying this as a source code resource.

                                  validate_import_path

                                  validate_import_path() -> SourceResource
                                  

                                  Validate that the import path is properly formatted.

                                  Source code in src/llmling/config/models.py
                                  @model_validator(mode="after")
                                  def validate_import_path(self) -> SourceResource:
                                      """Validate that the import path is properly formatted."""
                                      if not all(part.isidentifier() for part in self.import_path.split(".")):
                                          msg = f"Invalid import path: {self.import_path}"
                                          raise ValueError(msg)
                                      return self
                                  

                                  TextResource

                                  Bases: BaseResource

                                  Raw text resource.

                                  Source code in src/llmling/config/models.py
                                  class TextResource(BaseResource):
                                      """Raw text resource."""
                                  
                                      type: Literal["text"] = Field(default="text", init=False)
                                      """Discriminator field identifying this as a text-based resource."""
                                  
                                      content: str
                                      """The actual text content of the resource."""
                                  
                                      _mime_type: str | None = None  # Optional override
                                  
                                      @model_validator(mode="after")
                                      def validate_content(self) -> TextResource:
                                          """Validate that the content is not empty."""
                                          if not self.content:
                                              msg = "Content cannot be empty"
                                              raise ValueError(msg)
                                          return self
                                  
                                      @property
                                      def mime_type(self) -> str:
                                          """Get MIME type, trying to detect JSON/YAML."""
                                          if self._mime_type:
                                              return self._mime_type
                                          # Could add content inspection here
                                          return "text/plain"
                                  

                                  content instance-attribute

                                  content: str
                                  

                                  The actual text content of the resource.

                                  mime_type property

                                  mime_type: str
                                  

                                  Get MIME type, trying to detect JSON/YAML.

                                  type class-attribute instance-attribute

                                  type: Literal['text'] = Field(default='text', init=False)
                                  

                                  Discriminator field identifying this as a text-based resource.

                                  validate_content

                                  validate_content() -> TextResource
                                  

                                  Validate that the content is not empty.

                                  Source code in src/llmling/config/models.py
                                  @model_validator(mode="after")
                                  def validate_content(self) -> TextResource:
                                      """Validate that the content is not empty."""
                                      if not self.content:
                                          msg = "Content cannot be empty"
                                          raise ValueError(msg)
                                      return self
                                  

                                  ToolConfig

                                  Bases: ConfigModel

                                  Configuration for a tool.

                                  Source code in src/llmling/config/models.py
                                  class ToolConfig(ConfigModel):
                                      """Configuration for a tool."""
                                  
                                      import_path: str
                                      """Import path to the tool implementation (e.g. 'mymodule.tools.MyTool')"""
                                  
                                      name: str | None = None
                                      """Optional override for the tool's display name"""
                                  
                                      description: str | None = None
                                      """Optional override for the tool's description"""
                                  
                                      hints: ToolHints = ToolHints()
                                      """Hints about the tool's behavior and execution characteristics"""
                                  

                                  description class-attribute instance-attribute

                                  description: str | None = None
                                  

                                  Optional override for the tool's description

                                  hints class-attribute instance-attribute

                                  hints: ToolHints = ToolHints()
                                  

                                  Hints about the tool's behavior and execution characteristics

                                  import_path instance-attribute

                                  import_path: str
                                  

                                  Import path to the tool implementation (e.g. 'mymodule.tools.MyTool')

                                  name class-attribute instance-attribute

                                  name: str | None = None
                                  

                                  Optional override for the tool's display name

                                  ToolHints

                                  Bases: ConfigModel

                                  Configuration for tool execution hints.

                                  Source code in src/llmling/config/models.py
                                  class ToolHints(ConfigModel):
                                      """Configuration for tool execution hints."""
                                  
                                      read_only: bool | None = None
                                      """Hints that this tool only reads data without modifying anything"""
                                  
                                      destructive: bool | None = None
                                      """Hints that this tool performs destructive operations that cannot be undone"""
                                  
                                      idempotent: bool | None = None
                                      """Hints that this tool has idempotent behaviour"""
                                  
                                      open_world: bool | None = None
                                      """Hints that this tool can access / interact with external resources beyond the
                                      current system"""
                                  

                                  destructive class-attribute instance-attribute

                                  destructive: bool | None = None
                                  

                                  Hints that this tool performs destructive operations that cannot be undone

                                  idempotent class-attribute instance-attribute

                                  idempotent: bool | None = None
                                  

                                  Hints that this tool has idempotent behaviour

                                  open_world class-attribute instance-attribute

                                  open_world: bool | None = None
                                  

                                  Hints that this tool can access / interact with external resources beyond the current system

                                  read_only class-attribute instance-attribute

                                  read_only: bool | None = None
                                  

                                  Hints that this tool only reads data without modifying anything

                                  WatchConfig

                                  Bases: ConfigModel

                                  Watch configuration for resources.

                                  Source code in src/llmling/config/models.py
                                  class WatchConfig(ConfigModel):
                                      """Watch configuration for resources."""
                                  
                                      enabled: bool = False
                                      """Whether the watch is enabled"""
                                  
                                      patterns: list[str] | None = None
                                      """List of pathspec patterns (.gitignore style)"""
                                  
                                      ignore_file: str | None = None
                                      """Path to .gitignore-style file"""
                                  

                                  enabled class-attribute instance-attribute

                                  enabled: bool = False
                                  

                                  Whether the watch is enabled

                                  ignore_file class-attribute instance-attribute

                                  ignore_file: str | None = None
                                  

                                  Path to .gitignore-style file

                                  patterns class-attribute instance-attribute

                                  patterns: list[str] | None = None
                                  

                                  List of pathspec patterns (.gitignore style)