Function umm::grade::get_source_context

source ·
pub fn get_source_context<T: Into<LineRef>>(
    line_refs: Vec<T>,
    proj: Project,
    start_offset: usize,
    num_lines: usize,
    max_line_refs: usize,
    try_use_active_retrieval: bool,
    active_retrieval_context: Option<String>
) -> Result<ChatCompletionRequestMessage>
Expand description

Returns a ChatCompletionRequestMessage with the given line references that include contextual lines of code from the source

  • line_refs: a vector of LineRef objects
  • proj: a Project object
  • start_offset: the number of lines of code to include before the line
  • num_lines: the number of lines of code to include after the line
  • max_line_refs: the maximum number of processed line references to include in the final message
  • try_use_active_retrieval: whether to try to use active retrieval
  • additional_context: additional context to use for