File size: 1,437 Bytes
37c1830
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
node_lines:
  - node_line_name: retrieve_node_line
    nodes:
      - modules:
          - module_type: vectordb
            embedding_model: openai
            top_k: 5
        node_type: retrieval
        strategy:
          metrics:
            - retrieval_f1
            - retrieval_recall
            - retrieval_precision
  - node_line_name: post_retrieve_node_line
    nodes:
      - modules:
          - module_type: fstring
            prompt: "You are the helpful assistant to answer the question. I will give you a context to read. The context can be unrelated to the question.
            If the context is related, you must answer the question base on the context.
            If there is no context that relates to the question, you must say that you don't know about the answer.
            DO NOT MAKE UP THE ANSWER.
            If you can solve the question with your own knowledge, you can answer the question. But please do not lie or make up the answer without relevant information.
            Question: {query} \n Context: {retrieved_contents} \n Answer : "
        node_type: prompt_maker
        strategy:
          metrics:
            - bleu
            - meteor
            - rouge
      - modules:
          - llm: openai
            model: gpt-4o-mini
            module_type: llama_index_llm
            temperature: 1.0
        node_type: generator
        strategy:
          metrics:
            - rouge