MCPcopy Create free account
hub / github.com/coderaidershaun/rust-auto-gippity-full-code / extend_ai_function

Function extend_ai_function

src/helpers/general.rs:20–37  ·  view source on GitHub ↗

Extend ai function to encourage specific output

(ai_func: fn(&str) -> &'static str, func_input: &str)

Source from the content-addressed store, hash-verified

18
19// Extend ai function to encourage specific output
20pub fn extend_ai_function(ai_func: fn(&str) -> &'static str, func_input: &str) -> Message {
21 let ai_function_str: &str = ai_func(func_input);
22
23 // Extend the string to encourage only printing the output
24 let msg: String = format!(
25 "FUNCTION: {}
26 INSTRUCTION: You are a function printer. You ONLY print the results of functions.
27 Nothing else. No commentary. Here is the input to the function: {}.
28 Print out what the function will return.",
29 ai_function_str, func_input
30 );
31
32 // Return message
33 Message {
34 role: "system".to_string(),
35 content: msg,
36 }
37}
38
39// Performs call to LLM GPT
40pub async fn ai_task_request(

Callers 2

ai_task_requestFunction · 0.85

Calls

no outgoing calls

Tested by 1