Skip to content

Commit 82ab778

Browse files
committed
Adds more usage notes for conversational rag
1 parent 5b0f981 commit 82ab778

File tree

1 file changed

+22
-0
lines changed
  • contrib/hamilton/contrib/dagworks/conversational_rag

1 file changed

+22
-0
lines changed

contrib/hamilton/contrib/dagworks/conversational_rag/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,28 @@ specific question for the LLM given the found context.
1616

1717
## Example Usage
1818

19+
### Inputs
20+
These are the defined inputs you can provide.
21+
22+
- *input_texts*: A list of strings. Each string will be encoded into a vector and stored in the vector store.
23+
- *question*: A string. This is the question you want to ask the LLM, and vector store which will provide context.
24+
- *chat_history*: A list of strings. Each string is a line of conversation. They need to be prefixed with "Human" or "AI" to indicate who said it. They should be alternating.
25+
- *top_k*: An integer. This is the number of vectors to retrieve from the vector store. Defaults to 5.
26+
27+
### Overrides
28+
With Hamilton you can easily override a function and provide a value for it. For example if you're
29+
iterating you might just want to override these two values before modifying the functions:
30+
31+
- *context*: if you want to skip going to the vector store and provide the context directly, you can do so by providing this override.
32+
- *standalone_question*: if you want to skip the rewording of the question, you can provide the standalone question directly.
33+
- *answer_prompt*: if you want to provide the prompt to pass to the LLM, pass it in as an override.
34+
35+
### Execution
36+
You can ask to get back any result of an intermediate function by providing the function name in the `execute` call.
37+
Here we just ask for the final result, but if you wanted to, you could ask for outputs of any of the functions, which
38+
you can then introspect or log for debugging/evaluation purposes. Note if you want more platform integrations,
39+
you can add adapters that will do this automatically for you, e.g. like we have the `PrintLn` adapter here.
40+
1941
```python
2042
# import the module
2143
from hamilton import driver

0 commit comments

Comments
 (0)