langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
94.21k stars 15.23k forks source link

DOC: some import statement of Oracle Cloud Infrastructure Generative AI can be improved #17156

Closed shukawam closed 8 months ago

shukawam commented 8 months ago

Issue with current documentation:

There is a point of improvement in the import statement included in the following sample code that exists in the Usage.

from langchain_community.llms import OCIGenAI

from langchain_community.llms import OCIGenAI

# use default authN method API-key
llm = OCIGenAI(
    model_id="MY_MODEL",
    service_endpoint="https://inference.generativeai.us-chicago-1.oci.oraclecloud.com",
    compartment_id="MY_OCID",
)

response = llm.invoke("Tell me one fact about earth", temperature=0.7)
print(response)

This is a point as well.

from langchain_community.vectorstores import FAISS

from langchain.schema.output_parser import StrOutputParser
from langchain.schema.runnable import RunnablePassthrough
from langchain_community.embeddings import OCIGenAIEmbeddings
from langchain_community.vectorstores import FAISS

Idea or request for content:

The first item is appropriate to do this.

from langchain_community.llms.oci_generative_ai import OCIGenAI

And the second item is appropriate to do this.

from langchain_community.vectorstores.faiss import FAISS
dosubot[bot] commented 8 months ago

🤖

It's great to see that you've identified the issue with the import statements and even provided the corrected versions. Your proposed changes will definitely improve the documentation. I encourage you to go ahead and create a pull request with your suggested fixes. Your contribution will be valuable to the community. Thank you for your willingness to improve the repository!


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

PennlaineChu commented 8 months ago

I have changed the document, however, both the original code and the code you provided works in my case. Can you explain what the problem is with the existing module, please?

baskaryan commented 8 months ago

Yea not clear what the improvement is. Closing issue for now but feel free to re-open if i'm missing something @shukawam