Skip to content

prompts

dandy.llm.service.prompts

service_system_prompt

Source code in dandy/llm/service/prompts.py
def service_system_prompt(
        system_prompt: PromptOrStrOrNone = None
) -> Prompt:
    prompt = Prompt()

    if isinstance(system_prompt, Prompt):
        prompt.prompt(system_prompt)

    prompt.line_break()
    prompt.sub_heading('Rules:')
    prompt.list([
        'Do not use any markdown styling in your response.',
    ])

    return prompt

service_system_validation_error_prompt

Source code in dandy/llm/service/prompts.py
def service_system_validation_error_prompt(error: ValidationError) -> Prompt:
    return (
        Prompt()
        .text('The JSON response you provided was not valid.')
        .text('Here is the validation error provided by Pydantic when it tried to parse the JSON object:')
        .text(f'{pydantic_validation_error_to_str(error)}', triple_quote=True)
        .text('Please provide a valid JSON object based on my earlier request.')
    )

service_user_prompt

Source code in dandy/llm/service/prompts.py
def service_user_prompt(user_prompt: Prompt) -> Prompt:
    return (
        Prompt()
        .prompt(user_prompt)
    )