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

Intellisense does not work for certain imports #19692

Open
5 tasks done
blacksmithop opened this issue Mar 28, 2024 · 1 comment
Open
5 tasks done

Intellisense does not work for certain imports #19692

blacksmithop opened this issue Mar 28, 2024 · 1 comment
Labels
🔌: neo4j Primarily related to Neo4j integrations 🤖:question A specific question about the codebase, product, project, or how to use a feature Ɑ: vector store Related to vector store module

Comments

@blacksmithop
Copy link
Contributor

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

Let's say I wanted to use Neo4J as a Vectorstore

Code from the neo4j documentation

from langchain_community.vectorstores import Neo4jVector
from langchain_openai.embeddings import AzureOpenAIEmbeddings

index_name = "vector"  # default index name
keyword_index_name = "keyword"  # default keyword index name

insights_db = Neo4jVector.from_existing_index(
    AzureOpenAIEmbeddings(),
    url=URL,
    username=USERNAME,
    password=PASSWORD,
    index_name=index_name,
    keyword_index_name=keyword_index_name,
    search_type="hybrid",
    database=DATABASE
)

Error Message and Stack Trace (if applicable)

No response

Description

This works as expected and I am able to use the vectorstore. However it does not seem to support intellisense

image
image

Were I to explicitly import Neo4jVector from neo4j_vector intellisense shows up as intended

image

I found that a _module_lookup is defined in the init.py under vectorstores.

Is there anything I can do to ensure that my intellisense picks up such imports?

System Info

langchain==0.1.13
langchain-community==0.0.29
langchain-core==0.1.35
langchain-openai==0.1.1
langchain-text-splitters==0.0.1

Windows

3.11.5

@dosubot dosubot bot added Ɑ: vector store Related to vector store module 🔌: neo4j Primarily related to Neo4j integrations 🤖:question A specific question about the codebase, product, project, or how to use a feature labels Mar 28, 2024
@13rac1
Copy link
Contributor

13rac1 commented Apr 12, 2024

These new dynamic imports seem designed to reduce memory use and startup time, but they break Intellisense so I am using explicit imports for now.

Dynamic imports have been fixed for vectorstores in #20110 using #20050 as a template.
Dynamic imports created for chains in #18160 - Still needs fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔌: neo4j Primarily related to Neo4j integrations 🤖:question A specific question about the codebase, product, project, or how to use a feature Ɑ: vector store Related to vector store module
Projects
None yet
Development

No branches or pull requests

2 participants