kernelfoundry.algorithm.prompts.feedback_llm

Handler for LLM that provides feedback based on console output and documentation.

Classes

DocumentationHandler([doc_path])

Loads and retrieves documentation snippets referenced by keyword tags.

FeedbackHelper(use_feedback_llm, language, ...)

Coordinates prompting an LLM for feedback based on the eval log.

class kernelfoundry.algorithm.prompts.feedback_llm.DocumentationHandler(doc_path: str = 'data/rag/docs/sycl_specification.json')[source]

Loads and retrieves documentation snippets referenced by keyword tags.

__init__(doc_path: str = 'data/rag/docs/sycl_specification.json')[source]

Load json file with list of documentation sections

replace_keywords_by_documentation(text_with_keywords: str)[source]

Take feedback from LLM with keywords and replace keyword part by the documentation

class kernelfoundry.algorithm.prompts.feedback_llm.FeedbackHelper(use_feedback_llm: bool, language: str, server_config, use_docs_via_keywords: bool = False)[source]

Coordinates prompting an LLM for feedback based on the eval log.

__init__(use_feedback_llm: bool, language: str, server_config, use_docs_via_keywords: bool = False)[source]

Initialize feedback behavior and optional documentation enrichment.

load_parent_and_get_feedback(problem_logger: ProblemLogger, parent_program=None)[source]

Call feedback LLM that analyses the console output, or fall back to the console output itself.

get_feedback(generated_kernel: str, console_output: str)[source]

Get feedback from the feedback LLM.

construct_feedback_prompt(generated_kernel, console_output)[source]

Generate a prompt for the feedback LLM to analyze the generated kernel and console output.