Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

remove leftover test file and add to WeaviateRM examples

Arnav Singhvi14e6e6b71b86
diff --git a/dspy/retrieve/weaviate_rm.py b/dspy/retrieve/weaviate_rm.py
index a8e370ca8..67e3b26e0 100644
--- a/dspy/retrieve/weaviate_rm.py
+++ b/dspy/retrieve/weaviate_rm.py
@@ -32,6 +32,9 @@ class WeaviateRM(dspy.Retrieve):
weaviate_client = weaviate.connect_to_[local, wcs, custom, embedded]("your-path-here")
retriever_model = WeaviateRM("my_collection_name", weaviate_client=weaviate_client)
dspy.settings.configure(lm=llm, rm=retriever_model)
+
+ retrieve = dspy.Retrieve(k=1)
+ topK_passages = retrieve("what are the stages in planning, sanctioning and execution of public works").passages
```
Below is a code snippet that shows how to use Weaviate in the forward() function of a module
diff --git a/dspy/retrieve/weaviate_rm_test.py b/dspy/retrieve/weaviate_rm_test.py
deleted file mode 100644
index fa2c97237..000000000
--- a/dspy/retrieve/weaviate_rm_test.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# ToDo
-
-# Start Weaviate Embedded
-
-# Add Toy Data
-
-# Connect DSPy
-
-# Test this API
-"""
-from dspy.retrieve.weaviate_rm import WeaviateRM
-retriever_model = WeaviateRM("WeaviateBlogChunk", weaviate_client=weaviate_client)
-dspy.settings.configure(rm=retriever_model)
-
-retrieve = dspy.Retrieve(k=1)
-topK_passages = retrieve("what are the stages in planning, sanctioning and execution of public works").passages
-
-assert(type(topK_passages))
-"""
\ No newline at end of file