chore: import upstream snapshot with attribution
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,186 @@
|
||||
import type {
|
||||
GoogleBooksVolumeDetailsParams,
|
||||
GoogleBooksVolumeDetailsResponse,
|
||||
GoogleBooksVolumeResponse,
|
||||
} from '@/tools/google_books/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const googleBooksVolumeDetailsTool: ToolConfig<
|
||||
GoogleBooksVolumeDetailsParams,
|
||||
GoogleBooksVolumeDetailsResponse
|
||||
> = {
|
||||
id: 'google_books_volume_details',
|
||||
name: 'Google Books Volume Details',
|
||||
description: 'Get detailed information about a specific book volume',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'Google Books API key',
|
||||
},
|
||||
volumeId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The ID of the volume to retrieve',
|
||||
},
|
||||
projection: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Projection level (full, lite)',
|
||||
},
|
||||
},
|
||||
|
||||
hosting: {
|
||||
envKeyPrefix: 'GOOGLE_CLOUD_API_KEY',
|
||||
apiKeyParam: 'apiKey',
|
||||
byokProviderId: 'google_cloud',
|
||||
pricing: {
|
||||
type: 'per_request',
|
||||
cost: 0,
|
||||
},
|
||||
rateLimit: {
|
||||
mode: 'per_request',
|
||||
requestsPerMinute: 30,
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const url = new URL(`https://www.googleapis.com/books/v1/volumes/${params.volumeId.trim()}`)
|
||||
url.searchParams.set('key', params.apiKey.trim())
|
||||
|
||||
if (params.projection) {
|
||||
url.searchParams.set('projection', params.projection)
|
||||
}
|
||||
|
||||
return url.toString()
|
||||
},
|
||||
method: 'GET',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data: GoogleBooksVolumeResponse = await response.json()
|
||||
|
||||
if (!data.volumeInfo) {
|
||||
throw new Error('Volume not found')
|
||||
}
|
||||
|
||||
const info = data.volumeInfo
|
||||
const identifiers = info.industryIdentifiers ?? []
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
id: data.id,
|
||||
title: info.title ?? '',
|
||||
subtitle: info.subtitle ?? null,
|
||||
authors: info.authors ?? [],
|
||||
publisher: info.publisher ?? null,
|
||||
publishedDate: info.publishedDate ?? null,
|
||||
description: info.description ?? null,
|
||||
pageCount: info.pageCount ?? null,
|
||||
categories: info.categories ?? [],
|
||||
averageRating: info.averageRating ?? null,
|
||||
ratingsCount: info.ratingsCount ?? null,
|
||||
language: info.language ?? null,
|
||||
previewLink: info.previewLink ?? null,
|
||||
infoLink: info.infoLink ?? null,
|
||||
thumbnailUrl: info.imageLinks?.thumbnail ?? info.imageLinks?.smallThumbnail ?? null,
|
||||
isbn10: identifiers.find((id) => id.type === 'ISBN_10')?.identifier ?? null,
|
||||
isbn13: identifiers.find((id) => id.type === 'ISBN_13')?.identifier ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
id: {
|
||||
type: 'string',
|
||||
description: 'Volume ID',
|
||||
},
|
||||
title: {
|
||||
type: 'string',
|
||||
description: 'Book title',
|
||||
},
|
||||
subtitle: {
|
||||
type: 'string',
|
||||
description: 'Book subtitle',
|
||||
optional: true,
|
||||
},
|
||||
authors: {
|
||||
type: 'array',
|
||||
description: 'List of authors',
|
||||
},
|
||||
publisher: {
|
||||
type: 'string',
|
||||
description: 'Publisher name',
|
||||
optional: true,
|
||||
},
|
||||
publishedDate: {
|
||||
type: 'string',
|
||||
description: 'Publication date',
|
||||
optional: true,
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Book description',
|
||||
optional: true,
|
||||
},
|
||||
pageCount: {
|
||||
type: 'number',
|
||||
description: 'Number of pages',
|
||||
optional: true,
|
||||
},
|
||||
categories: {
|
||||
type: 'array',
|
||||
description: 'Book categories',
|
||||
},
|
||||
averageRating: {
|
||||
type: 'number',
|
||||
description: 'Average rating (1-5)',
|
||||
optional: true,
|
||||
},
|
||||
ratingsCount: {
|
||||
type: 'number',
|
||||
description: 'Number of ratings',
|
||||
optional: true,
|
||||
},
|
||||
language: {
|
||||
type: 'string',
|
||||
description: 'Language code',
|
||||
optional: true,
|
||||
},
|
||||
previewLink: {
|
||||
type: 'string',
|
||||
description: 'Link to preview on Google Books',
|
||||
optional: true,
|
||||
},
|
||||
infoLink: {
|
||||
type: 'string',
|
||||
description: 'Link to info page',
|
||||
optional: true,
|
||||
},
|
||||
thumbnailUrl: {
|
||||
type: 'string',
|
||||
description: 'Book cover thumbnail URL',
|
||||
optional: true,
|
||||
},
|
||||
isbn10: {
|
||||
type: 'string',
|
||||
description: 'ISBN-10 identifier',
|
||||
optional: true,
|
||||
},
|
||||
isbn13: {
|
||||
type: 'string',
|
||||
description: 'ISBN-13 identifier',
|
||||
optional: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user