id stringlengths 14 16 | text stringlengths 29 2.73k | source stringlengths 49 115 |
|---|---|---|
c31a3c84efc8-66 | field verbose: bool [Optional]#
Whether to print out response text.
__call__(prompt: str, stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β str#
Check Cache and run the LLM on the given prompt and inpu... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-67 | Parameters
include β fields to include in new model
exclude β fields to exclude from new model, as with values this takes precedence over include
update β 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 β set to True to make a deep co... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-68 | Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
save(file_path: Union[pathlib.Path, str]) β None#
Save the LLM.
Parameters
file_path β Path to file to save the LLM to.
Exa... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-69 | What sampling temperature to use
field tokenizer: Any = None#
The tokenizer to use for the API calls.
field top_k: Optional[int] = None#
The number of highest probability vocabulary tokens
to keep for top-k-filtering.
field top_p: float = 0.9#
The cumulative probability for top-p sampling.
__call__(prompt: str, stop: O... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-70 | Behaves as if Config.extra = βallowβ was set since it adds all passed values
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... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-71 | Get the number of tokens in the message.
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-72 | field pipeline_kwargs: Dict[str, Any] [Optional]#
Holds any pipeline parameters valid for create call not
explicitly specified.
__call__(prompt: str, stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β s... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-73 | Parameters
include β fields to include in new model
exclude β fields to exclude from new model, as with values this takes precedence over include
update β 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 β set to True to make a deep co... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-74 | Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
save(file_path: Union[pathlib.Path, str]) β None#
Save the LLM.
Parameters
file_path β Path to file to save the LLM to.
Exa... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-75 | Check Cache and run the LLM on the given prompt and input.
async agenerate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β langchain.schema.LLMResult#
Run the LLM on the given pro... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-76 | Returns
new model instance
dict(**kwargs: Any) β Dict#
Return a dictionary of the LLM.
generate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β langchain.schema.LLMResult#
Run the... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-77 | Parameters
file_path β Path to file to save the LLM to.
Example:
.. code-block:: python
llm.save(file_path=βpath/llm.yamlβ)
classmethod update_forward_refs(**localns: Any) β None#
Try to update ForwardRefs on fields based on this Model, globalns and localns.
pydantic model langchain.llms.PromptLayerOpenAI[source]#
Wrap... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-78 | Run the LLM on the given prompt and input.
async agenerate_prompt(prompts: List[langchain.schema.PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β langchain.schema.LLMResult#
Take in a li... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-79 | dict(**kwargs: Any) β Dict#
Return a dictionary of the LLM.
generate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β langchain.schema.LLMResult#
Run the LLM on the given prompt an... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-80 | encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
max_tokens_for_prompt(prompt: str) β int#
Calculate the maximum number of tokens possible to generate for a prompt.
Parameters
prompt β The prompt to pass into the model.
Returns
The maximum number of tokens to ge... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-81 | yield token
classmethod update_forward_refs(**localns: Any) β None#
Try to update ForwardRefs on fields based on this Model, globalns and localns.
pydantic model langchain.llms.PromptLayerOpenAIChat[source]#
Wrapper around OpenAI large language models.
To use, you should have the openai and promptlayer python
package i... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-82 | field prefix_messages: List [Optional]#
Series of messages for Chat input.
field streaming: bool = False#
Whether to stream the results or not.
__call__(prompt: str, stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManag... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-83 | Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include β fields to include in new model
exclude β fields to exclude from new model, as with values this takes precedence over include
update β values to change/add in the new model. Note: the data is not validated before creat... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-84 | Get the number of tokens in the message.
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-85 | field CHUNK_LEN: int = 256#
Batch size for prompt processing.
field max_tokens_per_generation: int = 256#
Maximum number of tokens to generate.
field model: str [Required]#
Path to the pre-trained RWKV model file.
field penalty_alpha_frequency: float = 0.4#
Positive values penalize new tokens based on their existing fr... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-86 | Run the LLM on the given prompt and input.
async agenerate_prompt(prompts: List[langchain.schema.PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β langchain.schema.LLMResult#
Take in a li... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-87 | Run the LLM on the given prompt and input.
generate_prompt(prompts: List[langchain.schema.PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β langchain.schema.LLMResult#
Take in a list of p... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-88 | Wrapper around Replicate models.
To use, you should have the replicate python package installed,
and the environment variable REPLICATE_API_TOKEN set with your API token.
You can find your token here: https://replicate.com/account
The model param is required, but any other model parameters can also
be passed in with th... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-89 | Behaves as if Config.extra = βallowβ was set since it adds all passed values
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... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-90 | Get the number of tokens in the message.
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-91 | Make sure the credentials / roles used have the required policies to
access the Sagemaker endpoint.
See: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html
Validators
raise_deprecation Β» all fields
set_verbose Β» verbose
validate_environment Β» all fields
field content_handler: langchain.llms.sagemaker... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-92 | Check Cache and run the LLM on the given prompt and input.
async agenerate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β langchain.schema.LLMResult#
Run the LLM on the given pro... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-93 | Returns
new model instance
dict(**kwargs: Any) β Dict#
Return a dictionary of the LLM.
generate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β langchain.schema.LLMResult#
Run the... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-94 | Parameters
file_path β Path to file to save the LLM to.
Example:
.. code-block:: python
llm.save(file_path=βpath/llm.yamlβ)
classmethod update_forward_refs(**localns: Any) β None#
Try to update ForwardRefs on fields based on this Model, globalns and localns.
pydantic model langchain.llms.SelfHostedHuggingFaceLLM[source... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-95 | "text-generation", model=model, tokenizer=tokenizer
)
return pipe
hf = SelfHostedHuggingFaceLLM(
model_load_fn=get_pipeline, model_id="gpt2", hardware=gpu)
Validators
raise_deprecation Β» all fields
set_verbose Β» verbose
field device: int = 0#
Device to use for inference. -1 for CPU, 0 for GPU, 1 for second ... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-96 | Check Cache and run the LLM on the given prompt and input.
async agenerate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β langchain.schema.LLMResult#
Run the LLM on the given pro... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-97 | Returns
new model instance
dict(**kwargs: Any) β Dict#
Return a dictionary of the LLM.
classmethod from_pipeline(pipeline: Any, hardware: Any, model_reqs: Optional[List[str]] = None, device: int = 0, **kwargs: Any) β langchain.llms.base.LLM#
Init the SelfHostedPipeline from a pipeline object or string.
generate(prompts... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-98 | Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
save(file_path: Union[pathlib.Path, str]) β None#
Save the LLM.
Parameters
file_path β Path to file to save the LLM to.
Exa... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-99 | model_load_fn=load_pipeline,
hardware=gpu,
model_reqs=model_reqs, inference_fn=inference_fn
)
Example for <2GB model (can be serialized and sent directly to the server):from langchain.llms import SelfHostedPipeline
import runhouse as rh
gpu = rh.cluster(name="rh-a10x", instance_type="A100:1")
my_model = ...
llm... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-100 | Requirements to install on hardware to inference the model.
__call__(prompt: str, stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β str#
Check Cache and run the LLM on the given prompt and input.
async... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-101 | exclude β fields to exclude from new model, as with values this takes precedence over include
update β 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 β set to True to make a deep copy of the model
Returns
new model instance
dict(**kw... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-102 | Get the number of tokens in the message.
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-103 | Holds any model parameters valid for create call not
explicitly specified.
__call__(prompt: str, stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β str#
Check Cache and run the LLM on the given prompt a... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-104 | exclude β fields to exclude from new model, as with values this takes precedence over include
update β 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 β set to True to make a deep copy of the model
Returns
new model instance
dict(**kw... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-105 | Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
save(file_path: Union[pathlib.Path, str]) β None#
Save the LLM.
Parameters
file_path β Path to file to save the LLM to.
Exa... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-106 | shorter candidates
field logprobs: bool = False#
Whether to return log probabilities.
field model_id: str = 'palmyra-base'#
Model name to use.
field random_seed: int = 0#
The model generates random results.
Changing the random seed alone will produce a different response
with similar characteristics. It is possible to ... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-107 | Run the LLM on the given prompt and input.
async agenerate_prompt(prompts: List[langchain.schema.PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β langchain.schema.LLMResult#
Take in a li... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-108 | Run the LLM on the given prompt and input.
generate_prompt(prompts: List[langchain.schema.PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) β langchain.schema.LLMResult#
Take in a list of p... | https://python.langchain.com/en/latest/reference/modules/llms.html |
c31a3c84efc8-109 | previous
Writer
next
Chat Models
By Harrison Chase
Β© Copyright 2023, Harrison Chase.
Last updated on May 02, 2023. | https://python.langchain.com/en/latest/reference/modules/llms.html |
ade16a3d7a0b-0 | .rst
.pdf
Text Splitter
Text Splitter#
Functionality for splitting text.
class langchain.text_splitter.CharacterTextSplitter(separator: str = '\n\n', **kwargs: Any)[source]#
Implementation of splitting text that looks at characters.
split_text(text: str) β List[str][source]#
Split incoming text and return chunks.
class... | https://python.langchain.com/en/latest/reference/modules/text_splitter.html |
ade16a3d7a0b-1 | Split incoming text and return chunks.
class langchain.text_splitter.TextSplitter(chunk_size: int = 4000, chunk_overlap: int = 200, length_function: typing.Callable[[str], int] = <built-in function len>)[source]#
Interface for splitting text into chunks.
async atransform_documents(documents: Sequence[langchain.schema.D... | https://python.langchain.com/en/latest/reference/modules/text_splitter.html |
ade16a3d7a0b-2 | Transform sequence of documents by splitting them.
class langchain.text_splitter.TokenTextSplitter(encoding_name: str = 'gpt2', model_name: Optional[str] = None, allowed_special: Union[Literal['all'], AbstractSet[str]] = {}, disallowed_special: Union[Literal['all'], Collection[str]] = 'all', **kwargs: Any)[source]#
Imp... | https://python.langchain.com/en/latest/reference/modules/text_splitter.html |
7d819383c871-0 | .rst
.pdf
Agent Toolkits
Agent Toolkits#
Agent toolkits.
pydantic model langchain.agents.agent_toolkits.FileManagementToolkit[source]#
Toolkit for interacting with a Local Files.
field root_dir: Optional[str] = None#
If specified, all file operations are made relative to root_dir.
field selected_tools: Optional[List[st... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-1 | List of API Endpoint Tools.
classmethod from_llm_and_ai_plugin(llm: langchain.llms.base.BaseLLM, ai_plugin: langchain.tools.plugin.AIPlugin, requests: Optional[langchain.requests.Requests] = None, verbose: bool = False, **kwargs: Any) β langchain.agents.agent_toolkits.nla.toolkit.NLAToolkit[source]#
Instantiate the too... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-2 | Toolkit for interacting with a OpenAPI api.
field json_agent: langchain.agents.agent.AgentExecutor [Required]#
field requests_wrapper: langchain.requests.TextRequestsWrapper [Required]#
classmethod from_llm(llm: langchain.llms.base.BaseLLM, json_spec: langchain.tools.json.tool.JsonSpec, requests_wrapper: langchain.requ... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-3 | Toolkit for interacting with SQL databases.
field db: langchain.sql_database.SQLDatabase [Required]#
field llm: langchain.base_language.BaseLanguageModel [Required]#
get_tools() β List[langchain.tools.base.BaseTool][source]#
Get the tools in the toolkit.
property dialect: str#
Return string representation of dialect to... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-4 | field tools: List[langchain.tools.base.BaseTool] = []#
classmethod from_zapier_nla_wrapper(zapier_nla_wrapper: langchain.utilities.zapier.ZapierNLAWrapper) β langchain.agents.agent_toolkits.zapier.toolkit.ZapierToolkit[source]#
Create a toolkit from a ZapierNLAWrapper.
get_tools() β List[langchain.tools.base.BaseTool][... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-5 | langchain.agents.agent_toolkits.create_json_agent(llm: langchain.llms.base.BaseLLM, toolkit: langchain.agents.agent_toolkits.json.toolkit.JsonToolkit, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = 'You are an agent designed to interact with JSON.\nYour goal is to return ... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-6 | you cannot use it.\nYou should only add one key at a time to the path. You cannot add multiple keys at once.\nIf you encounter a "KeyError", go back to the previous key, look at the available keys, and try again.\n\nIf the question does not seem to be related to the JSON, just return "I don\'t know" as the answer.\nAlw... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-7 | str = 'Begin!"\n\nQuestion: {input}\nThought: I should look at the keys that exist in data to see what I have access to\n{agent_scratchpad}', format_instructions: str = 'Use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to ta... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-8 | Construct a json agent from an LLM and tools. | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-9 | langchain.agents.agent_toolkits.create_openapi_agent(llm: langchain.llms.base.BaseLLM, toolkit: langchain.agents.agent_toolkits.openapi.toolkit.OpenAPIToolkit, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = "You are an agent designed to answer questions by making web requ... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-10 | by checking which parameters are required. For parameters with a fixed set of values, please use the spec to look at which values are allowed.\n\nUse the exact parameter names as listed in the spec, do not make up any names or abbreviate the names of parameters.\nIf you get a not found error, ensure that you are using ... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-11 | = None, max_iterations: Optional[int] = 15, max_execution_time: Optional[float] = None, early_stopping_method: str = 'force', verbose: bool = False, return_intermediate_steps: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) β langchain.agents.agent.AgentExecutor[source]# | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-12 | Construct a json agent from an LLM and tools.
langchain.agents.agent_toolkits.create_pandas_dataframe_agent(llm: langchain.llms.base.BaseLLM, df: Any, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = '\nYou are working with a pandas dataframe in Python. The name of the data... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-13 | langchain.agents.agent_toolkits.create_pbi_agent(llm: langchain.llms.base.BaseLLM, toolkit: Optional[langchain.agents.agent_toolkits.powerbi.toolkit.PowerBIToolkit], powerbi: Optional[langchain.utilities.powerbi.PowerBIDataset] = None, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, pre... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-14 | Usually I should first ask which tables I have, then how each table is defined and then ask the question to query tool to create a query for me and then I should ask the query tool to execute it, finally create a nice sentence that answers the question. If you receive an error back that mentions that the query was wron... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-15 | always think about what to do\nAction: the action to take, should be one of [{tool_names}]\nAction Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the ori... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-16 | Construct a pbi agent from an LLM and tools. | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-17 | langchain.agents.agent_toolkits.create_pbi_chat_agent(llm: langchain.chat_models.base.BaseChatModel, toolkit: Optional[langchain.agents.agent_toolkits.powerbi.toolkit.PowerBIToolkit], powerbi: Optional[langchain.utilities.powerbi.PowerBIDataset] = None, callback_manager: Optional[langchain.callbacks.base.BaseCallbackMa... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-18 | knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics. \n\nGiven an input question, create a s... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-19 | how each table is defined and then ask the question to query tool to create a query for me and then I should ask the query tool to execute it, finally create a complete sentence that answers the question. If you receive an error back that mentions that the query was wrong try to phrase the question differently and get ... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-20 | Any]] = None, **kwargs: Dict[str, Any]) β langchain.agents.agent.AgentExecutor[source]# | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-21 | Construct a pbi agent from an Chat LLM and tools.
If you supply only a toolkit and no powerbi dataset, the same LLM is used for both.
langchain.agents.agent_toolkits.create_python_agent(llm: langchain.llms.base.BaseLLM, tool: langchain.tools.python.tool.PythonREPLTool, callback_manager: Optional[langchain.callbacks.bas... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-22 | langchain.agents.agent_toolkits.create_sql_agent(llm: langchain.llms.base.BaseLLM, toolkit: langchain.agents.agent_toolkits.sql.toolkit.SQLDatabaseToolkit, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = 'You are an agent designed to interact with a SQL database.\nGiven an... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-23 | a query, rewrite the query and try again.\n\nDO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\n\nIf the question does not seem related to the database, just return "I don\'t know" as the answer.\n', suffix: str = 'Begin!\n\nQuestion: {input}\nThought: I should look at the tables in th... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-24 | early_stopping_method: str = 'force', verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) β langchain.agents.agent.AgentExecutor[source]# | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-25 | Construct a sql agent from an LLM and tools.
langchain.agents.agent_toolkits.create_vectorstore_agent(llm: langchain.llms.base.BaseLLM, toolkit: langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = 'You are... | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
7d819383c871-26 | Construct a vectorstore router agent from an LLM and tools.
previous
Tools
next
Utilities
By Harrison Chase
Β© Copyright 2023, Harrison Chase.
Last updated on May 02, 2023. | https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html |
12e811d1d4e4-0 | .rst
.pdf
Document Transformers
Document Transformers#
Transform documents
pydantic model langchain.document_transformers.EmbeddingsRedundantFilter[source]#
Filter that drops redundant documents by comparing their embeddings.
field embeddings: langchain.embeddings.base.Embeddings [Required]#
Embeddings to use for embed... | https://python.langchain.com/en/latest/reference/modules/document_transformers.html |
6401bc566761-0 | .rst
.pdf
Document Loaders
Document Loaders#
All different types of document loaders.
class langchain.document_loaders.AZLyricsLoader(web_path: Union[str, List[str]], header_template: Optional[dict] = None)[source]#
Loader that loads AZLyrics webpages.
load() β List[langchain.schema.Document][source]#
Load webpage.
web... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-1 | Loading logic for loading documents from Azure Blob Storage.
load() β List[langchain.schema.Document][source]#
Load documents.
class langchain.document_loaders.AzureBlobStorageFileLoader(conn_str: str, container: str, blob_name: str)[source]#
Loading logic for loading documents from Azure Blob Storage.
load() β List[la... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-2 | load() β List[langchain.schema.Document][source]#
Load from bilibili url.
class langchain.document_loaders.BlackboardLoader(blackboard_course_url: str, bbrouter: str, load_all_recursively: bool = True, basic_auth: Optional[Tuple[str, str]] = None, cookies: Optional[dict] = None)[source]#
Loader that loads all documents... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-3 | Parameters
url β Url to parse the filename from.
Returns
The filename.
class langchain.document_loaders.BlockchainDocumentLoader(contract_address: str, blockchainType: langchain.document_loaders.blockchain.BlockchainType = BlockchainType.ETH_MAINNET, api_key: str = 'docs-demo', startToken: str = '')[source]#
Loads elem... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-4 | name of a column in the CSV file.
The source of each document will then be set to the value of the column
with the name specified in source_column.
Output Example:column1: value1
column2: value2
column3: value3
load() β List[langchain.schema.Document][source]#
Load data into document objects.
class langchain.document_l... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-5 | This currently supports both username/api_key and Oauth2 login.
Specify a list page_ids and/or space_key to load in the corresponding pages into
Document objects, if both are specified the union of both sets will be returned.
You can also specify a boolean include_attachments to include attachments, this
is set to Fals... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-6 | is_public_page(page: dict) β bool[source]#
Check if a page is publicly accessible.
load(space_key: Optional[str] = None, page_ids: Optional[List[str]] = None, label: Optional[str] = None, cql: Optional[str] = None, include_restricted_content: bool = False, include_archived_content: bool = False, include_attachments: bo... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-7 | doesnβt match the limit value. If limit is >100 confluence
seems to cap the response to 100. Also, due to the Atlassian Python
package, we donβt get the βnextβ values from the β_linksβ key because
they only return the value from the results key. So here, the pagination
starts from 0 and goes until the max_pages, getti... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-8 | Validates proper combinations of init arguments
class langchain.document_loaders.DataFrameLoader(data_frame: Any, page_content_column: str = 'text')[source]#
Load Pandas DataFrames.
load() β List[langchain.schema.Document][source]#
Load from the dataframe.
class langchain.document_loaders.DiffbotLoader(api_token: str, ... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-9 | Defaults to check for local file, but if the file is a web path, it will download it
to a temporary file, and use that, then clean up the temporary file after completion
load() β List[langchain.schema.Document][source]#
Load given path as single page.
class langchain.document_loaders.DuckDBLoader(query: str, database: ... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-10 | Loading logic for loading documents from GCS.
load() β List[langchain.schema.Document][source]#
Load documents.
class langchain.document_loaders.GitLoader(repo_path: str, clone_url: Optional[str] = None, branch: Optional[str] = 'main', file_filter: Optional[Callable[[str], bool]] = None)[source]#
Loads files from a Git... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-11 | python package installed.
As the google api expects credentials you need to set up a google account and
register your Service. βhttps://developers.google.com/docs/api/quickstart/pythonβ
Example
from langchain.document_loaders import GoogleApiClient
google_api_client = GoogleApiClient(
service_account_path=Path("pat... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-12 | )
loader = GoogleApiYoutubeLoader(
google_api_client=google_api_client,
channel_name = "CodeAesthetic"
)
load.load()
add_video_info: bool = True#
captions_language: str = 'en'#
channel_name: Optional[str] = None#
continue_on_failure: bool = False#
google_api_client: langchain.document_loaders.youtube.GoogleApiC... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-13 | load() β List[langchain.schema.Document][source]#
Load file.
class langchain.document_loaders.HNLoader(web_path: Union[str, List[str]], header_template: Optional[dict] = None)[source]#
Load Hacker News data from either main page results or the comments page.
load() β List[langchain.schema.Document][source]#
Get importa... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-14 | iFixit is the largest, open repair community on the web. The site contains nearly
100k repair manuals, 200k Questions & Answers on 42k devices, and all the data is
licensed under CC-BY.
This loader will allow you to download the text of a repair guide, text of Q&Aβs
and wikis from devices on iFixit using their open API... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-15 | Load from a list of image files
class langchain.document_loaders.MathpixPDFLoader(file_path: str, processed_file_format: str = 'mmd', max_wait_time_seconds: int = 500, should_clean_pdf: bool = False, **kwargs: Any)[source]#
clean_pdf(contents: str) β str[source]#
property data: dict#
get_processed_pdf(pdf_id: str) β st... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-16 | :returns: List of documents.
:rtype: List[Document]
load_page(page_id: str) β langchain.schema.Document[source]#
Read a page.
class langchain.document_loaders.NotionDirectoryLoader(path: str)[source]#
Loader that loads Notion directory dump.
load() β List[langchain.schema.Document][source]#
Load documents.
class langch... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-17 | Load file.
langchain.document_loaders.PagedPDFSplitter#
alias of langchain.document_loaders.pdf.PyPDFLoader
class langchain.document_loaders.PlaywrightURLLoader(urls: List[str], continue_on_failure: bool = True, headless: bool = True, remove_selectors: Optional[List[str]] = None)[source]#
Loader that uses Playwright an... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-18 | Loads a PDF with pypdf and chunks at character level.
Loader also stores page numbers in metadatas.
load() β List[langchain.schema.Document][source]#
Load given path as pages.
class langchain.document_loaders.PythonLoader(file_path: str)[source]#
Load Python files, respecting any non-default encoding if specified.
clas... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-19 | load() β List[langchain.schema.Document][source]#
Load documents.
class langchain.document_loaders.SRTLoader(file_path: str)[source]#
Loader for .srt (subtitle) files.
load() β List[langchain.schema.Document][source]#
Load using pysrt file.
class langchain.document_loaders.SeleniumURLLoader(urls: List[str], continue_on... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-20 | parse_sitemap(soup: Any) β List[dict][source]#
Parse sitemap xml and load into a list of dicts.
web_paths: List[str]#
class langchain.document_loaders.SlackDirectoryLoader(zip_path: str, workspace_url: Optional[str] = None)[source]#
Loader for loading documents from a Slack directory dump.
load() β List[langchain.schem... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-21 | to get your token. And create a v2 version of the app.
classmethod from_bearer_token(oauth2_bearer_token: str, twitter_users: Sequence[str], number_tweets: Optional[int] = 100) β langchain.document_loaders.twitter.TwitterTweetLoader[source]#
Create a TwitterTweetLoader from OAuth2 bearer token.
classmethod from_secrets... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-22 | Loader that uses unstructured to load email files.
class langchain.document_loaders.UnstructuredFileIOLoader(file: IO, mode: str = 'single', **unstructured_kwargs: Any)[source]#
Loader that uses unstructured to load file IO objects.
class langchain.document_loaders.UnstructuredFileLoader(file_path: str, mode: str = 'si... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-23 | Loader that uses unstructured to load rtf files.
class langchain.document_loaders.UnstructuredURLLoader(urls: List[str], continue_on_failure: bool = True, mode: str = 'single', **unstructured_kwargs: Any)[source]#
Loader that uses unstructured to load HTML files.
load() β List[langchain.schema.Document][source]#
Load f... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
6401bc566761-24 | Loader that loads WhatsApp messages text file.
load() β List[langchain.schema.Document][source]#
Load documents.
class langchain.document_loaders.YoutubeLoader(video_id: str, add_video_info: bool = False, language: str = 'en', continue_on_failure: bool = False)[source]#
Loader that loads Youtube transcripts.
classmetho... | https://python.langchain.com/en/latest/reference/modules/document_loaders.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.