Skip to content

Add samples directory with code examples#152

Merged
YouNeedCryDear merged 3 commits intooracle:mainfrom
fede-kamel:add-samples
Mar 5, 2026
Merged

Add samples directory with code examples#152
YouNeedCryDear merged 3 commits intooracle:mainfrom
fede-kamel:add-samples

Conversation

@fede-kamel
Copy link
Copy Markdown
Contributor

Summary

Add a comprehensive samples/ directory with runnable code examples covering all langchain-oci features. This mirrors the structure used by langchain-aws.

8 Sample Categories:

  • 01: Getting Started - Basic chat, authentication, multi-turn conversations
  • 02: Vision & Multimodal - Image analysis, PDF, video, audio processing
  • 03: Building AI Agents - ReAct agents with tools and memory
  • 04: Tool Calling Mastery - bind_tools, parallel execution, workflows
  • 05: Structured Output - Pydantic schemas, data classification
  • 07: Async for Production - ainvoke, astream, abatch, FastAPI
  • 09: Provider Deep Dive - Meta Llama, Gemini, Cohere, xAI specifics
  • 10: Embeddings - Text and image embeddings for RAG

Features:

  • All samples support environment variable configuration (OCI_COMPARTMENT_ID, OCI_AUTH_PROFILE)
  • Includes run_integration_tests.py for automated testing
  • All 16 runnable samples pass integration tests against real OCI GenAI service
  • Progressive learning path from beginner to advanced

Test plan

  • Run samples/run_integration_tests.py - 16/16 samples pass
  • Verify environment variable configuration works
  • Test against multiple OCI models (Llama, Gemini, Cohere)

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 5, 2026
Add 8 sample categories covering all langchain-oci features:
- 01: Getting started with basic chat and authentication
- 02: Vision and multimodal (image, PDF, video, audio)
- 03: Building AI agents with ReAct pattern
- 04: Tool calling mastery including parallel tools
- 05: Structured output with Pydantic schemas
- 07: Async patterns for production
- 09: Provider deep-dive (Meta, Gemini, Cohere, xAI)
- 10: Text and image embeddings for RAG

Each sample supports environment variable configuration:
- OCI_COMPARTMENT_ID
- OCI_SERVICE_ENDPOINT
- OCI_AUTH_PROFILE

Includes run_integration_tests.py for automated testing.
All 16 runnable samples pass integration tests.
Move samples from libs/oci/samples/ to samples/ at the root level,
matching the structure used by langchain-aws.
mdrxy pushed a commit to langchain-ai/docs that referenced this pull request Mar 5, 2026
## Summary

Update the OCI provider documentation to link to `samples/` instead of
`tutorials/`. This aligns with the samples directory being added to
langchain-oracle (see oracle/langchain-oracle#152).

## Changes
- Rename "Tutorials" section to "Samples"
- Update all GitHub links from `/tutorials/` to `/samples/`
- No content changes, just link updates

## Related
- oracle/langchain-oracle#152 - Add samples directory with code examples
@fede-kamel
Copy link
Copy Markdown
Contributor Author

fede-kamel commented Mar 5, 2026

Hi @YouNeedCryDear ,

This PR adds a samples/ directory following the same structure as other cloud providers

What's included:

  • 8 sample directories: getting started, vision/multimodal, agents, tool calling, structured output, async patterns, provider deep-dive, and embeddings
  • Each sample has a README + runnable .py files with environment variable support
  • Updated main README with links to samples and official LangChain docs

Related PRs in langchain-ai/docs:

  • #2943 - Updates OCI provider page to link to these samples
  • #2940 - Quality improvements (merged)
  • #2925 - Initial OCI integration docs (merged)

Next step: Once this is merged and the docs PRs are in, we should consider adding OCI to the main provider tabs in LangChain docs (alongside AWS, Google, Azure, etc.). This would give OCI first-class visibility as a major cloud provider integration.

Let me know if you'd like any changes to the samples!

Thanks,
Federico

@YouNeedCryDear YouNeedCryDear merged commit ae66adf into oracle:main Mar 5, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants