Skip to main content

An integration package connecting Azure Container Apps dynamic sessions and LangChain

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file langchain_azure_dynamic_sessions-0.1.0rc0.tar.gz.

File metadata

File hashes

Hashes for langchain_azure_dynamic_sessions-0.1.0rc0.tar.gz
Algorithm Hash digest
SHA256 fe2c2c0cd4ce7b5a8c2cd37679cfc200c15d50d825bc985c9404cd96c4eb0668
MD5 cef5dc7b5e4e6e47f73fce473630bd83
BLAKE2b-256 dc583f9961e6c2a5a00f0b1a7670bfb61f615dbb86752736bb74b8a5268e9e8f

See more details on using hashes here.

File details

Details for the file langchain_azure_dynamic_sessions-0.1.0rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_azure_dynamic_sessions-0.1.0rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ecab0a1f9f033c17dcc6b53aaa544ae0e9c423494d353d12fd991d4f4d1a7ae
MD5 6c83af028ea5b7a4cc5a754c28aa2272
BLAKE2b-256 993259e75de1054130be04e82843c71b26950723cf212604e75351ec23a0f0fe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page