Skip to content

Added Langchain Embedding Plugin #1045

New issue

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

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

Already on ? Sign in to your account

Merged
merged 20 commits into from
Feb 4, 2025
Merged

Conversation

lu-ohai
Copy link
Member

Added Langchain Embedding Plugin

Screenshot 2025-01-22 at 11 02 18 PM

@oracle-contributor-agreementoracle-contributor-agreement bot added the OCA VerifiedAll contributors have signed the Oracle Contributor Agreement.label Jan 23, 2025
@github-actionsGitHub Actions
Copy link

-actions bot commented Jan 23, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-19.65%

@mrDzurb
Copy link
Member

In the PR description is demoed import from langchain community. I guess it should be import form ADS?

return decorator


class OCIModelDeploymentEndpointEmbeddings(BaseModel, Embeddings):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use OCIDataScienceEmbedding name instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

max_retries: int = 1
"""The maximum number of retries to make when generating."""

@root_validator()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we don't need this logic?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated


.. code-block:: python3

from langchain_community.embeddings import OCIModelDeploymentEndpointEmbeddings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess till we don't have it in langchain repo, it would be better to import from ads?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@github-actionsGitHub Actions
Copy link

-actions bot commented Jan 23, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-19.66%

mrDzurb
mrDzurb previously approved these changes Jan 24, 2025
@github-actionsGitHub Actions
Copy link

-actions bot commented Jan 24, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-19.66%

VipulMascarenhas
VipulMascarenhas previously approved these changes Jan 27, 2025
import requests
from langchain_core.embeddings import Embeddings
from langchain_core.language_models.llms import create_base_retry_decorator
from langchain_core.pydantic_v1 import BaseModel, Field
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using langchain_core.pydantic_v1 will cause conflicts with newer versions of langchain and pydantic v2.
See: https://python.langchain.com/docs/versions/v0_3/#1-do-not-use-the-langchain_corepydantic_v1-namespace

Please test using from pydantic import BaseModel, Field

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it in the previous commit but it got the error too. Let me reproduce this again.

@lu-ohailu-ohai dismissed stale reviews from VipulMascarenhas and mrDzurb via 625c12d January 27, 2025 16:46
@github-actionsGitHub Actions
Copy link

-actions bot commented Jan 27, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-19.74%

@github-actionsGitHub Actions
Copy link

-actions bot commented Jan 27, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-19.74%

@github-actionsGitHub Actions
Copy link

-actions bot commented Jan 27, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-57.19%

@github-actionsGitHub Actions
Copy link

-actions bot commented Jan 28, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-56.61%

mrDzurb
mrDzurb previously approved these changes Jan 31, 2025
VipulMascarenhas
VipulMascarenhas previously approved these changes Jan 31, 2025
@lu-ohailu-ohai enabled auto-merge February 1, 2025 01:43
@github-actionsGitHub Actions
Copy link

-actions bot commented Feb 1, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-56.64%

@github-actionsGitHub Actions
Copy link

-actions bot commented Feb 3, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-56.64%

@lu-ohailu-ohai dismissed stale reviews from mrDzurb and VipulMascarenhas via fd7b7be February 4, 2025 02:06
qiuosier
qiuosier previously approved these changes Feb 4, 2025
@github-actionsGitHub Actions
Copy link

-actions bot commented Feb 4, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-19.52%

@github-actionsGitHub Actions
Copy link

-actions bot commented Feb 4, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-56.67%

@github-actionsGitHub Actions
Copy link

-actions bot commented Feb 4, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-56.67%

@github-actionsGitHub Actions
Copy link

-actions bot commented Feb 4, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-56.67%

@lu-ohailu-ohai merged commit c92d0f6 into main Feb 4, 2025
21 checks passed
Sign up for free to join this conversation on . Already have an account? Sign in to comment
Labels
OCA VerifiedAll contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants