You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let system_message = "You are an AI code assistant trained on the GPT-4 architecture. Your task is to generate Rust function body implementations based only on the provided function signatures. When the user provides a function signature using the command '/complete', your response must be the plain text function body, without any explanations, formatting, or code blocks. Do not include the function signature, function name, or any other information in your response. Triple backticks (```) and function signatures are strictly prohibited in your response. Responding with any prohibited content will result in a penalty.
9
+
example 1:
10
+
INPUT: /complete fn my_ip() -> String
11
+
OUTPUT:
12
+
use std::net::UdpSocket;
13
+
14
+
let udp_socket = UdpSocket::bind(\"0.0.0.0:0\").unwrap();
15
+
udp_socket.connect(\"8.8.8.8:80\").unwrap();
16
+
let socket_addr = udp_socket.local_addr().unwrap();
// let resp = reqwest::blocking::get("https://httpbin.org/ip")
17
-
// .unwrap()
18
-
// .json::<HashMap<String, String>>()
19
-
// .unwrap();
20
-
21
-
// let ip = resp.get("origin").unwrap().to_owned();
22
-
23
-
let system_message = "You are an AI code assistant trained on the GPT-4 architecture. Your task is to generate Rust function body implementations based only on the provided function signatures. When the user provides a function signature using the command '/complete', your response must be the plain text function body, without any explanations, formatting, or code blocks. Do not include the function signature, function name, or any other information in your response. Triple backticks (```) and function signatures are strictly prohibited in your response. Responding with any prohibited content will result in a penalty.
24
-
example 1:
25
-
INPUT: /complete fn my_ip() -> String
26
-
OUTPUT: use std::net::UdpSocket;
27
-
28
-
let udp_socket = UdpSocket::bind(\"0.0.0.0:0\").unwrap();
29
-
udp_socket.connect(\"8.8.8.8:80\").unwrap();
30
-
let socket_addr = udp_socket.local_addr().unwrap();
31
-
let ip_addr = socket_addr.ip();
32
-
ip_addr.to_string()
33
-
34
-
example 2:
35
-
INPUT: /complete fn hello_world() -> String
36
-
OUTPUT: \"Hello World\".to_string()
37
-
".to_string();
38
-
let implemented_fn = generate_body_function_from_head(system_message, _item).unwrap();
18
+
19
+
let implemented_fn = generate_body_function_from_head(_item).unwrap();
39
20
40
21
println!("{}", implemented_fn);
41
22
42
-
// let user_message = "/complete fn hello_world() -> String".to_string();
0 commit comments