feat(langchain): add LangChain export adapter & runner with multi-provider support#16
feat(langchain): add LangChain export adapter & runner with multi-provider support#16AJAmit17 wants to merge 14 commits intoopen-gitagent:mainfrom
Conversation
Feat/langchain adopter
|
This is the oldest open PR (March 4). The LangChain adapter generates Python code using the Agents SDK. A few issues:
Please clarify: is this a LangChain adapter or an OpenAI Agents SDK adapter? The generated code doesn't use LangChain at all. |
Full LangChain CLI adapter: - Export: generates standalone Python scripts using LangChain agent framework - Run: executes gitagent agents using LangChain runtime with venv management - Multi-provider support: OpenAI (GPT-4, o1, o3) and Anthropic (Claude) - Tool conversion: maps gitagent YAML tools to @tool decorated functions - Sub-agent delegation: converts sub-agents to LangChain agent delegates - System prompt: combines SOUL.md, RULES.md, skills
Feat/langchain
feat: add LangChain CLI adapter with export and run
Hi @shreyas-lyzr, thanks for the detailed review! Just to clarify — this is a LangChain adapter, not an OpenAI Agents SDK adapter. I believe there may have been a mismatch in how it was tested. If you run: npm run build
node dist/index.js export --format langchain -d examples/minimal -o test.pythe generated Python clearly uses LangChain APIs ( Key points:
Quick run (end-to-end)npm run build
export OPENAI_API_KEY=your-key
node dist/index.js run -d examples/minimal --adapter langchain -p "Hello"(Requires The confusion might come from using OpenAI models as a provider via LangChain, but the framework itself is fully LangChain-based. Based on your feedback:
Do let me know if any improvements are needed to these changes I’ve made 👍 |
What
Add a LangChain export adapter and runner to gitagent. This allows exporting any gitagent agent definition to a runnable LangChain Python script, and executing it directly via the CLI.
Key features:
Why
LangChain is one of the most widely used agent frameworks. Supporting it as an export target makes gitagent useful to a much larger audience and was explicitly listed as a wanted adapter in CONTRIBUTING.md.
Closes #2
How Tested
npm run buildpassesgitagent validatepasses on example agentsgitagent export -f langchain -d examples/<name> -o <file>ast.parse()syntax validation passed on all 5 generated scriptslyzr-agentwithgpt-4.1+OPENAI_API_KEYfullwithclaude-opus-4-6+ANTHROPIC_API_KEYgitagent run -d examples/minimal --adapter langchaingitagent run -d examples/lyzr-agent --adapter langchain -p "Summarize quantum computing"Checklist