Merge branch 'main' of github.com:zed-industries/zed into prompt_template
This commit is contained in:
commit
4b8771f3e2
54 changed files with 2457 additions and 1007 deletions
|
@ -3221,7 +3221,7 @@ impl InlineAssistant {
|
|||
}
|
||||
}
|
||||
Some(
|
||||
Svg::new("icons/bolt.svg")
|
||||
Svg::new("icons/update.svg")
|
||||
.with_color(theme.assistant.inline.context_status.in_progress_icon.color)
|
||||
.constrained()
|
||||
.with_width(theme.assistant.inline.context_status.in_progress_icon.width)
|
||||
|
@ -3239,7 +3239,7 @@ impl InlineAssistant {
|
|||
)
|
||||
}
|
||||
SemanticIndexStatus::Indexed {} => Some(
|
||||
Svg::new("icons/circle_check.svg")
|
||||
Svg::new("icons/check.svg")
|
||||
.with_color(theme.assistant.inline.context_status.complete_icon.color)
|
||||
.constrained()
|
||||
.with_width(theme.assistant.inline.context_status.complete_icon.width)
|
||||
|
@ -3247,7 +3247,7 @@ impl InlineAssistant {
|
|||
.with_style(theme.assistant.inline.context_status.complete_icon.container)
|
||||
.with_tooltip::<ContextStatusIcon>(
|
||||
self.id,
|
||||
"Indexing Complete",
|
||||
"Index up to date",
|
||||
None,
|
||||
theme.tooltip.clone(),
|
||||
cx,
|
||||
|
|
|
@ -222,7 +222,7 @@ pub fn generate_content_prompt(
|
|||
}
|
||||
prompts.push("Never make remarks about the output.".to_string());
|
||||
prompts.push("Do not return any text, except the generated code.".to_string());
|
||||
prompts.push("Do not wrap your text in a Markdown block".to_string());
|
||||
prompts.push("Always wrap your code in a Markdown block".to_string());
|
||||
|
||||
let current_messages = [ChatCompletionRequestMessage {
|
||||
role: "user".to_string(),
|
||||
|
@ -235,7 +235,11 @@ pub fn generate_content_prompt(
|
|||
tiktoken_rs::num_tokens_from_messages(model, ¤t_messages)
|
||||
{
|
||||
let max_token_count = tiktoken_rs::model::get_context_size(model);
|
||||
let intermediate_token_count = max_token_count - current_token_count;
|
||||
let intermediate_token_count = if max_token_count > current_token_count {
|
||||
max_token_count - current_token_count
|
||||
} else {
|
||||
0
|
||||
};
|
||||
|
||||
if intermediate_token_count < RESERVED_TOKENS_FOR_GENERATION {
|
||||
0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue