CFXSchemaCache#
- class ansys.cfx.mcp.cfx.schema_cache.CFXSchemaCache(config_files: Iterable[str] | None = None)#
In-memory index of the CFX API tree for code generation grounding.
Overview#
Get schema metadata for a CFX API path. |
|
Return whether a normalized CFX path exists in the schema cache. |
|
Return whether the schema declares an explicit value set for |
|
Get the schema-declared allowed values for |
|
Get the argument schema for a CFX |
|
Return child schema paths directly under a CFX parent path. |
|
Suggest close schema paths for an unknown CFX path. |
Return the number of schema paths currently stored in the cache. |
Import detail#
from ansys.cfx.mcp.cfx.schema_cache import CFXSchemaCache
Method detail#
- CFXSchemaCache.__len__() int#
Return the number of schema paths currently stored in the cache.
- Returns:
intNumber of schema entries stored in the cache.
- CFXSchemaCache.get(path: str) SchemaNode | None#
Get schema metadata for a CFX API path.
- CFXSchemaCache.exists(path: str) bool#
Return whether a normalized CFX path exists in the schema cache.
- CFXSchemaCache.has_allowed_values(path: str) bool#
Return whether the schema declares an explicit value set for
path.Truewhen the bundled configuration files attach anenum-style allowed-value list to the path or to itscfx_type(such asUIMode).Falsefor free-form primitives (integer/real/string/boolean) and for paths that the schema does not know.
- CFXSchemaCache.get_allowed_values(path: str) tuple[Any, Ellipsis] | None#
Get the schema-declared allowed values for
path.Returns
Nonewhen no enumeration is known. Callers should prefer the live-state probe (Backend.get_allowed_values) and use this as a fallback for offline/disconnected workflows.
- CFXSchemaCache.get_command_arguments(path: str) tuple[CommandArgument, Ellipsis]#
Get the argument schema for a CFX
Command/Querypath.Returns an empty tuple for non-command paths or for paths not present in the cache.
- CFXSchemaCache.children(path: str) list[str]#
Return child schema paths directly under a CFX parent path.