Skip to content

Commit dce47a1

Browse files
author
Theodore Li
committed
Migrate last response to types
1 parent 1130f8d commit dce47a1

File tree

2 files changed

+32
-28
lines changed

2 files changed

+32
-28
lines changed

apps/sim/tools/google_books/types.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ToolResponse } from '@/tools/types'
22

33
/**
4-
* Raw volume item from Google Books API response
4+
* Raw volume item from Google Books API search response
55
*/
66
export interface GoogleBooksVolumeItem {
77
id: string
@@ -30,6 +30,36 @@ export interface GoogleBooksVolumeItem {
3030
}
3131
}
3232

33+
/**
34+
* Raw volume response from Google Books API details endpoint
35+
*/
36+
export interface GoogleBooksVolumeResponse {
37+
id: string
38+
volumeInfo: {
39+
title?: string
40+
subtitle?: string
41+
authors?: string[]
42+
publisher?: string
43+
publishedDate?: string
44+
description?: string
45+
pageCount?: number
46+
categories?: string[]
47+
averageRating?: number
48+
ratingsCount?: number
49+
language?: string
50+
previewLink?: string
51+
infoLink?: string
52+
imageLinks?: {
53+
thumbnail?: string
54+
smallThumbnail?: string
55+
}
56+
industryIdentifiers?: Array<{
57+
type: string
58+
identifier: string
59+
}>
60+
}
61+
}
62+
3363
/**
3464
* Volume information structure shared between search and details responses
3565
*/

apps/sim/tools/google_books/volume_details.ts

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,10 @@
11
import type {
22
GoogleBooksVolumeDetailsParams,
33
GoogleBooksVolumeDetailsResponse,
4+
GoogleBooksVolumeResponse,
45
} from '@/tools/google_books/types'
56
import type { ToolConfig } from '@/tools/types'
67

7-
interface GoogleBooksVolumeResponse {
8-
id: string
9-
volumeInfo: {
10-
title?: string
11-
subtitle?: string
12-
authors?: string[]
13-
publisher?: string
14-
publishedDate?: string
15-
description?: string
16-
pageCount?: number
17-
categories?: string[]
18-
averageRating?: number
19-
ratingsCount?: number
20-
language?: string
21-
previewLink?: string
22-
infoLink?: string
23-
imageLinks?: {
24-
thumbnail?: string
25-
smallThumbnail?: string
26-
}
27-
industryIdentifiers?: Array<{
28-
type: string
29-
identifier: string
30-
}>
31-
}
32-
}
33-
348
export const googleBooksVolumeDetailsTool: ToolConfig<
359
GoogleBooksVolumeDetailsParams,
3610
GoogleBooksVolumeDetailsResponse

0 commit comments

Comments
 (0)