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

Function get_sys_gen_message

src/request/prompt.rs:119–133  ·  view source on GitHub ↗

get the message of the system role for generative tasks.

(ctx: String)

Source from the content-addressed store, hash-verified

117
118/// get the message of the system role for generative tasks.
119pub fn get_sys_gen_message(ctx: String) -> String {
120 let deopt = Deopt::new(get_library_name()).unwrap();
121 let mut template = config::SYSTEM_GEN_TEMPLATE.to_string();
122 let mut ctx_template = config::SYSTEM_CONTEXT_TEMPLATE.replace("{project}", &get_library_name());
123 if let Some(desc) = deopt.config.desc {
124 ctx_template.insert_str(0, &desc);
125 }
126 let ctx_template = ctx_template.replace("{headers}", &get_include_sys_headers_str());
127 let ctx_template = ctx_template.replace("{APIs}", &dump_func_gadgets_tostr());
128 let ctx_template = ctx_template.replace("{context}", &ctx);
129 template.push_str("\n\n");
130 template.push_str(&ctx_template);
131
132 template
133}
134
135/// get the type definitions in args of the apis of the combination.
136fn get_combination_definitions(combination: &Vec<&FuncGadget>) -> String {

Callers 1

to_chatgpt_messageMethod · 0.85

Calls 3

get_library_nameFunction · 0.85
dump_func_gadgets_tostrFunction · 0.85

Tested by

no test coverage detected