:py:mod:`gmuse.prompts` ======================= .. py:module:: gmuse.prompts .. autodoc2-docstring:: gmuse.prompts :allowtitles: Module Contents --------------- Functions ~~~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`get_freeform_task ` - .. autodoc2-docstring:: gmuse.prompts.get_freeform_task :summary: * - :py:obj:`get_conventional_task ` - .. autodoc2-docstring:: gmuse.prompts.get_conventional_task :summary: * - :py:obj:`get_gitmoji_task ` - .. autodoc2-docstring:: gmuse.prompts.get_gitmoji_task :summary: * - :py:obj:`build_context ` - .. autodoc2-docstring:: gmuse.prompts.build_context :summary: * - :py:obj:`build_prompt ` - .. autodoc2-docstring:: gmuse.prompts.build_prompt :summary: * - :py:obj:`validate_message ` - .. autodoc2-docstring:: gmuse.prompts.validate_message :summary: * - :py:obj:`estimate_tokens ` - .. autodoc2-docstring:: gmuse.prompts.estimate_tokens :summary: Data ~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`logger ` - .. autodoc2-docstring:: gmuse.prompts.logger :summary: * - :py:obj:`PROMPT_VERSION ` - .. autodoc2-docstring:: gmuse.prompts.PROMPT_VERSION :summary: * - :py:obj:`SYSTEM_PROMPT ` - .. autodoc2-docstring:: gmuse.prompts.SYSTEM_PROMPT :summary: * - :py:obj:`MAX_MESSAGE_LENGTH ` - .. autodoc2-docstring:: gmuse.prompts.MAX_MESSAGE_LENGTH :summary: * - :py:obj:`_CHARS_PER_TOKEN ` - .. autodoc2-docstring:: gmuse.prompts._CHARS_PER_TOKEN :summary: API ~~~ .. py:data:: logger :canonical: gmuse.prompts.logger :value: 'get_logger(...)' .. autodoc2-docstring:: gmuse.prompts.logger .. py:data:: PROMPT_VERSION :canonical: gmuse.prompts.PROMPT_VERSION :type: typing.Final[str] :value: '1.0.0' .. autodoc2-docstring:: gmuse.prompts.PROMPT_VERSION .. py:data:: SYSTEM_PROMPT :canonical: gmuse.prompts.SYSTEM_PROMPT :type: typing.Final[str] :value: .. autodoc2-docstring:: gmuse.prompts.SYSTEM_PROMPT .. py:data:: MAX_MESSAGE_LENGTH :canonical: gmuse.prompts.MAX_MESSAGE_LENGTH :type: typing.Final[int] :value: 1000 .. autodoc2-docstring:: gmuse.prompts.MAX_MESSAGE_LENGTH .. py:function:: get_freeform_task() -> str :canonical: gmuse.prompts.get_freeform_task .. autodoc2-docstring:: gmuse.prompts.get_freeform_task .. py:function:: get_conventional_task(max_chars: int | None = None) -> str :canonical: gmuse.prompts.get_conventional_task .. autodoc2-docstring:: gmuse.prompts.get_conventional_task .. py:function:: get_gitmoji_task() -> str :canonical: gmuse.prompts.get_gitmoji_task .. autodoc2-docstring:: gmuse.prompts.get_gitmoji_task .. py:function:: build_context(diff: gmuse.git.StagedDiff, commit_history: typing.Optional[gmuse.git.CommitHistory] = None, repo_instructions: typing.Optional[gmuse.git.RepositoryInstructions] = None, branch_info: typing.Optional[gmuse.git.BranchInfo] = None, user_hint: typing.Optional[str] = None, learning_examples: typing.Optional[typing.List[typing.Tuple[str, str]]] = None) -> str :canonical: gmuse.prompts.build_context .. autodoc2-docstring:: gmuse.prompts.build_context .. py:function:: build_prompt(diff: gmuse.git.StagedDiff, format: str = 'freeform', commit_history: typing.Optional[gmuse.git.CommitHistory] = None, repo_instructions: typing.Optional[gmuse.git.RepositoryInstructions] = None, branch_info: typing.Optional[gmuse.git.BranchInfo] = None, user_hint: typing.Optional[str] = None, learning_examples: typing.Optional[typing.List[typing.Tuple[str, str]]] = None, max_chars: typing.Optional[int] = None) -> typing.Tuple[str, str] :canonical: gmuse.prompts.build_prompt .. autodoc2-docstring:: gmuse.prompts.build_prompt .. py:function:: validate_message(message: str, format: str = 'freeform', max_length: int = MAX_MESSAGE_LENGTH) -> None :canonical: gmuse.prompts.validate_message .. autodoc2-docstring:: gmuse.prompts.validate_message .. py:data:: _CHARS_PER_TOKEN :canonical: gmuse.prompts._CHARS_PER_TOKEN :type: typing.Final[int] :value: 4 .. autodoc2-docstring:: gmuse.prompts._CHARS_PER_TOKEN .. py:function:: estimate_tokens(text: str, chars_per_token: int = _CHARS_PER_TOKEN) -> int :canonical: gmuse.prompts.estimate_tokens .. autodoc2-docstring:: gmuse.prompts.estimate_tokens