Skip to main content

handle_tool_call

Function handle_tool_call 

Source
pub async fn handle_tool_call(
    bash_state_arc: &Arc<Mutex<Option<BashState>>>,
    read_image: ReadImage,
) -> Result<(String, String)>
Expand description

Handle the ReadImage tool call

This function processes the ReadImage tool call, which reads an image file and returns its contents as base64-encoded data with the appropriate MIME type.

§Arguments

  • bash_state_arc - Shared reference to the bash state
  • read_image - The read image parameters

§Returns

A Result containing a tuple with the MIME type and base64-encoded image data

§Errors

Returns an error if the image file cannot be accessed or read