mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-22 06:39:52 +00:00
Add args_schema to google_places tool (#5680)
Tiny change to actually add the args_schema to the tool. @vowelparrot
This commit is contained in:
parent
8fea0529c1
commit
647210a4b9
@ -1,6 +1,6 @@
|
|||||||
"""Tool for the Google search API."""
|
"""Tool for the Google search API."""
|
||||||
|
|
||||||
from typing import Optional
|
from typing import Optional, Type
|
||||||
|
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ from langchain.utilities.google_places_api import GooglePlacesAPIWrapper
|
|||||||
|
|
||||||
|
|
||||||
class GooglePlacesSchema(BaseModel):
|
class GooglePlacesSchema(BaseModel):
|
||||||
query: str = Field(..., description="Query for goole maps")
|
query: str = Field(..., description="Query for google maps")
|
||||||
|
|
||||||
|
|
||||||
class GooglePlacesTool(BaseTool):
|
class GooglePlacesTool(BaseTool):
|
||||||
@ -27,6 +27,7 @@ class GooglePlacesTool(BaseTool):
|
|||||||
"Input should be a search query."
|
"Input should be a search query."
|
||||||
)
|
)
|
||||||
api_wrapper: GooglePlacesAPIWrapper = Field(default_factory=GooglePlacesAPIWrapper)
|
api_wrapper: GooglePlacesAPIWrapper = Field(default_factory=GooglePlacesAPIWrapper)
|
||||||
|
args_schema: Type[BaseModel] = GooglePlacesSchema
|
||||||
|
|
||||||
def _run(
|
def _run(
|
||||||
self,
|
self,
|
||||||
|
Loading…
Reference in New Issue
Block a user