diff --git a/apps/sim/tools/google_books/types.ts b/apps/sim/tools/google_books/types.ts index 3484d576a..363038de5 100644 --- a/apps/sim/tools/google_books/types.ts +++ b/apps/sim/tools/google_books/types.ts @@ -1,7 +1,7 @@ import type { ToolResponse } from '@/tools/types' /** - * Raw volume item from Google Books API response + * Raw volume item from Google Books API search response */ export interface GoogleBooksVolumeItem { id: string @@ -30,6 +30,36 @@ export interface GoogleBooksVolumeItem { } } +/** + * Raw volume response from Google Books API details endpoint + */ +export interface GoogleBooksVolumeResponse { + id: string + volumeInfo: { + title?: string + subtitle?: string + authors?: string[] + publisher?: string + publishedDate?: string + description?: string + pageCount?: number + categories?: string[] + averageRating?: number + ratingsCount?: number + language?: string + previewLink?: string + infoLink?: string + imageLinks?: { + thumbnail?: string + smallThumbnail?: string + } + industryIdentifiers?: Array<{ + type: string + identifier: string + }> + } +} + /** * Volume information structure shared between search and details responses */ diff --git a/apps/sim/tools/google_books/volume_details.ts b/apps/sim/tools/google_books/volume_details.ts index f50e23986..23fe7cd4a 100644 --- a/apps/sim/tools/google_books/volume_details.ts +++ b/apps/sim/tools/google_books/volume_details.ts @@ -1,36 +1,10 @@ import type { GoogleBooksVolumeDetailsParams, GoogleBooksVolumeDetailsResponse, + GoogleBooksVolumeResponse, } from '@/tools/google_books/types' import type { ToolConfig } from '@/tools/types' -interface GoogleBooksVolumeResponse { - id: string - volumeInfo: { - title?: string - subtitle?: string - authors?: string[] - publisher?: string - publishedDate?: string - description?: string - pageCount?: number - categories?: string[] - averageRating?: number - ratingsCount?: number - language?: string - previewLink?: string - infoLink?: string - imageLinks?: { - thumbnail?: string - smallThumbnail?: string - } - industryIdentifiers?: Array<{ - type: string - identifier: string - }> - } -} - export const googleBooksVolumeDetailsTool: ToolConfig< GoogleBooksVolumeDetailsParams, GoogleBooksVolumeDetailsResponse