Skip to content

Commit

Permalink
Rename 'ans' to 'none', minor tweaks (#661)
Browse files Browse the repository at this point in the history
* Rename 'ans' to 'none', minor tweaks

* Updated function instruction, better results
  • Loading branch information
stunningpixels authored Jun 19, 2023
1 parent 3d2f171 commit cf8732b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
8 changes: 4 additions & 4 deletions server/bleep/src/webserver/answer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,12 @@ impl Conversation {
Action::Query(query) => {
self.llm_history
.push_back(llm_gateway::api::Message::user(&format!(
"{query}\nRespond with a function:"
"{query}\nDo not answer."
)))
}
_ => {
let function_name = match &action {
Action::Answer { .. } => "ans",
Action::Answer { .. } => "none",
Action::Path { .. } => "path",
Action::Code { .. } => "code",
Action::Proc { .. } => "proc",
Expand All @@ -499,7 +499,7 @@ impl Conversation {
self.llm_history
.push_back(llm_gateway::api::Message::function_return(
function_name,
&format!("{action_result}\nRespond with a function:"),
&format!("{action_result}\nDo not answer."),
));
}
};
Expand Down Expand Up @@ -1308,7 +1308,7 @@ enum Action {
Path {
query: String,
},
#[serde(rename = "ans")]
#[serde(rename = "none")]
Answer {
paths: Vec<usize>,
},
Expand Down
20 changes: 9 additions & 11 deletions server/bleep/src/webserver/answer/prompts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub fn functions() -> serde_json::Value {
}
},
{
"name": "ans",
"name": "none",
"description": "You have enough information to answer the user's query. This is the final step, and signals that you have enough information to respond to the user's query. Use this if the user has intructed you to modify some code.",
"parameters": {
"type": "object",
Expand Down Expand Up @@ -83,20 +83,18 @@ pub fn system(paths: &Vec<String>) -> String {
}

s.push_str(
r#"
Follow these rules at all times:
r#"Follow these rules at all times:
- If the output of a function is empty, try the same function again with different arguments or try using a different function
- In most cases you'll have to use the `code` or `path` functions before using `ans`
- In most cases respond with functions.code or functions.path functions before responding with functions.none
- Do not assume the structure of the codebase, or the existence of files or folders
- Do NOT use a function that you've used before with the same arguments
- When you are confident that you have enough information needed to answer the query use the `ans` function
- If after making a path search the query can be answered by the existance of the paths, and there are more than 5 paths, use the `ans` function
- Do NOT respond with a function that you've used before with the same arguments
- When you have enough information to answer the user's query respond with functions.none
- If after making a path search the query can be answered by the existance of the paths, and there are more than 5 paths, use the functions.none function
- Only refer to path aliases that are under the PATHS heading above
- Use the functions to find information related to the query, until all relevant information has been found.
- If after attempting to gather information you are still unsure how to answer the query, use the `ans` function
- Always answer with a function call. Do NOT answer the question directly
"#);
- Respond with functions to find information related to the query, until all relevant information has been found.
- If after attempting to gather information you are still unsure how to answer the query, respond with the functions.none function
- Always respond with a function call. Do NOT answer the question directly"#);
s
}

Expand Down

0 comments on commit cf8732b

Please sign in to comment.