mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 23:17:59 -05:00
fix(tools): fixed arxiv tools (#1403)
This commit is contained in:
@@ -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}"`)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user