llama-index

Форк
0
140 строк · 3.8 Кб
1
"""Subclasses from base prompt."""
2

3
from llama_index.legacy.prompts.base import PromptTemplate
4

5
# deprecated, kept for backward compatibility
6

7
"""Summary prompt.
8

9
PromptTemplate to summarize the provided `context_str`.
10

11
Required template variables: `context_str`
12
"""
13
SummaryPrompt = PromptTemplate
14

15
"""Tree Insert prompt.
16

17
PromptTemplate to insert a new chunk of text `new_chunk_text` into the tree index.
18
More specifically, this prompt has the LLM select the relevant candidate
19
child node to continue tree traversal.
20

21
Required template variables: `num_chunks`, `context_list`, `new_chunk_text`
22
"""
23
TreeInsertPrompt = PromptTemplate
24

25
"""Tree select prompt.
26

27
PromptTemplate to select a candidate child node out of all child nodes
28
provided in `context_list`, given a query `query_str`. `num_chunks` is
29
the number of child nodes in `context_list`.
30

31
Required template variables: `num_chunks`, `context_list`, `query_str`
32

33
"""
34
TreeSelectPrompt = PromptTemplate
35

36
"""Tree select multiple prompt.
37

38
PromptTemplate to select multiple candidate child nodes out of all
39
child nodes provided in `context_list`, given a query `query_str`.
40
`branching_factor` refers to the number of child nodes to select, and
41
`num_chunks` is the number of child nodes in `context_list`.
42

43
Required template variables: `num_chunks`, `context_list`, `query_str`,
44
    `branching_factor`
45
"""
46
TreeSelectMultiplePrompt = PromptTemplate
47

48
"""Refine prompt.
49

50
PromptTemplate to refine an existing answer `existing_answer`
51
given a context `context_msg`, and a query `query_str`.
52

53
Required template variables: `query_str`, `existing_answer`, `context_msg`
54
"""
55
RefinePrompt = PromptTemplate
56

57
"""Question Answer prompt.
58

59
PromptTemplate to answer a question `query_str` given a context `context_str`.
60

61
Required template variables: `context_str`, `query_str`
62
"""
63
QuestionAnswerPrompt = PromptTemplate
64

65
"""Keyword extract prompt.
66

67
PromptTemplate to extract keywords from a text `text` with a maximum of
68
`max_keywords` keywords.
69

70
Required template variables: `text`, `max_keywords`
71
"""
72
KeywordExtractPrompt = PromptTemplate
73

74
"""Query keyword extract prompt.
75

76
PromptTemplate to extract keywords from a query `query_str` with a maximum
77
of `max_keywords` keywords.
78

79
Required template variables: `query_str`, `max_keywords`
80
"""
81
QueryKeywordExtractPrompt = PromptTemplate
82

83
"""Schema extract prompt.
84

85
PromptTemplate to extract schema from unstructured text `text`.
86

87
Required template variables: `text`, `schema`
88
"""
89
SchemaExtractPrompt = PromptTemplate
90

91
"""Text to SQL prompt.
92

93
PromptTemplate to translate a natural language query into SQL in the dialect
94
`dialect` given a schema `schema`.
95

96
Required template variables: `query_str`, `schema`, `dialect`
97
"""
98
TextToSQLPrompt = PromptTemplate
99
"""Table context prompt.
100

101
PromptTemplate to generate a table context given a table schema `schema`,
102
as well as unstructured text context `context_str`, and
103
a task `query_str`.
104
This includes both a high-level description of the table
105
as well as a description of each column in the table.
106
"""
107
TableContextPrompt = PromptTemplate
108

109
"""Refine Table context prompt.
110

111
PromptTemplate to refine a table context given a table schema `schema`,
112
as well as unstructured text context `context_msg`, and
113
a task `query_str`.
114
This includes both a high-level description of the table
115
as well as a description of each column in the table.
116

117
"""
118
RefineTableContextPrompt = PromptTemplate
119

120
"""Define the knowledge graph triplet extraction prompt."""
121
KnowledgeGraphPrompt = PromptTemplate
122

123
"""Simple Input prompt.
124

125
Required template variables: `query_str`.
126
"""
127
SimpleInputPrompt = PromptTemplate
128

129
"""Pandas prompt. Convert query to python code.
130

131
Required template variables: `query_str`, `df_str`, `instruction_str`.
132
"""
133
PandasPrompt = PromptTemplate
134

135

136
"""Choice select prompt. Select from a list of choices.
137

138
Required template variables: `context_str`, `query_str`.
139
"""
140
ChoiceSelectPrompt = PromptTemplate
141

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.