Migrate last response to types

This commit is contained in:
Theodore Li
2026-02-12 15:45:00 -08:00
parent 1130f8ddb2
commit dce47a101c
2 changed files with 32 additions and 28 deletions

View File

@@ -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
*/

View File

@@ -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