Spaces:
Sleeping
Sleeping
Update src/main.rs
Browse files- src/main.rs +6 -1
src/main.rs
CHANGED
|
@@ -76,7 +76,7 @@ impl HfFile {
|
|
| 76 |
Ok(CallToolResult::success(vec![Content::json(contents)?]))
|
| 77 |
}
|
| 78 |
|
| 79 |
-
#[tool(description = "
|
| 80 |
async fn get_file_content(
|
| 81 |
&self,
|
| 82 |
#[tool(param)]
|
|
@@ -99,6 +99,11 @@ impl HfFile {
|
|
| 99 |
.unwrap();
|
| 100 |
|
| 101 |
if !response.status().is_success() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
return Err(McpError::internal_error("Failed to get file content", None));
|
| 103 |
}
|
| 104 |
Ok(CallToolResult::success(vec![Content::text(
|
|
|
|
| 76 |
Ok(CallToolResult::success(vec![Content::json(contents)?]))
|
| 77 |
}
|
| 78 |
|
| 79 |
+
#[tool(description = "Get file content in HF Hub")]
|
| 80 |
async fn get_file_content(
|
| 81 |
&self,
|
| 82 |
#[tool(param)]
|
|
|
|
| 99 |
.unwrap();
|
| 100 |
|
| 101 |
if !response.status().is_success() {
|
| 102 |
+
println!("Failed to get file content: {}", response.status());
|
| 103 |
+
println!(
|
| 104 |
+
"Failed to get file content: {}",
|
| 105 |
+
response.text().await.unwrap()
|
| 106 |
+
);
|
| 107 |
return Err(McpError::internal_error("Failed to get file content", None));
|
| 108 |
}
|
| 109 |
Ok(CallToolResult::success(vec![Content::text(
|