Skip to content

intel

django_spire.ai.prompt.intel

DandyPromptPythonFileIntel

Bases: BaseIntel

source_code instance-attribute

file_name instance-attribute

to_file

Source code in django_spire/ai/prompt/intel.py
def to_file(self):
    Path(_PROMPT_OUTPUT_PATH).mkdir(parents=True, exist_ok=True)

    with open(Path(_PROMPT_OUTPUT_PATH, self.file_name), 'w') as f:
        f.write(self.source_code)

    print(f'Done ... saved to "{Path(_PROMPT_OUTPUT_PATH, self.file_name)}"')

TextToMarkdownIntel

Bases: BaseIntel

markdown_content instance-attribute

file_name instance-attribute

to_file

Source code in django_spire/ai/prompt/intel.py
def to_file(self):
    Path(_MARKDOWN_OUTPUT_PATH).mkdir(parents=True, exist_ok=True)

    with open(Path(_MARKDOWN_OUTPUT_PATH, self.file_name), 'w') as f:
        f.write(self.markdown_content)

    print(f'Done ... saved to "{Path(_MARKDOWN_OUTPUT_PATH, self.file_name)}"')