Skip to content

Commit d83865c

Browse files
authored
fix(tools): fixed arxiv tools (#1403)
1 parent 6b4ebba commit d83865c

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

apps/sim/tools/arxiv/get_author_papers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const getAuthorPapersTool: ToolConfig<
2828

2929
request: {
3030
url: (params: ArxivGetAuthorPapersParams) => {
31-
const baseUrl = 'http://export.arxiv.org/api/query'
31+
const baseUrl = 'https://export.arxiv.org/api/query'
3232
const searchParams = new URLSearchParams()
3333

3434
searchParams.append('search_query', `au:"${params.authorName}"`)

apps/sim/tools/arxiv/get_paper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const getPaperTool: ToolConfig<ArxivGetPaperParams, ArxivGetPaperResponse
2525
paperId = paperId.split('arxiv.org/abs/')[1]
2626
}
2727

28-
const baseUrl = 'http://export.arxiv.org/api/query'
28+
const baseUrl = 'https://export.arxiv.org/api/query'
2929
const searchParams = new URLSearchParams()
3030
searchParams.append('id_list', paperId)
3131

apps/sim/tools/arxiv/search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const searchTool: ToolConfig<ArxivSearchParams, ArxivSearchResponse> = {
4444

4545
request: {
4646
url: (params: ArxivSearchParams) => {
47-
const baseUrl = 'http://export.arxiv.org/api/query'
47+
const baseUrl = 'https://export.arxiv.org/api/query'
4848
const searchParams = new URLSearchParams()
4949

5050
// Build search query

apps/sim/tools/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,9 @@ async function handleInternalRequest(
554554
status: response.status,
555555
statusText: response.statusText,
556556
headers: response.headers,
557-
// Provide the resolved URL so tool transforms can safely read response.url
558557
url: fullUrl,
559-
json: async () => responseData,
560-
text: async () =>
561-
typeof responseData === 'string' ? responseData : JSON.stringify(responseData),
558+
json: () => response.json(),
559+
text: () => response.text(),
562560
} as Response
563561

564562
const data = await tool.transformResponse(mockResponse, params)

0 commit comments

Comments
 (0)