File tree Expand file tree Collapse file tree
tests/search_document_store Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4949# interacting with LLMs using a custom prompt.
5050prompt_messages = [
5151 ChatMessage .from_system ("You are a helpful assistant that answers questions based on the provided documents." ),
52- ChatMessage .from_user (
53- """Given these documents, answer the question.
52+ ChatMessage .from_user ("""Given these documents, answer the question.
5453Documents:
5554{% for doc in documents %}
5655 {{ doc.content }}
5756{% endfor %}
5857
5958Question: {{question}}
60- Answer:"""
61- ),
59+ Answer:""" ),
6260]
6361rag_pipeline = Pipeline ()
6462rag_pipeline .add_component (
Original file line number Diff line number Diff line change 3737# interacting with LLMs using a custom prompt.
3838prompt_messages = [
3939 ChatMessage .from_system ("You are a helpful assistant that answers questions based on the provided documents." ),
40- ChatMessage .from_user (
41- """Given these documents, answer the question.
40+ ChatMessage .from_user ("""Given these documents, answer the question.
4241Documents:
4342{% for doc in documents %}
4443 {{ doc.content }}
4544{% endfor %}
4645
4746Question: {{question}}
48- Answer:"""
49- ),
47+ Answer:""" ),
5048]
5149rag_pipeline = Pipeline ()
5250rag_pipeline .add_component (
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ extra-dependencies = [
5959 " pytest" ,
6060 " pandas" ,
6161 " sentence-transformers" ,
62+ " sentence-transformers-haystack" ,
6263]
6364
6465[tool .hatch .envs .default .scripts ]
Original file line number Diff line number Diff line change 1818from couchbase .auth import PasswordAuthenticator
1919from couchbase_haystack import CouchbaseClusterOptions
2020from couchbase_haystack import CouchbasePasswordAuthenticator
21- from couchbase .management .logic . search_index_logic import SearchIndex
21+ from couchbase .management .search import SearchIndex
2222from couchbase .exceptions import SearchIndexNotFoundException
2323from datetime import timedelta
2424from sentence_transformers import SentenceTransformer
25- from couchbase .management .logic . collections_logic import ScopeSpec , CollectionSpec
25+ from couchbase .management .collections import ScopeSpec , CollectionSpec
2626from couchbase .result import SearchResult
2727
2828from ..common .common import IS_GLOBAL_LEVEL_INDEX
2929from ..common import common
3030
31-
3231model = SentenceTransformer ('all-MiniLM-L6-v2' )
3332
3433
Original file line number Diff line number Diff line change 1212from couchbase .cluster import Cluster , ClusterOptions
1313from couchbase .options import ClusterOptions , KnownConfigProfiles
1414from couchbase .auth import PasswordAuthenticator
15- from couchbase .management .logic . search_index_logic import SearchIndex
15+ from couchbase .management .search import SearchIndex
1616from couchbase .exceptions import SearchIndexNotFoundException
1717from couchbase import search
1818from couchbase_haystack .document_stores .search_filters import NumericRangeQuery
Original file line number Diff line number Diff line change 1212from haystack import GeneratedAnswer , Pipeline
1313from haystack .components .builders .answer_builder import AnswerBuilder
1414from haystack .components .builders .prompt_builder import PromptBuilder
15- from haystack .components .embedders import SentenceTransformersTextEmbedder
16- from haystack .components .generators import HuggingFaceAPIGenerator
15+ from haystack_integrations .components .embedders .sentence_transformers import SentenceTransformersTextEmbedder
1716import couchbase .search as search
1817from couchbase .search import SearchQuery
1918from tests .common .common import IS_GLOBAL_LEVEL_INDEX
You can’t perform that action at this time.
0 commit comments