langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Weaviate setup in docs is broken

Open ashemag opened this issue 1 year ago • 2 comments

https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html

It doesn't look like embeddings var is used. This code fails on:

======================================================================
ERROR: test_weaviate_setup (__main__.TestVectorStores)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_vectorstores.py", line 50, in test_weaviate_setup
    client.schema.create(schema)
  File "/Users/ashemagalhaes/opt/miniconda3/envs/hearth-modeling/lib/python3.8/site-packages/weaviate/schema/crud_schema.py", line 128, in create
    self._create_classes_with_primitives(loaded_schema["classes"])
  File "/Users/ashemagalhaes/opt/miniconda3/envs/hearth-modeling/lib/python3.8/site-packages/weaviate/schema/crud_schema.py", line 723, in _create_classes_with_primitives
    self._create_class_with_primitives(weaviate_class)
  File "/Users/ashemagalhaes/opt/miniconda3/envs/hearth-modeling/lib/python3.8/site-packages/weaviate/schema/crud_schema.py", line 708, in _create_class_with_primitives
    raise UnexpectedStatusCodeException("Create class", response)
weaviate.exceptions.UnexpectedStatusCodeException: Create class! Unexpected status code: 422, with response body: {'error': [{'message': "module 'text2vec-openai': unsupported version 002"}]}.

----------------------------------------------------------------------
Ran 1 test in 0.564s

FAILED (errors=1)
sys:1: ResourceW

ashemag avatar Apr 13 '23 10:04 ashemag

cc: @hsm207

bobvanluijt avatar Apr 13 '23 15:04 bobvanluijt

It worked for me by using this in the schema instead:

      "vectorizer": "text2vec-openai",
      "moduleConfig": {
          "text2vec-openai": {
          "model": "ada",
          "modelVersion": "002",
          "type": "text"
          }
      },

manubamba avatar Apr 19 '23 12:04 manubamba

@ashemag @manubamba we recently updated that notebook example. You don't actually need to set up weaviate with a vectorizer if using using it langchain because you can use the embeddings object.

hsm207 avatar May 31 '23 02:05 hsm207

Hi, @ashemag! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

Based on my understanding, the issue you raised is about the broken Weaviate setup in the documentation, with the code provided failing due to an unsupported version of the 'text2vec-openai' module. @manubamba suggested an alternative schema that worked for them. Additionally, @hsm207 and @manubamba mentioned that the notebook example has been recently updated and that setting up Weaviate with a vectorizer is not necessary if using langchain.

Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your understanding and contribution to the LangChain project!

dosubot[bot] avatar Sep 19 '23 16:09 dosubot[bot]