langchain-azure-dynamic-sessions
This package contains the LangChain integration for Azure Container Apps dynamic sessions. You can use it to add a secure and scalable code interpreter to your agents.
Installation
pip install -U langchain-azure-dynamic-sessions
Usage
You first need to create an Azure Container Apps session pool and obtain its management endpoint. Then you can use the SessionsPythonREPLTool tool to give your agent the ability to execute Python code.
from langchain_azure_dynamic_sessions import SessionsPythonREPLTool
# get the management endpoint from the session pool in the Azure portal
tool = SessionsPythonREPLTool(pool_management_endpoint=POOL_MANAGEMENT_ENDPOINT)
prompt = hub.pull("hwchase17/react")
tools=[tool]
react_agent = create_react_agent(
llm=llm,
tools=tools,
prompt=prompt,
)
react_agent_executor = AgentExecutor(agent=react_agent, tools=tools, verbose=True, handle_parsing_errors=True)
react_agent_executor.invoke({"input": "What is the current time in Vancouver, Canada?"})
By default, the tool uses DefaultAzureCredential to authenticate with Azure. If you're using a user-assigned managed identity, you must set the AZURE_CLIENT_ID environment variable to the ID of the managed identity.
Metadata
Release files for gigachain-azure-dynamic-sessions 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gigachain_azure_dynamic_sessions-0.1.0.tar.gz | 5.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gigachain_azure_dynamic_sessions-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.5 kB
Release files / gigachain_azure_dynamic_sessions-0.1.0.tar.gz
| Download URL | gigachain_azure_dynamic_sessions-0.1.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e7b3b8105f897635e743d373dd94c9b5e2dacdc5362a27549cf81a41624048a5
|
|
BLAKE2b-256 checksum How to use checksums |
2f4806d8554aaa3ac929b268729cdb2250c1ba493373ed1e5d94062bd325e972
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.6 Darwin/23.5.0
|
Release files / gigachain_azure_dynamic_sessions-0.1.0-py3-none-any.whl
| Download URL | gigachain_azure_dynamic_sessions-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bd36284165a4264ea9c31dec873e11066f39d13c8fe8b7baba270dec0f6e6fd1
|
|
BLAKE2b-256 checksum How to use checksums |
dcf048f8e1f4896d03388562e0a2a93c0683a9d70bdc0cc711c4405b035c1bc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.6 Darwin/23.5.0
|