OCI Generative AI docs: Quality improvements and bug fixes#2940
Merged
Mason Daugherty (mdrxy) merged 3 commits intolangchain-ai:mainfrom Mar 5, 2026
Merged
Conversation
- Add example output for invocation (shows SQL injection detection) - Complete tool calling flow with ToolMessage execution loop - Fix multiline strings (no more escaped newlines) - Replace all '...' placeholders with full parameters - Add proper imports where missing - Show realistic output for vision and PDF examples - Cleaner async examples with proper message format
The OCI API expects document_url format for PDFs:
{"type": "document_url", "document_url": {"url": "data:application/pdf;base64,..."}}
Not the media format that was incorrectly documented.
All 12 integration tests now pass.
- Multi-turn: use ("user", ...), ("assistant", ...) tuple format
- Streaming: use simple string instead of messages list
- Async: use simple string for ainvoke/astream
- Vision prompt: condense to single line
HumanMessage only used where required (multimodal content, tool loops).
Contributor
Author
|
Hey Mason Daugherty (@mdrxy) - apologies for the separate PR! I was working on some improvements this morning when the original (#2925) got merged. These are minor quality enhancements:
All changes tested against real OCI GenAI services (13/13 tests pass). Thanks! |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up improvements to OCI Generative AI documentation (#2925) based on testing this morning. Apologies for the separate PR - I was working on these improvements when the original was merged.
Changes:
ToolMessageexecution loop (was missing){"type": "media", ...}to correct{"type": "document_url", ...}formatHumanMessageisn't required:llm.invoke("question")instead ofllm.invoke([HumanMessage(...)])("user", "..."), ("assistant", "...")tuples for multi-turnTesting
All 13 integration tests pass against real OCI GenAI services:
create_oci_agent)Files Changed
src/oss/python/integrations/chat/oci_generative_ai.mdxsrc/oss/python/integrations/providers/oci.mdxsrc/oss/python/integrations/text_embedding/oci_generative_ai.mdx