pub struct ToolsConfig {
pub max_output_tokens: usize,
pub output_head_tokens: usize,
}Expand description
Tool-execution behaviour stored under [tools] in newt.toml (#726).
Tool-output knobs: the token budget that caps every tool’s model-facing
output, plus the head/tail split for oversized shell output. This bounds
what a single tool result can add to the context window — applied to both
read_file (its char backstop) and run_command (its shell envelope) — so a
verbose command or a huge file can’t saturate a small local model’s window
and abandon the task. Mirrors Codex’s exec_command.max_output_tokens.
Distinct from [tui] tool_output_lines, which caps the on-screen DISPLAY by
lines.
Fields§
§max_output_tokens: usizeMaximum tokens of model-facing output any single tool may return before
it is truncated (with a marker steering the model to a narrower command /
a paginated read). Default: 10000. 0 disables the cap. Tokens are
estimated with the shared chars/token heuristic (see crate::tokens).
output_head_tokens: usizeTokens reserved for the head of an oversized run_command result. The
remaining budget is spent on the tail, so failures and summaries at the
end survive by default. 0 is pure-tail; values greater than
max_output_tokens are clamped to pure-head.
Trait Implementations§
Source§impl Clone for ToolsConfig
impl Clone for ToolsConfig
Source§fn clone(&self) -> ToolsConfig
fn clone(&self) -> ToolsConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolsConfig
impl Debug for ToolsConfig
Source§impl Default for ToolsConfig
impl Default for ToolsConfig
Source§impl<'de> Deserialize<'de> for ToolsConfigwhere
ToolsConfig: Default,
impl<'de> Deserialize<'de> for ToolsConfigwhere
ToolsConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ToolsConfig
Source§impl PartialEq for ToolsConfig
impl PartialEq for ToolsConfig
Source§impl Serialize for ToolsConfig
impl Serialize for ToolsConfig
impl StructuralPartialEq for ToolsConfig
Auto Trait Implementations§
impl Freeze for ToolsConfig
impl RefUnwindSafe for ToolsConfig
impl Send for ToolsConfig
impl Sync for ToolsConfig
impl Unpin for ToolsConfig
impl UnsafeUnpin for ToolsConfig
impl UnwindSafe for ToolsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more