JIVAS action wrapper around LangChain library for abstracted LLM interfacing.
This action provides a JIVAS action wrapper for the LangChain library to invoke LLM calls, facilitating abstracted interfacing with large language models (LLMs). As a core action, it simplifies and streamlines interactions with LLMs. The package is a singleton and requires the Jivas library version 2.0.0. It also depends on various Python packages for its functionality, including openai
and different components of the LangChain ecosystem.
Additionally, this action supports streaming responses when the streaming
flag is set in the interact configuration, enabling real-time output from the underlying LLM.
jivas/langchain_model_action
LangChainModelAction
^2.0.0-alpha.43
openai
: >=1.68.2
langchain
: >=0.3.21
langchain-community
: >=0.3.20
langchain-core
: >=0.3.47
langchain-experimental
: >=0.3.4
langchain-openai
: >=0.3.9
Below is detailed guidance on how to configure and use the LangChain Model Action.
The LangChain Model Action provides an abstraction layer for interacting with large language models (LLMs). It supports multiple configurations for various use cases, including:
The configuration consists of the following properties:
provider
(str)Specifies the LLM provider. Supported values: "chatopenai"
(default) or "azurechatopenai"
.
api_key
(str)API key for authenticating with the provider.
api_version
(str)API version to use (required for Azure OpenAI).
azure_endpoint
(str)Azure endpoint URL (required for Azure OpenAI).
model_name
(str)Name of the model to use. Default: "gpt-4o"
.
model_temperature
(float)Sampling temperature for the model. Default: 0.4
.
model_max_tokens
(int)Maximum number of tokens in the response. Default: 4096
.
model_settings = {
"provider": "chatopenai",
"api_key": "your_openai_api_key",
"model_name": "gpt-4o",
"model_temperature": 0.4,
"model_max_tokens": 4096
}
model_settings = {
"provider": "azurechatopenai",
"api_key": "your_azure_api_key",
"api_version": "2024-02-15-preview",
"azure_endpoint": "https://your-resource-name.openai.azure.com/",
"model_name": "gpt-4o",
"model_temperature": 0.4,
"model_max_tokens": 4096
}
langchain_model_action
project.git clone https://github.com/TrueSelph/langchain_model_action
git checkout -b new-feature-x
git commit -m 'Implemented new feature x.'
git push origin new-feature-x
This project is protected under the Apache License 2.0. See LICENSE for more information.
jvcli download action jivas/langchain_model_action
Last published
a month ago
Version
0.0.7
Downloads
368
Author
jivasType
action
Visibility
Public
Tags