chore: suggest using text/markdown when fetching content (#5854)
This commit is contained in:
@@ -492,13 +492,19 @@ impl ComputerControllerServer {
|
|||||||
let save_as = params.save_as;
|
let save_as = params.save_as;
|
||||||
|
|
||||||
// Fetch the content
|
// Fetch the content
|
||||||
let response = self.http_client.get(url).send().await.map_err(|e| {
|
let response = self
|
||||||
ErrorData::new(
|
.http_client
|
||||||
ErrorCode::INTERNAL_ERROR,
|
.get(url)
|
||||||
format!("Failed to fetch URL: {}", e),
|
.header("Accept", "text/markdown, */*")
|
||||||
None,
|
.send()
|
||||||
)
|
.await
|
||||||
})?;
|
.map_err(|e| {
|
||||||
|
ErrorData::new(
|
||||||
|
ErrorCode::INTERNAL_ERROR,
|
||||||
|
format!("Failed to fetch URL: {}", e),
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
|
||||||
let status = response.status();
|
let status = response.status();
|
||||||
if !status.is_success() {
|
if !status.is_success() {
|
||||||
|
|||||||
@@ -325,6 +325,8 @@ impl ServerHandler for DeveloperServer {
|
|||||||
**Important**: Each shell command runs in its own process. Things like directory changes or
|
**Important**: Each shell command runs in its own process. Things like directory changes or
|
||||||
sourcing files do not persist between tool calls. So you may need to repeat them each time by
|
sourcing files do not persist between tool calls. So you may need to repeat them each time by
|
||||||
stringing together commands.
|
stringing together commands.
|
||||||
|
|
||||||
|
If fetching web content, consider adding Accept: text/markdown header
|
||||||
"#};
|
"#};
|
||||||
|
|
||||||
let windows_specific = indoc! {r#"
|
let windows_specific = indoc! {r#"
|
||||||
|
|||||||
Reference in New Issue
Block a user