fix(tools): fixed arxiv tools (#1403)

This commit is contained in:
Waleed
2025-09-21 12:05:41 -07:00
committed by GitHub
parent 6b4ebbac6e
commit d83865c635
4 changed files with 5 additions and 7 deletions

View File

@@ -28,7 +28,7 @@ export const getAuthorPapersTool: ToolConfig<
request: {
url: (params: ArxivGetAuthorPapersParams) => {
const baseUrl = 'http://export.arxiv.org/api/query'
const baseUrl = 'https://export.arxiv.org/api/query'
const searchParams = new URLSearchParams()
searchParams.append('search_query', `au:"${params.authorName}"`)

View File

@@ -25,7 +25,7 @@ export const getPaperTool: ToolConfig<ArxivGetPaperParams, ArxivGetPaperResponse
paperId = paperId.split('arxiv.org/abs/')[1]
}
const baseUrl = 'http://export.arxiv.org/api/query'
const baseUrl = 'https://export.arxiv.org/api/query'
const searchParams = new URLSearchParams()
searchParams.append('id_list', paperId)

View File

@@ -44,7 +44,7 @@ export const searchTool: ToolConfig<ArxivSearchParams, ArxivSearchResponse> = {
request: {
url: (params: ArxivSearchParams) => {
const baseUrl = 'http://export.arxiv.org/api/query'
const baseUrl = 'https://export.arxiv.org/api/query'
const searchParams = new URLSearchParams()
// Build search query

View File

@@ -554,11 +554,9 @@ async function handleInternalRequest(
status: response.status,
statusText: response.statusText,
headers: response.headers,
// Provide the resolved URL so tool transforms can safely read response.url
url: fullUrl,
json: async () => responseData,
text: async () =>
typeof responseData === 'string' ? responseData : JSON.stringify(responseData),
json: () => response.json(),
text: () => response.text(),
} as Response
const data = await tool.transformResponse(mockResponse, params)