Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update LangChain LLMs and Add Chat Models Support #953

Merged
merged 28 commits into from
Sep 30, 2024
Merged

Conversation

qiuosier
Copy link
Member

@qiuosier qiuosier commented Sep 24, 2024

This PR includes the following updates on the LangChain integration:

  • Removed supports for OCI generative AI. Users should use the implementation from langchain-community instead.
  • Compatible with LangChain v0.3 and Pydantic v2.
  • Added chat model
  • Added streaming and async support
  • Added tool calling support for vLLM

Example code to enable tool calling for mistral model

from ads.llm import ChatOCIModelDeploymentVLLM, ChatTemplates

deployment_ocid = "<Model Deployment OCID>"

llm =  ChatOCIModelDeploymentVLLM(
    model="odsc-llm", # update this as needed.
    streaming=True,
    endpoint=f"https://modeldeployment.us-ashburn-1.oci.customer-oci.com/{deployment_ocid}/predict",
    auth=ads.common.auth.default_signer(),
    model_kwargs={"temperature" : 0},
    tool_choice="auto",
    chat_template=ChatTemplates.mistral()
)

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 24, 2024
Copy link

⚠️ This PR changed pyproject.toml file. ⚠️

  • PR Creator must update 📃 THIRD_PARTY_LICENSES.txt, if any 📚 library added/removed in pyproject.toml.
  • PR Approver must confirm 📃 THIRD_PARTY_LICENSES.txt updated, if any 📚 library added/removed in pyproject.toml.

@qiuosier qiuosier marked this pull request as draft September 24, 2024 15:18
Copy link

⚠️ This PR changed pyproject.toml file. ⚠️

  • PR Creator must update 📃 THIRD_PARTY_LICENSES.txt, if any 📚 library added/removed in pyproject.toml.
  • PR Approver must confirm 📃 THIRD_PARTY_LICENSES.txt updated, if any 📚 library added/removed in pyproject.toml.

Copy link

⚠️ This PR changed pyproject.toml file. ⚠️

  • PR Creator must update 📃 THIRD_PARTY_LICENSES.txt, if any 📚 library added/removed in pyproject.toml.
  • PR Approver must confirm 📃 THIRD_PARTY_LICENSES.txt updated, if any 📚 library added/removed in pyproject.toml.

@qiuosier qiuosier marked this pull request as ready for review September 26, 2024 16:57
mrDzurb
mrDzurb previously approved these changes Sep 26, 2024
Copy link

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-20.19%

@qiuosier qiuosier dismissed stale reviews from mrDzurb and mayoor via 8b84923 September 26, 2024 20:54
Copy link

⚠️ This PR changed pyproject.toml file. ⚠️

  • PR Creator must update 📃 THIRD_PARTY_LICENSES.txt, if any 📚 library added/removed in pyproject.toml.
  • PR Approver must confirm 📃 THIRD_PARTY_LICENSES.txt updated, if any 📚 library added/removed in pyproject.toml.

@qiuosier
Copy link
Member Author

Test coverage:
image

@qiuosier
Copy link
Member Author

Update documentation
LangChain Integration - ADS.pdf

mayoor
mayoor previously approved these changes Sep 26, 2024
Copy link

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-20.19%

@qiuosier qiuosier dismissed stale reviews from VipulMascarenhas and mayoor via 8cec512 September 27, 2024 02:09
Copy link

⚠️ This PR changed pyproject.toml file. ⚠️

  • PR Creator must update 📃 THIRD_PARTY_LICENSES.txt, if any 📚 library added/removed in pyproject.toml.
  • PR Approver must confirm 📃 THIRD_PARTY_LICENSES.txt updated, if any 📚 library added/removed in pyproject.toml.

Copy link

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-20.19%

mrDzurb
mrDzurb previously approved these changes Sep 30, 2024
Copy link

⚠️ This PR changed pyproject.toml file. ⚠️

  • PR Creator must update 📃 THIRD_PARTY_LICENSES.txt, if any 📚 library added/removed in pyproject.toml.
  • PR Approver must confirm 📃 THIRD_PARTY_LICENSES.txt updated, if any 📚 library added/removed in pyproject.toml.

Copy link

📌 Cov diff with main:

Coverage-35%

📌 Overall coverage:

Coverage-59.07%

@qiuosier qiuosier merged commit 38d969c into main Sep 30, 2024
24 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.

4 participants