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"])
Metadata
Release files for langchain-genezio 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_genezio-0.1.2.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_genezio-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.0 kB
Release files / langchain_genezio-0.1.2.tar.gz
| Download URL | langchain_genezio-0.1.2.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2055c48335f82eea40aba8df2f5d818100371d618ec486e4f33c10b2756c6cde
|
|
BLAKE2b-256 checksum How to use checksums |
044020ae60255c1e1a7b74919a06f6d254c00d3e4a16d07280977ea6a574ab31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 12, 2025.
Transparency logRelease files / langchain_genezio-0.1.2-py3-none-any.whl
| Download URL | langchain_genezio-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b61a2fdcb0612765c024ed46e859594996d9f0751f0f7abb29f0be8c57522f06
|
|
BLAKE2b-256 checksum How to use checksums |
8d79155ae70ee6ac68ee3d05233d8123d72e132adcc97987b71552930bad6185
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 12, 2025.
Transparency log