pyfcstm.llm.fcstm

Public API for the packaged FCSTM grammar guide resource.

get_grammar_guide_prompt_for_llm

pyfcstm.llm.fcstm.get_grammar_guide_prompt_for_llm(raise_on_integrity_error: bool = True) str[source]

Return the packaged FCSTM grammar guide prompt.

Parameters:

raise_on_integrity_error (bool, optional) – Whether a missing, malformed, or mismatched checksum should raise instead of returning text with a warning, defaults to True.

Returns:

UTF-8 decoded FCSTM Markdown prompt with LF newlines.

Return type:

str

Raises:
  • FileNotFoundError – If the packaged Markdown resource is missing.

  • UnicodeDecodeError – If a resource is not valid UTF-8.

  • GrammarGuidePromptIntegrityError – If checksum verification fails.

Example:

>>> get_grammar_guide_prompt_for_llm().startswith("# FCSTM")
True

get_grammar_guide_prompt_path_for_llm

pyfcstm.llm.fcstm.get_grammar_guide_prompt_path_for_llm(raise_on_integrity_error: bool = True) str[source]

Return the filesystem path to the packaged FCSTM grammar guide prompt.

Parameters:

raise_on_integrity_error (bool, optional) – Whether checksum failures raise, defaults to True.

Returns:

Filesystem path to fcstm_grammar_guide.md.

Return type:

str

Raises:

Example:

>>> get_grammar_guide_prompt_path_for_llm().endswith("fcstm_grammar_guide.md")
True

get_grammar_guide_prompt_metadata_for_llm

pyfcstm.llm.fcstm.get_grammar_guide_prompt_metadata_for_llm(raise_on_integrity_error: bool = True) Dict[str, str | int][source]

Return deterministic metadata for the packaged FCSTM grammar guide.

Parameters:

raise_on_integrity_error (bool, optional) – Whether checksum failures raise, defaults to True.

Returns:

Resource metadata for experiment snapshots.

Return type:

Dict[str, Union[str, int]]

Raises:
  • FileNotFoundError – If the packaged Markdown resource is missing.

  • UnicodeDecodeError – If a resource is not valid UTF-8.

  • GrammarGuidePromptIntegrityError – If checksum verification fails.

Example:

>>> get_grammar_guide_prompt_metadata_for_llm()["resource_name"]
'fcstm_grammar_guide.md'