feat: replace binary detection with text metadata check
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -97,8 +97,8 @@ impl AsyncItemService {
|
||||
.map(|s| s.to_string())
|
||||
.unwrap_or_else(|| "application/octet-stream".to_string());
|
||||
|
||||
let is_binary = if let Some(binary_val) = metadata.get("binary") {
|
||||
binary_val == "true"
|
||||
let is_binary = if let Some(text_val) = metadata.get("text") {
|
||||
text_val == "false"
|
||||
} else {
|
||||
crate::common::is_binary::is_binary(&content_clone)
|
||||
};
|
||||
@@ -154,8 +154,8 @@ impl AsyncItemService {
|
||||
|
||||
// Check if content is binary when allow_binary is false
|
||||
if !allow_binary {
|
||||
let is_binary = if let Some(binary_val) = metadata.get("binary") {
|
||||
binary_val == "true"
|
||||
let is_binary = if let Some(text_val) = metadata.get("text") {
|
||||
text_val == "false"
|
||||
} else {
|
||||
// Get binary status using streaming approach
|
||||
let (_, _, is_binary) = self.get_item_content_info_streaming(item_id).await?;
|
||||
|
||||
Reference in New Issue
Block a user