pub struct ToolTextEditor20250728 {
pub name: String,
pub cache_control: Option<CacheControlEphemeral>,
pub max_characters: Option<i32>,
}Expand description
Parameters for the Text Editor tool type, version 20250728.
This tool allows the AI to perform text editing operations via the API.
Fields§
§name: StringName of the tool. This is how the tool will be called by the model and in tool_use blocks.
Always set to “str_replace_based_edit_tool”.
cache_control: Option<CacheControlEphemeral>Create a cache control breakpoint at this content block. If provided, this instructs the API to not cache this tool or its results.
max_characters: Option<i32>Maximum characters to display when viewing a file. If not specified, defaults to showing the full file.
Implementations§
Source§impl ToolTextEditor20250728
impl ToolTextEditor20250728
Sourcepub fn with_ephemeral_cache_control(self) -> Self
pub fn with_ephemeral_cache_control(self) -> Self
Sets the cache control to ephemeral for this tool.
Sourcepub fn with_max_characters(self, max_characters: i32) -> Self
pub fn with_max_characters(self, max_characters: i32) -> Self
Sets the maximum characters to display when viewing a file.
Trait Implementations§
Source§impl Clone for ToolTextEditor20250728
impl Clone for ToolTextEditor20250728
Source§fn clone(&self) -> ToolTextEditor20250728
fn clone(&self) -> ToolTextEditor20250728
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 ToolTextEditor20250728
impl Debug for ToolTextEditor20250728
Source§impl Default for ToolTextEditor20250728
impl Default for ToolTextEditor20250728
Source§impl<'de> Deserialize<'de> for ToolTextEditor20250728
impl<'de> Deserialize<'de> for ToolTextEditor20250728
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>,
Source§impl PartialEq for ToolTextEditor20250728
impl PartialEq for ToolTextEditor20250728
Source§fn eq(&self, other: &ToolTextEditor20250728) -> bool
fn eq(&self, other: &ToolTextEditor20250728) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ToolTextEditor20250728
impl Serialize for ToolTextEditor20250728
impl StructuralPartialEq for ToolTextEditor20250728
Source§impl<A: Agent> Tool<A> for ToolTextEditor20250728
impl<A: Agent> Tool<A> for ToolTextEditor20250728
Source§fn callback(&self) -> Box<dyn ToolCallback<A>>
fn callback(&self) -> Box<dyn ToolCallback<A>>
Return a callback that handles text editor operations.
This uses the same [TextEditorCallback] as other text editor tool versions,
providing consistent functionality across tool versions.
Source§fn to_param(&self) -> ToolUnionParam
fn to_param(&self) -> ToolUnionParam
Convert this tool to the union parameter type for API serialization.