Octogen Python SDK built on langgraph
Project description
Octogen Python SDK for LangGraph
A Python SDK for building LLM-powered shop agents using LangGraph and LangChain, designed to work with the Octogen platform.
Features
- Build conversational shop agents with LangGraph's state management
- Structured output parsing with Pydantic models
- Built-in recommendation expansion functionality
- Server deployment capabilities with FastAPI
- Integration with Octogen MCP tools for product discovery
- Streamlined agent creation through factory patterns
Installation
pip install octogen-sdk-langgraph
Requirements
- Python ≥ 3.12
- Dependencies:
- langchain ≥ 0.3.25
- langgraph ≥ 0.4.3
- pydantic ≥ 2.11.4
- octogen-api ≥ 0.1.0a4
- structlog ≥ 25.3.0
Quick Start
from langchain_openai import ChatOpenAI
from octogen.shop_agent import ShopAgent, create_agent
from your_models import ResponseClass, HydratedResponseClass
# Define your recommendation expansion function
def expand_recommendations(response, messages):
# Process and expand recommendations
return json.dumps(expanded_response)
# Create a shop agent
async with create_agent(
model=ChatOpenAI(model="gpt-4"),
agent_name="MyShopAgent",
response_class=ResponseClass,
hydrated_response_class=HydratedResponseClass,
rec_expansion_fn=expand_recommendations,
tool_names=["search_products", "get_product_details"],
hub_prompt_id="your/hub/prompt_id",
) as agent:
# Use the agent
result = await agent.run("I'm looking for a new jacket")
Usage Examples
See the examples/ directory for complete implementations:
examples/stylist/- A personal shopping assistantexamples/discovery/- Product discovery agentexamples/comparison/- Product comparison tool
License
This project is licensed under the terms included in the LICENSE file.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file octogen_sdk_langgraph-0.1.1.tar.gz.
File metadata
- Download URL: octogen_sdk_langgraph-0.1.1.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41c1912bacf6e140eb318f2b3982d91d394c7830f7abd6acb03e601a9bd7a31f
|
|
| MD5 |
0bd5dde99ebbdacc563916ad4a91354c
|
|
| BLAKE2b-256 |
4332497f8369ad44b0c246d9aa7186a88f37b09f22a49190c9acadb5b3c8aaac
|
Provenance
The following attestation bundles were made for octogen_sdk_langgraph-0.1.1.tar.gz:
Publisher:
python-publish.yml on octogen-systems/octogen-py-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
octogen_sdk_langgraph-0.1.1.tar.gz -
Subject digest:
41c1912bacf6e140eb318f2b3982d91d394c7830f7abd6acb03e601a9bd7a31f - Sigstore transparency entry: 215268896
- Sigstore integration time:
-
Permalink:
octogen-systems/octogen-py-sdk@3eb1abc968055fc72d588f79a3752e5f6b613323 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/octogen-systems
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3eb1abc968055fc72d588f79a3752e5f6b613323 -
Trigger Event:
release
-
Statement type:
File details
Details for the file octogen_sdk_langgraph-0.1.1-py3-none-any.whl.
File metadata
- Download URL: octogen_sdk_langgraph-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd57269669ccd00de1eb234afe5a6a111c8f209fb1ce7772b41f9fcb46cd5ec0
|
|
| MD5 |
c49c0304c0b3944961b2ab8e9f518cbe
|
|
| BLAKE2b-256 |
db5226e29a5cb791265d600aae4d52e2151324fa1daeca5f18035c766fb0cef7
|
Provenance
The following attestation bundles were made for octogen_sdk_langgraph-0.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on octogen-systems/octogen-py-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
octogen_sdk_langgraph-0.1.1-py3-none-any.whl -
Subject digest:
dd57269669ccd00de1eb234afe5a6a111c8f209fb1ce7772b41f9fcb46cd5ec0 - Sigstore transparency entry: 215268898
- Sigstore integration time:
-
Permalink:
octogen-systems/octogen-py-sdk@3eb1abc968055fc72d588f79a3752e5f6b613323 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/octogen-systems
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3eb1abc968055fc72d588f79a3752e5f6b613323 -
Trigger Event:
release
-
Statement type: