langgraph-func
Expose LangGraph workflows as Azure Function HTTP endpoints.
Installation
poetry add langgraph_func
Requires Python ≥3.10, LangGraph, Azure Functions SDK.
Define a Workflow
from pydantic import BaseModel
from langgraph.graph import StateGraph, START
from typing import Optional
class Input(BaseModel):
input_text: str
class Output(BaseModel):
update: Optional[str] = None
class MergedState(Input, Output):
pass
def test(state: MergedState) -> dict:
return {"update": "ok"}
compiled_graph = StateGraph(input=Input, output=Output) \
.add_node("test", test) \
.add_edge(START, "test") \
.set_finish_point("test") \
.compile(name="test_graph")
Configuration (function-app.yml)
swagger:
title: Test Function App
version: 1.0.0-beta
auth: FUNCTION
ui_route: docs
blueprints:
blueprint_a:
path: blueprint_a
description: |
Groups related graphs.
graphs:
graphA:
path: graphA
source: graphs.graph
auth: FUNCTION
description: |
GraphA ingests raw input.
parentGraph:
path: parentGraph
source: graphs.parent_graph
auth: FUNCTION
description: |
Calls a subgraph from a parent.
Run in Azure Functions
from langgraph_func.func_app_builder.create_app import create_app_from_yaml
app = create_app_from_yaml("function-app.yml")
Deploy with func azure functionapp publish <APP_NAME>.
Calling Subgraphs
class Input(BaseModel):
input_text: str
class Output(BaseModel):
child_update: Optional[str] = None
# create one invoker instance
subgraph = AzureFunctionInvoker(
function_path="blueprint_a/graphA",
base_url=settings.function_base_url,
input_field_map={"input_text": "text"},
output_field_map={"updates": "child_update"},
auth_key=FunctionKeySpec.INTERNAL,
)
compiled_graph = (
StateGraph(input=Input, output=Output)
.add_node("call_graphA", subgraph)
.add_edge(START, "call_graphA")
.set_finish_point("call_graphA")
.compile()
)
Documentation
See GitHub Pages for full API reference and examples.
Metadata
Release files for langgraph-func 0.3.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langgraph_func-0.3.9.tar.gz | 38.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langgraph_func-0.3.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 99.7 kB
Release files / langgraph_func-0.3.9.tar.gz
| Download URL | langgraph_func-0.3.9.tar.gz |
|---|---|
| Size | 38.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7849b7fe2f6c5429f61da610011fbcf76d22664007856856740f6e84b9e80b67
|
|
BLAKE2b-256 checksum How to use checksums |
98cd53fca3f44cfd96d24da09ae9af55ae731c1dd8d64e3a0d71d360230efeb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Release files / langgraph_func-0.3.9-py3-none-any.whl
| Download URL | langgraph_func-0.3.9-py3-none-any.whl |
|---|---|
| Size | 60.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
65a7cdfcfe114f89571cbeebbe64f98dbc368d58258693e67fa35ce2eb302465
|
|
BLAKE2b-256 checksum How to use checksums |
9cbfe716d45a0b4cdf5f80a0891b9295b864792525f0d633096c2a4ea7dc9830
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|