Tony20100/langchain_full huggingface dataset:
langchain_core.tools.RetrieverInput¶
class langchain_core.tools.RetrieverInput[source]¶
Bases: BaseModel
Input to the retriever.
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 query: str [Required]¶
query to look up in retriever
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.connery.models.Validation¶
class langchain_community.tools.connery.models.Validation[source]¶
Bases: BaseModel
Connery Action parameter validation model.
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 required: Optional[bool] = None¶
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
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 llm_chain: Any = None¶
param max_iterations: int = 5¶
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 output_token_limit: int = 4000¶
param powerbi: PowerBIDataset [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 session_cache: Dict[str, Any] [Optional]¶
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 tiktoken_model_name: Optional[str] = None¶
param verbose: bool = False¶
Whether to log the tool’s progress.
__call__(tool_input: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → str¶
[Deprecated] Make tool callable.
Notes
Deprecated since version langchain-core==0.1.47: Use invoke instead.
Parameters
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]
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¶
Default implementation of ainvoke, calls invoke from a thread.
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¶
Run the tool asynchronously.
Parameters
tool_input (Union[str, Dict]) – 
verbose (Optional[bool]) – 
start_color (Optional[str]) – 
color (Optional[str]) – 
callbacks (Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]]) – 
tags (Optional[List[str]]) – 
metadata (Optional[Dict[str, Any]]) – 
run_name (Optional[str]) – 
run_id (Optional[UUID]) – 
config (Optional[RunnableConfig]) – 
kwargs (Any) – 
Return type
Any
assign(**kwargs: Union[Runnable[Dict[str, Any], Any], Callable[[Dict[str, Any]], Any], Mapping[str, Union[Runnable[Dict[str, Any], Any], Callable[[Dict[str, Any]], Any]]]]) → RunnableSerializable[Any, Any]¶
Assigns new fields to the dict output of this runnable.
langchain_community.tools.openapi.utils.api_models.APIPropertyBase¶
class langchain_community.tools.openapi.utils.api_models.APIPropertyBase[source]¶
Bases: BaseModel
Base model for an API property.
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 default: Optional[Any] = None¶
The default value of the property.
param description: Optional[str] = None¶
The description of the property.
param name: str [Required]¶
The name of the property.
param required: bool [Required]¶
Whether the property is required.
param type: Union[str, Type, tuple, None, Enum] = None¶
The type of the property.
Either a primitive type, a component/parameter type,
or an array or ‘object’ (dict) of the above.
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
langchain_community.tools.bearly.tool.BearlyInterpreterTool¶
class langchain_community.tools.bearly.tool.BearlyInterpreterTool(api_key: str)[source]¶
Tool for evaluating python code in a sandbox environment.
Attributes
description
endpoint
file_description
files
name
api_key
Methods
__init__(api_key)
add_file(source_path, target_path, description)
as_tool()
clear_files()
make_input_files()
Parameters
api_key (str) – 
__init__(api_key: str)[source]¶
Parameters
api_key (str) – 
add_file(source_path: str, target_path: str, description: str) → None[source]¶
Parameters
source_path (str) – 
target_path (str) – 
description (str) – 
Return type
None
as_tool() → Tool[source]¶
Return type
Tool
clear_files() → None[source]¶
Return type
None
make_input_files() → List[dict][source]¶
Return type
List[dict]
Examples using BearlyInterpreterTool¶
Bearly Code Interpreter
langchain_community.tools.sql_database.tool.ListSQLDatabaseTool¶
class langchain_community.tools.sql_database.tool.ListSQLDatabaseTool[source]¶
Bases: BaseSQLDatabaseTool, BaseTool
Tool for getting tables names.
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.sql_database.tool._ListSQLDataBaseToolInput'>¶
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: SQLDatabase [Required]¶
param description: str = 'Input is an empty string, output is a comma-separated list of tables in the database.'¶
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.file_management.file_search.FileSearchInput¶
class langchain_community.tools.file_management.file_search.FileSearchInput[source]¶
Bases: BaseModel
Input for FileSearchTool.
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 dir_path: str = '.'¶
Subdirectory to search in.
param pattern: str [Required]¶
Unix shell regex, where * matches everything.
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.github.tool.GitHubAction¶
class langchain_community.tools.github.tool.GitHubAction[source]¶
Bases: BaseTool
Tool for interacting with the GitHub 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: GitHubAPIWrapper [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.multion.create_session.MultionCreateSession¶
class langchain_community.tools.multion.create_session.MultionCreateSession[source]¶
Bases: BaseTool
Tool that creates a new Multion Browser Window with provided fields.
name¶
The name of the tool. Default: “create_multion_session”
description¶
The description of the tool.
args_schema¶
The schema for the tool’s arguments.
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[CreateSessionSchema] = <class 'langchain_community.tools.multion.create_session.CreateSessionSchema'>¶
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 = "\n        Create a new web browsing session based on a user's command or request.         The command should include the full info required for the session.         Also include an url (defaults to google.com if no better option)         to start the session.         Use this tool to create a new Browser Window with provided fields.         Always the first step to run any activities that can be done using browser.\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.
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
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¶
[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.
langchain_community.tools.wolfram_alpha.tool.WolframAlphaQueryRun¶
class langchain_community.tools.wolfram_alpha.tool.WolframAlphaQueryRun[source]¶
Bases: BaseTool
Tool that queries using the Wolfram Alpha SDK.
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: WolframAlphaAPIWrapper [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 Wolfram Alpha. Useful for when you need to answer questions about Math, Science, Technology, Culture, Society and Everyday Life. Input 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¶
langchain_nvidia_ai_endpoints.tools.ServerToolsMixin¶
class langchain_nvidia_ai_endpoints.tools.ServerToolsMixin[source]¶
Attributes
InputType
The type of input this runnable accepts specified as a type annotation.
OutputType
The type of output this runnable produces specified as a type annotation.
config_specs
List configurable fields for this runnable.
input_schema
The type of input this runnable accepts specified as a pydantic model.
name
The name of the runnable.
output_schema
The type of output this runnable produces specified as a pydantic model.
Methods
__init__()
abatch(inputs[, config, return_exceptions])
Default implementation runs ainvoke in parallel using asyncio.gather.
abatch_as_completed(inputs[, config, ...])
Run ainvoke in parallel on a list of inputs, yielding results as they complete.
ainvoke(input[, config])
Default implementation of ainvoke, calls invoke from a thread.
assign(**kwargs)
Assigns new fields to the dict output of this runnable.
astream(input[, config])
Default implementation of astream, which calls ainvoke.
astream_events(input[, config, ...])
[Beta] Generate a stream of events.
astream_log(input[, config, diff, ...])
Stream all output from a runnable, as reported to the callback system.
atransform(input[, config])
Default implementation of atransform, which buffers input and calls astream.
batch(inputs[, config, return_exceptions])
Default implementation runs invoke in parallel using a thread pool executor.
batch_as_completed(inputs[, config, ...])
Run invoke in parallel on a list of inputs, yielding results as they complete.
bind(**kwargs)
Bind arguments to a Runnable, returning a new Runnable.
bind(**kwargs)
Bind arguments to a Runnable, returning a new Runnable.
bind_tools(tools[, tool_arg, conversion_fn])
Bind tool-like objects to this chat model.
config_schema(*[, include])
The type of config this runnable accepts specified as a pydantic model.
get_graph([config])
Return a graph representation of this runnable.
get_input_schema([config])
Get a pydantic model that can be used to validate input to the runnable.
get_name([suffix, name])
Get the name of the runnable.
get_output_schema([config])
Get a pydantic model that can be used to validate output to the runnable.
get_prompts([config])
invoke(input[, config])
Transform a single input into an output.
map()
Return a new Runnable that maps a list of inputs to a list of outputs, by calling invoke() with each input.
pick(keys)
Pick keys from the dict output of this runnable.
pipe(*others[, name])
Compose this Runnable with Runnable-like objects to make a RunnableSequence.
stream(input[, config])
Default implementation of stream, which calls invoke.
transform(input[, config])
Default implementation of transform, which buffers input and then calls stream.
with_alisteners(*[, on_start, on_end, on_error])
Bind asynchronous lifecycle listeners to a Runnable, returning a new Runnable.
with_config([config])
Bind config to a Runnable, returning a new Runnable.
with_fallbacks(fallbacks, *[, ...])
Add fallbacks to a runnable, returning a new Runnable.
with_listeners(*[, on_start, on_end, on_error])
Bind lifecycle listeners to a Runnable, returning a new Runnable.
with_retry(*[, retry_if_exception_type, ...])