Feature/langgraph gemini example#473
Conversation
- Demonstrates LangGraph integration with Google Gemini - Includes bulletproof placeholder handling for APO - Adds persistent training result storage - Provides Windows compatibility fixes - Comprehensive README with troubleshooting
|
@microsoft-github-policy-service agree |
|
Hi. Thanks a lot for the contribution! Would you be willing to move the example to |
|
Hi @ultmaster Thanks for the quick feedback! I'd be happy to move the example to contrib/recipes. I noticed the test failures are in the Should I:
Or would you prefer I close this and open a new PR directly in contrib/recipes with the formatting fixes? Happy to do whichever is easiest for you! |
The |
… Moved examples/langgraph-news-agent to contrib/recipes/langgraph-news-agent- Applied pre-commit formatting (isort, black, trailing whitespace)- Fixed end-of-file newlines- Merged latest changes from main branch
|
Done! I've merged the latest changes from main, applied all pre-commit formatting fixes, and moved the example to contrib/recipes/langgraph-news-agent as requested. Ready for review! |
|
Hi @ultmaster , Just following up on this! The changes are ready and I've moved everything to contrib/recipes as you requested. Would you be able to approve the workflow so the CI checks can run? Happy to fix any issues that come up. Thanks for your time! |
|
@ultmaster Hi! Checking in on this PR again. I completed the requested changes a couple weeks ago:
The workflow just needs approval to run the CI checks. I'm ready to quickly fix any test failures that come up. Would really appreciate if you could approve the workflow when you get a chance, or let me know if there's anything else needed! Thanks! |
|
hi. was on vacation and just back. let's check the CI. |
|
Hi @ultmaster Thanks for approving the workflow! I've added the missing copyright header to agent_train.py and pushed the fix. I'm also seeing test failures in the Lint - next job, but those appear to be in the core framework files (agentlightning/instrumentation/weave.py and agentlightning/tracer/weave.py) rather than my contribution. The errors are related to missing type definitions for OtelExportReq and OtelExportRes. My contribution files in contrib/recipes/langgraph-news-agent/ should now pass all checks. Let me know if there's anything else I need to address! |
Summary
Adds a complete LangGraph + Google Gemini integration example demonstrating APO (Automatic Prompt Optimization) training.
Features
What's Included
agent_train.py- Complete training script with news agent + APO setupREADME.md- Detailed setup instructions and troubleshootingrequirements.txt- All Python dependencies.env.example- API key configuration template.gitignore- Prevents accidental secret commitsProblem Solved
This example addresses common issues developers face when integrating LangGraph with Agent Lightning:
{query}, causing runtime errorsbeam_roundsparameter causes training to run indefinitelyTesting
Tested on:
Related
This example fills a gap in the current examples - there are no LangGraph integrations or non-OpenAI LLM examples in the repository yet.
Note: I'm writing a companion blog article with a detailed walkthrough that
can serve as additional community documentation.