- Notifications
You must be signed in to change notification settings - Fork 48
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
Conversation
In the PR description is demoed import from langchain community. I guess it should be import form ADS? |
return decorator | ||
class OCIModelDeploymentEndpointEmbeddings(BaseModel, Embeddings): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
ads/llm/langchain/plugins/embeddings/oci_data_science_model_deployment_endpoint.py Show resolved Hide resolved
.. code-block:: python3 | ||
from langchain_community.embeddings import OCIModelDeploymentEndpointEmbeddings |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
…b.com/oracle/accelerated-data-science into ODSC-64498/langchain_embedding_plugin
625c12d
…b.com/oracle/accelerated-data-science into ODSC-64498/langchain_embedding_plugin
…b.com/oracle/accelerated-data-science into ODSC-64498/langchain_embedding_plugin
fd7b7be
Added Langchain Embedding Plugin