return_prompt_wrapper
- cls (Any): The class to convert to.
- func (Callable): The function to decorate.
wrap_prompt_functions
str
with the :obj:return_text_prompt decorator.
Parameters:
- cls (type): The class to decorate.
TextPrompt
TextPrompt class
extends the built-in :obj:str class to provide a property for retrieving
the set of keywords in the prompt.
Parameters:
- key_words (set): A set of strings representing the keywords in the prompt.
key_words
format
str.format method to allow for
default values in the format string. This is used to allow formatting
the partial string.
Returns:
TextPrompt: A new :obj:TextPrompt object with the format string
replaced with the formatted string.
CodePrompt
TextPrompt
class with a :obj:code_type property.
Parameters:
- code_type (str, optional): The type of code. Defaults to None.
new
CodePrompt class.
Returns:
CodePrompt: The created :obj:CodePrompt instance.
code_type
set_code_type
- code_type (str): The type of code.
execute
- interpreter (Optional[BaseInterpreter]): The interpreter instance to use for execution. If
None, a default interpreter is used. (default: :obj:None) **kwargs: Additional keyword arguments passed to the interpreter to run the code.
TextPromptDict
TextPrompt object.