MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / get_user_chat_template

Function get_user_chat_template

src/config.rs:310–329  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

308}
309
310pub fn get_user_chat_template() -> String {
311 let library_name = get_library_name();
312 let deopt = Deopt::new(library_name).unwrap();
313 let mut template = get_user_gen_template().to_string();
314 if let Some(landmark) = deopt.get_library_landmark_corpus() {
315 template.insert_str(0, &format!("The input data is: {landmark}\n\n\n."));
316 }
317 if let Some(init) = &deopt.config.spec {
318 template.push_str(&format!("\nThe begining of the fuzz driver is: \n{init}"))
319 }
320 if let Some(disable_fmemopen) = &deopt.config.disable_fmemopen {
321 if *disable_fmemopen {
322 template = template.replace(
323 "fmemopen((void *)data, size, \"rb\")",
324 "fopen(\"input_file\", \"rb\")",
325 );
326 }
327 }
328 template
329}

Callers 1

to_chatgpt_messageMethod · 0.85

Calls 3

get_library_nameFunction · 0.85
get_user_gen_templateFunction · 0.85

Tested by

no test coverage detected