Metadata-Version: 2.3
Name: langchain_genezio
Version: 0.1.2
Summary: The Genezio Code Interpreter is a Virtual Machine isolated environment for running Python generated by AI agents.
License: MIT
Keywords: langchain,genezio,code-interpreter,ai
Author: Genezio
Requires-Python: >=3.9,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: langchain (>=0.3.18,<0.4.0)
Requires-Dist: langgraph (>=0.2.70,<0.3.0)
Project-URL: Bug Tracker, https://github.com/Genez-io/langchain-genezio/issues
Project-URL: Homepage, https://github.com/Genez-io/langchain-genezio
Description-Content-Type: text/markdown

# Langchain Genezio Code Interpreter

The Langchain Genezio Code Interpreter allows you to add code execution functionality into the LLMs. The code is executed in a secured environment on Genezio Cloud Platform. 

## Installation

```
pip install langchain-genezio
```

## Usage

```
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_anthropic import ChatAnthropic
from langchain_core.prompts import ChatPromptTemplate
from langchain-genezio import GenezioInterpreter

tools = [
    GenezioInterpreter(
        url=os.getenv("GENEZIO_PROJECT_URL"),
    )
]

llm = ChatAnthropic(model="claude-3-haiku-20240307", temperature=0)

prompt_template = ChatPromptTemplate.from_messages(
    [
        (
            "system",
            "You are a helpful assistant. Make sure to use a tool if you need to solve a problem.",
        ),
        ("human", "{input}"),
        ("placeholder", "{agent_scratchpad}"),
    ]
)

agent = create_tool_calling_agent(llm, tools, prompt_template)
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
# Ask a tough question
result = agent_executor.invoke({"input": "What is the 888th prime number?"})
print(result["output"][0]["text"])
```

