mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
dd local_image_content_items
This commit is contained in:
@@ -13,7 +13,7 @@ use crate::tools::registry::ToolHandler;
|
||||
use crate::tools::registry::ToolKind;
|
||||
use codex_protocol::models::ContentItem;
|
||||
use codex_protocol::models::ResponseInputItem;
|
||||
use codex_protocol::models::local_image_content_items;
|
||||
use codex_protocol::models::local_image_content_items_with_label_number;
|
||||
|
||||
pub struct ViewImageHandler;
|
||||
|
||||
@@ -65,7 +65,8 @@ impl ToolHandler for ViewImageHandler {
|
||||
}
|
||||
let event_path = abs_path.clone();
|
||||
|
||||
let content: Vec<ContentItem> = local_image_content_items(&abs_path, false);
|
||||
let content: Vec<ContentItem> =
|
||||
local_image_content_items_with_label_number(&abs_path, false, 1);
|
||||
let input = ResponseInputItem::Message {
|
||||
role: "user".to_string(),
|
||||
content,
|
||||
|
||||
@@ -227,11 +227,7 @@ fn unsupported_image_error_placeholder(path: &std::path::Path, mime: &str) -> Co
|
||||
}
|
||||
}
|
||||
|
||||
pub fn local_image_content_items(path: &std::path::Path, include_label: bool) -> Vec<ContentItem> {
|
||||
local_image_content_items_with_label_number(path, include_label, 1)
|
||||
}
|
||||
|
||||
fn local_image_content_items_with_label_number(
|
||||
pub fn local_image_content_items_with_label_number(
|
||||
path: &std::path::Path,
|
||||
include_label: bool,
|
||||
label_number: usize,
|
||||
|
||||
Reference in New Issue
Block a user