Skip to content

Commit

Permalink
adding back args schema
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Makrod committed Nov 7, 2024
1 parent 43741e3 commit e755b2e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libs/community/langchain_community/tools/google_books.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
"""Tool for the Google Books API."""

from typing import Optional
from typing import Optional, Type

from langchain_core.callbacks import CallbackManagerForToolRun
from langchain_core.tools import BaseTool
from pydantic import BaseModel, Field

from langchain_community.utilities.google_books import GoogleBooksAPIWrapper


class GoogleBooksQueryInput(BaseModel):
"""Input for the GoogleBooksQuery tool."""

query: str = Field(description="query to look up on google books")


class GoogleBooksQueryRun(BaseTool): # type: ignore[override]
"""Tool that searches the Google Books API."""

Expand All @@ -20,6 +27,7 @@ class GoogleBooksQueryRun(BaseTool): # type: ignore[override]
"Input should be a query string"
)
api_wrapper: GoogleBooksAPIWrapper
args_schema: Type[BaseModel] = GoogleBooksQueryInput

def _run(
self,
Expand Down

0 comments on commit e755b2e

Please sign in to comment.