ConstantsΒ§
- JSON_
BEGIN_ πMARKER - JSON markers for LLM prompt
- JSON_
END_ πMARKER - MAX_
CONTEXT_ UTILIZATION - Maximum percentage of context window to use in a single request
- MAX_
CONTEXT_ WINDOW - Maximum context window size for LLM in tokens
- REQUEST_
TEMPERATURE - Temperature for requests, low for deterministic results
- SYSTEM_
PROMPT π - System prompt for converting course material to markdown
- USER_
PROMPT_ πSTART - User prompt for converting course material to markdown
FunctionsΒ§
- append_
markdown_ with_ separator - Appends markdown content to a result string with proper newline separators
- block_
to_ πjson_ string - Converts a block to JSON string, removing any private_spec fields recursively
- blocks_
to_ πjson_ string - Converts a vector of blocks to JSON string, removing any private_spec fields recursively
- calculate_
safe_ token_ limit - Calculate the safe token limit based on context window and utilization
- convert_
material_ blocks_ to_ markdown_ with_ llm - Cleans content by converting the material blocks to clean markdown using an LLM
- prepare_
llm_ messages - Prepare messages for the LLM request
- process_
block_ πchunk - Process a subset of blocks in a single LLM request
- process_
chunks π - Process all chunks and combine the results
- remove_
private_ πspec_ recursive - Recursively removes all fields named βprivate_specβ from a JSON value
- split_
blocks_ into_ chunks - Split blocks into chunks that fit within token limits
- split_
oversized_ πblock - Splits an oversized block into smaller string chunks