Langchain extensions
Binding Pocket Tools
from langchain_openai import ChatOpenAI
from hyperpocket.config.settings import settings
from hyperpocket_langchain import PocketLangchain
pocket = PocketLangchain(tools=[
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-messages",
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
])
# get langchain compatible tools from pocket
tools = pocket.get_tools()
llm = ChatOpenAI(
model="gpt-4o",
api_key=settings["OPENAI_API_KEY"]
)
# bind tool with llm
llm_with_tools = llm.bind_tools(tools)
Agent Examples
from langchain.agents import create_tool_calling_agent, AgentExecutor
from langchain.memory import ConversationBufferMemory
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_openai import ChatOpenAI
from hyperpocket_langchain import PocketLangchain
pocket = PocketLangchain(tools=[
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-messages",
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
])
# get langchain compatible tools from pocket
tools = pocket.get_tools()
llm = ChatOpenAI()
prompt = ChatPromptTemplate.from_messages(
(
"system",
"You are very powerful linear assistant. You can help the user do something like commenting, get some issues",
),
("placeholder", "{chat_history}"),
("user", "{input}"),
MessagesPlaceholder(variable_name="agent_scratchpad"),
]
)
memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)
agent = create_tool_calling_agent(llm, tools, prompt)
agent_executor = AgentExecutor(
agent=agent,
tools=tools,
memory=memory,
verbose=True,
handle_parsing_errors=True
)
Metadata
Release files for hyperpocket-langchain 0.5.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hyperpocket_langchain-0.5.7.tar.gz | 117.3 kB | Without provenance | Details for hyperpocket_langchain-0.5.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hyperpocket_langchain-0.5.7-py3-none-any.whl | Python 3 | none | any | Details for hyperpocket_langchain-0.5.7-py3-none-any.whl |
Total release size: 120.0 kB
Release files / hyperpocket_langchain-0.5.7.tar.gz
| Download URL | hyperpocket_langchain-0.5.7.tar.gz |
|---|---|
| Size | 117.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53403ff0c542798b5ff8624aeb708cf7ff9ce03b69153af6414396f66e3973c5
|
|
BLAKE2b-256 checksum How to use checksums |
2fb5b77012d8eb0568a01f92011e40d3a6108165afe623c9f9c95f2c011fefb8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|
Release files / hyperpocket_langchain-0.5.7-py3-none-any.whl
| Download URL | hyperpocket_langchain-0.5.7-py3-none-any.whl |
|---|---|
| Size | 2.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
773527997e6df39e703571f45d729a8f16939bd1d6eb48fceb7336a1c24b4e8a
|
|
BLAKE2b-256 checksum How to use checksums |
5538db78e3305704acbea9f931e6d13a9bbf65ca58d59f803760f9b88da019b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|
Security for hyperpocket-langchain 0.5.7
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.