@@ -57,22 +57,36 @@ AZURE_LLM_DEPLOYMENT_MODEL=gpt-35-turbo
5757
5858## Testing using a retriever with a basic query
5959
60- You are now ready to test the example retriever. Run the following to ask a question with the
61- results augmented via the ` marklogic_retriever .py` module in this project; you will be
62- prompted for an AzureOpenAI API key when you run this, which you can type or paste in :
60+ You are now ready to test the example retriever. Run the following to ask a question
61+ with the results augmented via the ` marklogic_similar_query_retriever .py` module in this
62+ project :
6363
6464 python ask_similar_query.py "What is task decomposition?" posts
6565
66- The retriever uses a [ cts.similarQuery] ( https://docs.marklogic.com/cts.similarQuery ) to select from the documents
67- loaded via ` load_data.py ` . It defaults to a page length of 10. You can change this by providing a command line
68- argument - e.g.:
66+ The retriever uses a [ cts.similarQuery] ( https://docs.marklogic.com/cts.similarQuery ) to
67+ select from the documents loaded via ` load_data.py ` . It defaults to a page length of 10.
68+ You can change this by providing a command line argument - e.g.:
6969
7070 python ask_similar_query.py "What is task decomposition?" posts 15
7171
7272Example of a question for the "sotu" (State of the Union speech) collection:
7373
7474 python ask_similar_query.py "What are economic sanctions?" sotu 20
7575
76- To use a word query instead of a similar query, along with a set of drop words, specify "word" as the 4th argument:
76+ To use a word query instead of a similar query, along with a set of drop words, specify
77+ "word" as the 4th argument:
7778
7879 python ask_similar_query.py "What are economic sanctions?" sotu 20 word
80+
81+ ## Testing using a retriever with a contextual query
82+
83+ There may be times when your langchain application needs to use both a question and a
84+ structured query during the document retrieval process. To see an example of this, run
85+ the following to ask a question. That question is combined with a hard-coded structured
86+ query using the ` marklogic_contextual_query_retriever.py ` module in this project.
87+
88+ python ask_contextual_query.py "What is task decomposition?" posts
89+
90+ This retriever builds a term-query using words from the question. Then the term-query is
91+ added to the structured query and the merged query is used to select from the documents
92+ loaded via ` load_data.py ` .
0 commit comments