Tony20100/langchain_full huggingface dataset:
langchain_community.tools.file_management.copy.FileCopyInput¶
class langchain_community.tools.file_management.copy.FileCopyInput[source]¶
Bases: BaseModel
Input for CopyFileTool.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param destination_path: str [Required]¶
Path to save the copied file
param source_path: str [Required]¶
Path of the file to copy
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
Parameters
_fields_set (Optional[SetStr]) – 
values (Any) – 
Return type
Model
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶
Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) – fields to include in new model
exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) – fields to exclude from new model, as with values this takes precedence over include
update (Optional[DictStrAny]) – values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep (bool) – set to True to make a deep copy of the model
langchain_community.tools.gitlab.tool.GitLabAction¶
class langchain_community.tools.gitlab.tool.GitLabAction[source]¶
Bases: BaseTool
Tool for interacting with the GitLab API.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param api_wrapper: GitLabAPIWrapper [Optional]¶
param args_schema: Optional[Type[BaseModel]] = None¶
Pydantic model class to validate and parse the tool’s input arguments.
param callback_manager: Optional[BaseCallbackManager] = None¶
Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = ''¶
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶
Handle the content of the ToolException thrown.
param handle_validation_error: Optional[Union[bool, str, Callable[[ValidationError], str]]] = False¶
Handle the content of the ValidationError thrown.
param metadata: Optional[Dict[str, Any]] = None¶
Optional metadata associated with the tool. Defaults to None
This metadata will be associated with each call to this tool,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a tool with its use case.
param mode: str [Required]¶
param return_direct: bool = False¶
Whether to return the tool’s output directly. Setting this to True means
that after the tool is called, the AgentExecutor will stop looping.
param tags: Optional[List[str]] = None¶
langchain_community.tools.spark_sql.tool.BaseSparkSQLTool¶
class langchain_community.tools.spark_sql.tool.BaseSparkSQLTool[source]¶
Bases: BaseModel
Base tool for interacting with Spark SQL.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param db: SparkSQL [Required]¶
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
Parameters
_fields_set (Optional[SetStr]) – 
values (Any) – 
Return type
Model
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶
Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) – fields to include in new model
exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) – fields to exclude from new model, as with values this takes precedence over include
update (Optional[DictStrAny]) – values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep (bool) – set to True to make a deep copy of the model
self (Model) – 
Returns
new model instance
Return type
Model
langchain_community.tools.cassandra_database.tool.BaseCassandraDatabaseTool¶
class langchain_community.tools.cassandra_database.tool.BaseCassandraDatabaseTool[source]¶
Bases: BaseModel
Base tool for interacting with an Apache Cassandra database.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param db: CassandraDatabase [Required]¶
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
Parameters
_fields_set (Optional[SetStr]) – 
values (Any) – 
Return type
Model
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶
Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) – fields to include in new model
exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) – fields to exclude from new model, as with values this takes precedence over include
update (Optional[DictStrAny]) – values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep (bool) – set to True to make a deep copy of the model
self (Model) – 
Returns
new model instance
Return type
langchain_community.tools.office365.events_search.O365SearchEvents¶
class langchain_community.tools.office365.events_search.O365SearchEvents[source]¶
Bases: O365BaseTool
Search calendar events in Office 365.
Free, but setup is required
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param account: Account [Optional]¶
The account object for the Office 365 account.
param args_schema: Type[BaseModel] = <class 'langchain_community.tools.office365.events_search.SearchEventsInput'>¶
Pydantic model class to validate and parse the tool’s input arguments.
param callback_manager: Optional[BaseCallbackManager] = None¶
Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = " Use this tool to search for the user's calendar events. The input must be the start and end datetimes for the search query. The output is a JSON list of all the events in the user's calendar between the start and end times. You can assume that the user can  not schedule any meeting over existing meetings, and that the user is busy during meetings. Any times without events are free for the user. "¶
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶
Handle the content of the ToolException thrown.
param handle_validation_error: Optional[Union[bool, str, Callable[[ValidationError], str]]] = False¶
Handle the content of the ValidationError thrown.
param metadata: Optional[Dict[str, Any]] = None¶
langchain_community.tools.ainetwork.owner.AINOwnerOps¶
class langchain_community.tools.ainetwork.owner.AINOwnerOps[source]¶
Bases: AINBaseTool
Tool for owner operations.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param args_schema: Type[BaseModel] = <class 'langchain_community.tools.ainetwork.owner.RuleSchema'>¶
Pydantic model class to validate and parse the tool’s input arguments.
param callback_manager: Optional[BaseCallbackManager] = None¶
Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = "\nRules for `owner` in AINetwork Blockchain database.\nAn address set as `owner` can modify permissions according to its granted authorities\n\n## Path Rule\n- (/[a-zA-Z_0-9]+)+\n- Permission checks ascend from the most specific (child) path to broader (parent) paths until an `owner` is located.\n\n## Address Rules\n- 0x[0-9a-fA-F]{40}: 40-digit hexadecimal address\n- *: All addresses permitted\n- Defaults to the current session's address\n\n## SET\n- `SET` alters permissions for specific addresses, while other addresses remain unaffected.\n- When removing an address of `owner`, set all authorities for that address to false.\n- message `write_owner permission evaluated false` if fail\n\n### Example\n- type: SET\n- path: /apps/langchain\n- address: [<address 1>, <address 2>]\n- write_owner: True\n- write_rule: True\n- write_function: True\n- branch_owner: True\n\n## GET\n- Provides all addresses with `owner` permissions and their authorities in the path.\n\n### Example\n- type: GET\n- path: /apps/langchain\n"¶
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶
Handle the content of the ToolException thrown.
param handle_validation_error: Optional[Union[bool, str, Callable[[ValidationError], str]]] = False¶
Handle the content of the ValidationError thrown.
param interface: Ain [Optional]¶
langchain_community.tools.e2b_data_analysis.tool.add_last_line_print¶
langchain_community.tools.e2b_data_analysis.tool.add_last_line_print(code: str) → str[source]¶
Add print statement to the last line if it’s missing.
Sometimes, the LLM-generated code doesn’t have print(variable_name), instead theLLM tries to print the variable only by writing variable_name (as you would in
REPL, for example).
This methods checks the AST of the generated Python code and adds the printstatement to the last line if it’s missing.
Parameters
code (str) – 
Return type
str
langchain_community.tools.cassandra_database.tool.GetTableDataCassandraDatabaseTool¶
class langchain_community.tools.cassandra_database.tool.GetTableDataCassandraDatabaseTool[source]¶
Bases: BaseCassandraDatabaseTool, BaseTool
Tool for getting data from a table in an Apache Cassandra database.
Use the WHERE clause to specify the predicate for the query that uses the
primary key. A blank predicate will return all rows. Avoid this if possible.
Use the limit to specify the number of rows to return. A blank limit will
return all rows.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param args_schema: Type[BaseModel] = <class 'langchain_community.tools.cassandra_database.tool._GetTableDataCassandraDatabaseToolInput'>¶
Pydantic model class to validate and parse the tool’s input arguments.
param callback_manager: Optional[BaseCallbackManager] = None¶
Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param db: CassandraDatabase [Required]¶
param description: str = '\n    Tool for getting data from a table in an Apache Cassandra database. \n    Use the WHERE clause to specify the predicate for the query that uses the \n    primary key. A blank predicate will return all rows. Avoid this if possible. \n    Use the limit to specify the number of rows to return. A blank limit will \n    return all rows.\n    '¶
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶
Handle the content of the ToolException thrown.
output_type (Optional[Type[Output]]) – 
Return type
Runnable[Input, Output]
property InputType: Type[Input]¶
The type of input this runnable accepts specified as a type annotation.
property OutputType: Type[Output]¶
The type of output this runnable produces specified as a type annotation.
property args: dict¶
property config_specs: List[ConfigurableFieldSpec]¶
List configurable fields for this runnable.
property input_schema: Type[BaseModel]¶
The type of input this runnable accepts specified as a pydantic model.
property is_single_input: bool¶
Whether the tool only accepts a single input.
property lc_attributes: Dict¶
List of attribute names that should be included in the serialized kwargs.
These attributes must be accepted by the constructor.
property lc_secrets: Dict[str, str]¶
A map of constructor argument names to secret ids.
For example,{“openai_api_key”: “OPENAI_API_KEY”}
name: str = None¶
The unique name of the tool that clearly communicates its purpose.
property output_schema: Type[BaseModel]¶
The type of output this runnable produces specified as a pydantic model.
Examples using GetTableDataCassandraDatabaseTool¶
Cassandra Database
langchain_community.tools.google_finance.tool.GoogleFinanceQueryRun¶
class langchain_community.tools.google_finance.tool.GoogleFinanceQueryRun[source]¶
Bases: BaseTool
Tool that queries the Google Finance API.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param api_wrapper: GoogleFinanceAPIWrapper [Required]¶
param args_schema: Optional[Type[BaseModel]] = None¶
Pydantic model class to validate and parse the tool’s input arguments.
param callback_manager: Optional[BaseCallbackManager] = None¶
Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = 'A wrapper around Google Finance Search. Useful for when you need to get information aboutgoogle search Finance from Google FinanceInput should be a search query.'¶
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶
Handle the content of the ToolException thrown.
param handle_validation_error: Optional[Union[bool, str, Callable[[ValidationError], str]]] = False¶
Handle the content of the ValidationError thrown.
param metadata: Optional[Dict[str, Any]] = None¶
Optional metadata associated with the tool. Defaults to None
This metadata will be associated with each call to this tool,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a tool with its use case.
param return_direct: bool = False¶
Whether to return the tool’s output directly. Setting this to True means
langchain_community.tools.bing_search.tool.BingSearchResults¶
class langchain_community.tools.bing_search.tool.BingSearchResults[source]¶
Bases: BaseTool
Tool that queries the Bing Search API and gets back json.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param api_wrapper: BingSearchAPIWrapper [Required]¶
param args_schema: Optional[Type[BaseModel]] = None¶
Pydantic model class to validate and parse the tool’s input arguments.
param callback_manager: Optional[BaseCallbackManager] = None¶
Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = 'A wrapper around Bing Search. Useful for when you need to answer questions about current events. Input should be a search query. Output is a JSON array of the query results'¶
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶
Handle the content of the ToolException thrown.
param handle_validation_error: Optional[Union[bool, str, Callable[[ValidationError], str]]] = False¶
Handle the content of the ValidationError thrown.
param metadata: Optional[Dict[str, Any]] = None¶
Optional metadata associated with the tool. Defaults to None
This metadata will be associated with each call to this tool,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a tool with its use case.
param num_results: int = 4¶
param return_direct: bool = False¶
langchain_community.tools.google_scholar.tool.GoogleScholarQueryRun¶
class langchain_community.tools.google_scholar.tool.GoogleScholarQueryRun[source]¶
Bases: BaseTool
Tool that queries the Google search API.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param api_wrapper: GoogleScholarAPIWrapper [Required]¶
param args_schema: Optional[Type[BaseModel]] = None¶
Pydantic model class to validate and parse the tool’s input arguments.
param callback_manager: Optional[BaseCallbackManager] = None¶
Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = 'A wrapper around Google Scholar Search. Useful for when you need to get information aboutresearch papers from Google ScholarInput should be a search query.'¶
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶
Handle the content of the ToolException thrown.
param handle_validation_error: Optional[Union[bool, str, Callable[[ValidationError], str]]] = False¶
Handle the content of the ValidationError thrown.
param metadata: Optional[Dict[str, Any]] = None¶
Optional metadata associated with the tool. Defaults to None
This metadata will be associated with each call to this tool,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a tool with its use case.
param return_direct: bool = False¶
Whether to return the tool’s output directly. Setting this to True means
langchain_core.tools.BaseTool¶
class langchain_core.tools.BaseTool[source]¶
Bases: RunnableSerializable[Union[str, Dict], Any]
Interface LangChain tools must implement.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param args_schema: Optional[Type[BaseModel]] = None¶
Pydantic model class to validate and parse the tool’s input arguments.
param callback_manager: Optional[BaseCallbackManager] = None¶
Deprecated. Please use callbacks instead.
param callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None¶
Callbacks to be called during tool execution.
param description: str [Required]¶
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶
Handle the content of the ToolException thrown.
param handle_validation_error: Optional[Union[bool, str, Callable[[ValidationError], str]]] = False¶
Handle the content of the ValidationError thrown.
param metadata: Optional[Dict[str, Any]] = None¶
Optional metadata associated with the tool. Defaults to None
This metadata will be associated with each call to this tool,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a tool with its use case.
param name: str = None [Required]¶
The unique name of the tool that clearly communicates its purpose.
param return_direct: bool = False¶
Whether to return the tool’s output directly. Setting this to True means
that after the tool is called, the AgentExecutor will stop looping.
that after the tool is called, the AgentExecutor will stop looping.
param tags: Optional[List[str]] = None¶
Optional list of tags associated with the tool. Defaults to None
These tags will be associated with each call to this tool,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a tool with its use case.
param verbose: bool = False¶
Whether to log the tool’s progress.
__call__(tool_input: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → str[source]¶
[Deprecated] Make tool callable.
Notes
Deprecated since version langchain-core==0.1.47: Use invoke instead.
Parameters
tool_input (str) – 
callbacks (Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]]) – 
Return type
str
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶
Default implementation runs ainvoke in parallel using asyncio.gather.
The default implementation of batch works well for IO bound runnables.
Subclasses should override this method if they can batch more efficiently;
e.g., if the underlying runnable uses an API which supports a batch mode.
Parameters
inputs (List[Input]) – 
config (Optional[Union[RunnableConfig, List[RunnableConfig]]]) – 
return_exceptions (bool) – 
kwargs (Optional[Any]) – 
Return type
List[Output]
kwargs (Optional[Any]) – 
Return type
List[Output]
async abatch_as_completed(inputs: Sequence[Input], config: Optional[Union[RunnableConfig, Sequence[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → AsyncIterator[Tuple[int, Union[Output, Exception]]]¶
Run ainvoke in parallel on a list of inputs,
yielding results as they complete.
Parameters
inputs (Sequence[Input]) – 
config (Optional[Union[RunnableConfig, Sequence[RunnableConfig]]]) – 
return_exceptions (bool) – 
kwargs (Optional[Any]) – 
Return type
AsyncIterator[Tuple[int, Union[Output, Exception]]]
async ainvoke(input: Union[str, Dict], config: Optional[RunnableConfig] = None, **kwargs: Any) → Any[source]¶
Default implementation of ainvoke, calls invoke from a thread.
The default implementation allows usage of async code even if
the runnable did not implement a native async version of invoke.
Subclasses should override this method if they can run asynchronously.
Parameters
input (Union[str, Dict]) – 
config (Optional[RunnableConfig]) – 
kwargs (Any) – 
Return type
Any
async arun(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, run_name: Optional[str] = None, run_id: Optional[UUID] = None, config: Optional[RunnableConfig] = None, **kwargs: Any) → Any[source]¶
Run the tool asynchronously.
Parameters