fix: Do not append todo instructions when function calling is disabled
This commit is contained in:
@@ -548,7 +548,7 @@ impl RequestContext {
|
|||||||
role
|
role
|
||||||
};
|
};
|
||||||
|
|
||||||
if self.agent.is_none() {
|
if self.agent.is_none() && self.app.config.function_calling_support {
|
||||||
let config = self.auto_continue_config();
|
let config = self.auto_continue_config();
|
||||||
if config.enabled && config.inject_instructions {
|
if config.enabled && config.inject_instructions {
|
||||||
role.append_to_prompt(prompts::DEFAULT_TODO_INSTRUCTIONS);
|
role.append_to_prompt(prompts::DEFAULT_TODO_INSTRUCTIONS);
|
||||||
|
|||||||
+3
-2
@@ -21,6 +21,7 @@ use crate::resolve_oauth_client;
|
|||||||
use anyhow::{Context, Result, bail};
|
use anyhow::{Context, Result, bail};
|
||||||
use crossterm::cursor::SetCursorStyle;
|
use crossterm::cursor::SetCursorStyle;
|
||||||
use fancy_regex::Regex;
|
use fancy_regex::Regex;
|
||||||
|
use indoc::indoc;
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
use reedline::CursorConfig;
|
use reedline::CursorConfig;
|
||||||
use reedline::{
|
use reedline::{
|
||||||
@@ -31,7 +32,6 @@ use reedline::{
|
|||||||
use reedline::{MenuBuilder, Signal};
|
use reedline::{MenuBuilder, Signal};
|
||||||
use std::sync::LazyLock;
|
use std::sync::LazyLock;
|
||||||
use std::{env, process, sync::Arc};
|
use std::{env, process, sync::Arc};
|
||||||
use indoc::indoc;
|
|
||||||
|
|
||||||
const MENU_NAME: &str = "completion_menu";
|
const MENU_NAME: &str = "completion_menu";
|
||||||
|
|
||||||
@@ -1000,7 +1000,8 @@ async fn ask(
|
|||||||
|
|
||||||
fn should_continue(ctx: &RequestContext) -> bool {
|
fn should_continue(ctx: &RequestContext) -> bool {
|
||||||
let config = ctx.auto_continue_config();
|
let config = ctx.auto_continue_config();
|
||||||
config.enabled
|
ctx.app.config.function_calling_support
|
||||||
|
&& config.enabled
|
||||||
&& ctx.auto_continue_count < config.max_continues
|
&& ctx.auto_continue_count < config.max_continues
|
||||||
&& ctx.todo_list.has_incomplete()
|
&& ctx.todo_list.has_incomplete()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user