langgraph adapter

This commit is contained in:
lingyuzeng
2025-08-30 23:29:26 +08:00
parent 273e6088fc
commit e1a36bc1e6
6 changed files with 703 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
"""
Lightweight adapter to use Qwen3-Coder(-Flash) models with LangGraph via
LangChain ChatModels. Focuses on an OpenAI-compatible path and a clean
factory API, plus helpers for tool binding and streaming examples.
Usage quickstart:
from langgraph_qwen.factory import get_qwen_chat_model
from langgraph.prebuilt import create_react_agent
model = get_qwen_chat_model()
agent = create_react_agent(model, tools=[...])
Environment variables:
- QWEN_API_KEY: API key for OpenAI-compatible endpoint (or DashScope)
- QWEN_BASE_URL: Base URL (e.g. https://dashscope-intl.aliyuncs.com/compatible-mode/v1)
- QWEN_MODEL: Model name (e.g. qwen3-coder-flash)
"""
__all__ = [
"get_qwen_chat_model",
"bind_qwen_tools",
"ChatQwenOpenAICompat",
"create_qwen_react_agent",
]
from .factory import get_qwen_chat_model, bind_qwen_tools
from .chat_model import ChatQwenOpenAICompat
from .prebuilt import create_qwen_react_agent