deepset-mcp 0.0.3rc1__py3-none-any.whl → 0.0.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- deepset_mcp/__init__.py +10 -0
- deepset_mcp/api/__init__.py +4 -0
- deepset_mcp/api/client.py +4 -0
- deepset_mcp/api/custom_components/__init__.py +4 -0
- deepset_mcp/api/custom_components/models.py +4 -0
- deepset_mcp/api/custom_components/protocols.py +4 -0
- deepset_mcp/api/custom_components/resource.py +4 -0
- deepset_mcp/api/exceptions.py +4 -0
- deepset_mcp/api/haystack_service/__init__.py +4 -0
- deepset_mcp/api/haystack_service/protocols.py +4 -0
- deepset_mcp/api/haystack_service/resource.py +4 -0
- deepset_mcp/api/indexes/__init__.py +4 -0
- deepset_mcp/api/indexes/models.py +4 -0
- deepset_mcp/api/indexes/protocols.py +4 -0
- deepset_mcp/api/indexes/resource.py +4 -0
- deepset_mcp/api/integrations/__init__.py +4 -0
- deepset_mcp/api/integrations/models.py +4 -0
- deepset_mcp/api/integrations/protocols.py +4 -0
- deepset_mcp/api/integrations/resource.py +4 -0
- deepset_mcp/api/pipeline/__init__.py +4 -0
- deepset_mcp/api/pipeline/log_level.py +4 -0
- deepset_mcp/api/pipeline/models.py +4 -0
- deepset_mcp/api/pipeline/protocols.py +8 -0
- deepset_mcp/api/pipeline/resource.py +4 -0
- deepset_mcp/api/pipeline_template/__init__.py +4 -0
- deepset_mcp/api/pipeline_template/models.py +4 -0
- deepset_mcp/api/pipeline_template/protocols.py +4 -0
- deepset_mcp/api/pipeline_template/resource.py +4 -0
- deepset_mcp/api/protocols.py +4 -0
- deepset_mcp/api/secrets/__init__.py +4 -0
- deepset_mcp/api/secrets/models.py +4 -0
- deepset_mcp/api/secrets/protocols.py +4 -0
- deepset_mcp/api/secrets/resource.py +4 -0
- deepset_mcp/api/shared_models.py +4 -0
- deepset_mcp/api/transport.py +4 -0
- deepset_mcp/api/user/__init__.py +4 -0
- deepset_mcp/api/user/protocols.py +4 -0
- deepset_mcp/api/user/resource.py +4 -0
- deepset_mcp/api/workspace/__init__.py +4 -0
- deepset_mcp/api/workspace/models.py +4 -0
- deepset_mcp/api/workspace/protocols.py +4 -0
- deepset_mcp/api/workspace/resource.py +4 -0
- deepset_mcp/config.py +8 -0
- deepset_mcp/initialize_embedding_model.py +4 -0
- deepset_mcp/main.py +8 -0
- deepset_mcp/store.py +4 -0
- deepset_mcp/tool_factory.py +11 -4
- deepset_mcp/tools/__init__.py +4 -0
- deepset_mcp/tools/custom_components.py +4 -0
- deepset_mcp/tools/doc_search.py +4 -0
- deepset_mcp/tools/haystack_service.py +4 -0
- deepset_mcp/tools/haystack_service_models.py +4 -0
- deepset_mcp/tools/indexes.py +4 -0
- deepset_mcp/tools/model_protocol.py +4 -0
- deepset_mcp/tools/pipeline.py +4 -0
- deepset_mcp/tools/pipeline_template.py +4 -0
- deepset_mcp/tools/secrets.py +4 -0
- deepset_mcp/tools/tokonomics/__init__.py +4 -0
- deepset_mcp/tools/tokonomics/decorators.py +4 -0
- deepset_mcp/tools/tokonomics/explorer.py +4 -0
- deepset_mcp/tools/tokonomics/object_store.py +4 -0
- deepset_mcp/tools/workspace.py +4 -0
- deepset_mcp-0.0.4.dist-info/METADATA +761 -0
- deepset_mcp-0.0.4.dist-info/RECORD +70 -0
- {deepset_mcp-0.0.3rc1.dist-info → deepset_mcp-0.0.4.dist-info}/entry_points.txt +0 -1
- deepset_mcp-0.0.4.dist-info/licenses/LICENSE +202 -0
- deepset_mcp/agents/__init__.py +0 -0
- deepset_mcp/agents/debugging/__init__.py +0 -0
- deepset_mcp/agents/debugging/debugging_agent.py +0 -37
- deepset_mcp/agents/debugging/system_prompt.md +0 -214
- deepset_mcp/agents/generalist/__init__.py +0 -0
- deepset_mcp/agents/generalist/generalist_agent.py +0 -38
- deepset_mcp/agents/generalist/system_prompt.md +0 -241
- deepset_mcp/benchmark/README.md +0 -425
- deepset_mcp/benchmark/__init__.py +0 -1
- deepset_mcp/benchmark/agent_configs/debugging_agent.yml +0 -10
- deepset_mcp/benchmark/agent_configs/generalist_agent.yml +0 -6
- deepset_mcp/benchmark/dp_validation_error_analysis/__init__.py +0 -0
- deepset_mcp/benchmark/dp_validation_error_analysis/eda.ipynb +0 -757
- deepset_mcp/benchmark/dp_validation_error_analysis/prepare_interaction_data.ipynb +0 -167
- deepset_mcp/benchmark/dp_validation_error_analysis/preprocessing_utils.py +0 -213
- deepset_mcp/benchmark/runner/__init__.py +0 -0
- deepset_mcp/benchmark/runner/agent_benchmark_runner.py +0 -561
- deepset_mcp/benchmark/runner/agent_loader.py +0 -110
- deepset_mcp/benchmark/runner/cli.py +0 -39
- deepset_mcp/benchmark/runner/cli_agent.py +0 -373
- deepset_mcp/benchmark/runner/cli_index.py +0 -71
- deepset_mcp/benchmark/runner/cli_pipeline.py +0 -73
- deepset_mcp/benchmark/runner/cli_tests.py +0 -226
- deepset_mcp/benchmark/runner/cli_utils.py +0 -61
- deepset_mcp/benchmark/runner/config.py +0 -73
- deepset_mcp/benchmark/runner/config_loader.py +0 -64
- deepset_mcp/benchmark/runner/interactive.py +0 -140
- deepset_mcp/benchmark/runner/models.py +0 -203
- deepset_mcp/benchmark/runner/repl.py +0 -67
- deepset_mcp/benchmark/runner/setup_actions.py +0 -238
- deepset_mcp/benchmark/runner/streaming.py +0 -360
- deepset_mcp/benchmark/runner/teardown_actions.py +0 -196
- deepset_mcp/benchmark/runner/tracing.py +0 -21
- deepset_mcp/benchmark/tasks/chat_rag_answers_wrong_format.yml +0 -16
- deepset_mcp/benchmark/tasks/documents_output_wrong.yml +0 -13
- deepset_mcp/benchmark/tasks/jinja_str_instead_of_complex_type.yml +0 -11
- deepset_mcp/benchmark/tasks/jinja_syntax_error.yml +0 -11
- deepset_mcp/benchmark/tasks/missing_output_mapping.yml +0 -14
- deepset_mcp/benchmark/tasks/no_query_input.yml +0 -13
- deepset_mcp/benchmark/tasks/pipelines/chat_agent_jinja_str.yml +0 -141
- deepset_mcp/benchmark/tasks/pipelines/chat_agent_jinja_syntax.yml +0 -141
- deepset_mcp/benchmark/tasks/pipelines/chat_rag_answers_wrong_format.yml +0 -181
- deepset_mcp/benchmark/tasks/pipelines/chat_rag_missing_output_mapping.yml +0 -189
- deepset_mcp/benchmark/tasks/pipelines/rag_documents_wrong_format.yml +0 -193
- deepset_mcp/benchmark/tasks/pipelines/rag_no_query_input.yml +0 -191
- deepset_mcp/benchmark/tasks/pipelines/standard_index.yml +0 -167
- deepset_mcp-0.0.3rc1.dist-info/METADATA +0 -289
- deepset_mcp-0.0.3rc1.dist-info/RECORD +0 -115
- {deepset_mcp-0.0.3rc1.dist-info → deepset_mcp-0.0.4.dist-info}/WHEEL +0 -0
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
components:
|
|
2
|
-
chat_summary_prompt_builder:
|
|
3
|
-
type: haystack.components.builders.prompt_builder.PromptBuilder
|
|
4
|
-
init_parameters:
|
|
5
|
-
template: |-
|
|
6
|
-
You are part of a chatbot.
|
|
7
|
-
You receive a question (Current Question) and a chat history.
|
|
8
|
-
Use the context from the chat history and reformulate the question so that it is suitable for retrieval augmented generation.
|
|
9
|
-
If X is followed by Y, only ask for Y and do not repeat X again.
|
|
10
|
-
If the question does not require any context from the chat history, output it unedited.
|
|
11
|
-
Don't make questions too long, but short and precise.
|
|
12
|
-
Stay as close as possible to the current question.
|
|
13
|
-
Only output the new question, nothing else!
|
|
14
|
-
|
|
15
|
-
{{ question }}
|
|
16
|
-
|
|
17
|
-
New question:
|
|
18
|
-
|
|
19
|
-
chat_summary_llm:
|
|
20
|
-
type: haystack.components.generators.openai.OpenAIGenerator
|
|
21
|
-
init_parameters:
|
|
22
|
-
api_key: {"type": "env_var", "env_vars": ["OPENAI_API_KEY"], "strict": false}
|
|
23
|
-
model: "gpt-4o"
|
|
24
|
-
generation_kwargs:
|
|
25
|
-
max_tokens: 650
|
|
26
|
-
temperature: 0
|
|
27
|
-
seed: 0
|
|
28
|
-
|
|
29
|
-
replies_to_query:
|
|
30
|
-
type: haystack.components.converters.output_adapter.OutputAdapter
|
|
31
|
-
init_parameters:
|
|
32
|
-
template: "{{ replies[0] }}"
|
|
33
|
-
output_type: str
|
|
34
|
-
|
|
35
|
-
bm25_retriever: # Selects the most similar documents from the document store
|
|
36
|
-
type: haystack_integrations.components.retrievers.opensearch.bm25_retriever.OpenSearchBM25Retriever
|
|
37
|
-
init_parameters:
|
|
38
|
-
document_store:
|
|
39
|
-
type: haystack_integrations.document_stores.opensearch.document_store.OpenSearchDocumentStore
|
|
40
|
-
init_parameters:
|
|
41
|
-
hosts:
|
|
42
|
-
index: 'standard-index'
|
|
43
|
-
max_chunk_bytes: 104857600
|
|
44
|
-
embedding_dim: 768
|
|
45
|
-
return_embedding: false
|
|
46
|
-
method:
|
|
47
|
-
mappings:
|
|
48
|
-
settings:
|
|
49
|
-
create_index: true
|
|
50
|
-
http_auth:
|
|
51
|
-
use_ssl:
|
|
52
|
-
verify_certs:
|
|
53
|
-
timeout:
|
|
54
|
-
top_k: 20 # The number of results to return
|
|
55
|
-
|
|
56
|
-
query_embedder:
|
|
57
|
-
type: deepset_cloud_custom_nodes.embedders.nvidia.text_embedder.DeepsetNvidiaTextEmbedder
|
|
58
|
-
init_parameters:
|
|
59
|
-
normalize_embeddings: true
|
|
60
|
-
model: intfloat/e5-base-v2
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
embedding_retriever: # Selects the most similar documents from the document store
|
|
64
|
-
type: haystack_integrations.components.retrievers.opensearch.embedding_retriever.OpenSearchEmbeddingRetriever
|
|
65
|
-
init_parameters:
|
|
66
|
-
document_store:
|
|
67
|
-
type: haystack_integrations.document_stores.opensearch.document_store.OpenSearchDocumentStore
|
|
68
|
-
init_parameters:
|
|
69
|
-
hosts:
|
|
70
|
-
index: 'standard-index'
|
|
71
|
-
max_chunk_bytes: 104857600
|
|
72
|
-
embedding_dim: 768
|
|
73
|
-
return_embedding: false
|
|
74
|
-
method:
|
|
75
|
-
mappings:
|
|
76
|
-
settings:
|
|
77
|
-
create_index: true
|
|
78
|
-
http_auth:
|
|
79
|
-
use_ssl:
|
|
80
|
-
verify_certs:
|
|
81
|
-
timeout:
|
|
82
|
-
top_k: 20 # The number of results to return
|
|
83
|
-
|
|
84
|
-
document_joiner:
|
|
85
|
-
type: haystack.components.joiners.document_joiner.DocumentJoiner
|
|
86
|
-
init_parameters:
|
|
87
|
-
join_mode: concatenate
|
|
88
|
-
|
|
89
|
-
ranker:
|
|
90
|
-
type: deepset_cloud_custom_nodes.rankers.nvidia.ranker.DeepsetNvidiaRanker
|
|
91
|
-
init_parameters:
|
|
92
|
-
model: intfloat/simlm-msmarco-reranker
|
|
93
|
-
top_k: 8
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
qa_prompt_builder:
|
|
97
|
-
type: haystack.components.builders.prompt_builder.PromptBuilder
|
|
98
|
-
init_parameters:
|
|
99
|
-
template: |-
|
|
100
|
-
You are a technical expert.
|
|
101
|
-
You answer questions truthfully based on provided documents.
|
|
102
|
-
Ignore typing errors in the question.
|
|
103
|
-
For each document check whether it is related to the question.
|
|
104
|
-
Only use documents that are related to the question to answer it.
|
|
105
|
-
Ignore documents that are not related to the question.
|
|
106
|
-
If the answer exists in several documents, summarize them.
|
|
107
|
-
Only answer based on the documents provided. Don't make things up.
|
|
108
|
-
Just output the structured, informative and precise answer and nothing else.
|
|
109
|
-
If the documents can't answer the question, say so.
|
|
110
|
-
Always use references in the form [NUMBER OF DOCUMENT] when using information from a document, e.g. [3] for Document [3] .
|
|
111
|
-
Never name the documents, only enter a number in square brackets as a reference.
|
|
112
|
-
The reference must only refer to the number that comes in square brackets after the document.
|
|
113
|
-
Otherwise, do not use brackets in your answer and reference ONLY the number of the document without mentioning the word document.
|
|
114
|
-
|
|
115
|
-
These are the documents:
|
|
116
|
-
{%- if documents|length > 0 %}
|
|
117
|
-
{%- for document in documents %}
|
|
118
|
-
Document [{{ loop.index }}] :
|
|
119
|
-
Name of Source File: {{ document.meta.file_name }}
|
|
120
|
-
{{ document.content }}
|
|
121
|
-
{% endfor -%}
|
|
122
|
-
{%- else %}
|
|
123
|
-
No relevant documents found.
|
|
124
|
-
Respond with "Sorry, no matching documents were found, please adjust the filters or try a different question."
|
|
125
|
-
{% endif %}
|
|
126
|
-
|
|
127
|
-
Question: {{ question }}
|
|
128
|
-
Answer:
|
|
129
|
-
|
|
130
|
-
qa_llm:
|
|
131
|
-
type: haystack.components.generators.openai.OpenAIGenerator
|
|
132
|
-
init_parameters:
|
|
133
|
-
api_key: {"type": "env_var", "env_vars": ["OPENAI_API_KEY"], "strict": false}
|
|
134
|
-
model: "gpt-4o"
|
|
135
|
-
generation_kwargs:
|
|
136
|
-
max_tokens: 650
|
|
137
|
-
temperature: 0
|
|
138
|
-
seed: 0
|
|
139
|
-
|
|
140
|
-
answer_builder:
|
|
141
|
-
type: deepset_cloud_custom_nodes.augmenters.deepset_answer_builder.DeepsetAnswerBuilder
|
|
142
|
-
init_parameters:
|
|
143
|
-
reference_pattern: acm
|
|
144
|
-
|
|
145
|
-
connections: # Defines how the components are connected
|
|
146
|
-
- sender: chat_summary_prompt_builder.prompt
|
|
147
|
-
receiver: chat_summary_llm.prompt
|
|
148
|
-
- sender: chat_summary_llm.replies
|
|
149
|
-
receiver: replies_to_query.replies
|
|
150
|
-
- sender: replies_to_query.output
|
|
151
|
-
receiver: bm25_retriever.query
|
|
152
|
-
- sender: replies_to_query.output
|
|
153
|
-
receiver: query_embedder.text
|
|
154
|
-
- sender: replies_to_query.output
|
|
155
|
-
receiver: ranker.query
|
|
156
|
-
- sender: replies_to_query.output
|
|
157
|
-
receiver: qa_prompt_builder.question
|
|
158
|
-
- sender: replies_to_query.output
|
|
159
|
-
receiver: answer_builder.query
|
|
160
|
-
- sender: bm25_retriever.documents
|
|
161
|
-
receiver: document_joiner.documents
|
|
162
|
-
- sender: query_embedder.embedding
|
|
163
|
-
receiver: embedding_retriever.query_embedding
|
|
164
|
-
- sender: embedding_retriever.documents
|
|
165
|
-
receiver: document_joiner.documents
|
|
166
|
-
- sender: document_joiner.documents
|
|
167
|
-
receiver: ranker.documents
|
|
168
|
-
- sender: ranker.documents
|
|
169
|
-
receiver: qa_prompt_builder.documents
|
|
170
|
-
- sender: ranker.documents
|
|
171
|
-
receiver: answer_builder.documents
|
|
172
|
-
- sender: qa_prompt_builder.prompt
|
|
173
|
-
receiver: qa_llm.prompt
|
|
174
|
-
- sender: qa_prompt_builder.prompt
|
|
175
|
-
receiver: answer_builder.prompt
|
|
176
|
-
- sender: qa_llm.replies
|
|
177
|
-
receiver: answer_builder.replies
|
|
178
|
-
|
|
179
|
-
inputs: # Define the inputs for your pipeline
|
|
180
|
-
query: # These components will receive the query as input
|
|
181
|
-
- "chat_summary_prompt_builder.question"
|
|
182
|
-
|
|
183
|
-
filters: # These components will receive a potential query filter as input
|
|
184
|
-
- "bm25_retriever.filters"
|
|
185
|
-
- "embedding_retriever.filters"
|
|
186
|
-
|
|
187
|
-
outputs: # Defines the output of your pipeline
|
|
188
|
-
documents: "qa_prompt_builder.prompt" # The output of the pipeline is the retrieved documents
|
|
189
|
-
answers: "answer_builder.answers" # The output of the pipeline is the generated answers
|
|
190
|
-
|
|
191
|
-
max_runs_per_component: 100
|
|
192
|
-
|
|
193
|
-
metadata: {}
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
components:
|
|
2
|
-
chat_summary_prompt_builder:
|
|
3
|
-
type: haystack.components.builders.prompt_builder.PromptBuilder
|
|
4
|
-
init_parameters:
|
|
5
|
-
template: |-
|
|
6
|
-
You are part of a chatbot.
|
|
7
|
-
You receive a question (Current Question) and a chat history.
|
|
8
|
-
Use the context from the chat history and reformulate the question so that it is suitable for retrieval augmented generation.
|
|
9
|
-
If X is followed by Y, only ask for Y and do not repeat X again.
|
|
10
|
-
If the question does not require any context from the chat history, output it unedited.
|
|
11
|
-
Don't make questions too long, but short and precise.
|
|
12
|
-
Stay as close as possible to the current question.
|
|
13
|
-
Only output the new question, nothing else!
|
|
14
|
-
|
|
15
|
-
{{ question }}
|
|
16
|
-
|
|
17
|
-
New question:
|
|
18
|
-
|
|
19
|
-
chat_summary_llm:
|
|
20
|
-
type: haystack.components.generators.openai.OpenAIGenerator
|
|
21
|
-
init_parameters:
|
|
22
|
-
api_key: {"type": "env_var", "env_vars": ["OPENAI_API_KEY"], "strict": false}
|
|
23
|
-
model: "gpt-4o"
|
|
24
|
-
generation_kwargs:
|
|
25
|
-
max_tokens: 650
|
|
26
|
-
temperature: 0
|
|
27
|
-
seed: 0
|
|
28
|
-
|
|
29
|
-
replies_to_query:
|
|
30
|
-
type: haystack.components.converters.output_adapter.OutputAdapter
|
|
31
|
-
init_parameters:
|
|
32
|
-
template: "{{ replies[0] }}"
|
|
33
|
-
output_type: str
|
|
34
|
-
|
|
35
|
-
bm25_retriever: # Selects the most similar documents from the document store
|
|
36
|
-
type: haystack_integrations.components.retrievers.opensearch.bm25_retriever.OpenSearchBM25Retriever
|
|
37
|
-
init_parameters:
|
|
38
|
-
document_store:
|
|
39
|
-
type: haystack_integrations.document_stores.opensearch.document_store.OpenSearchDocumentStore
|
|
40
|
-
init_parameters:
|
|
41
|
-
hosts:
|
|
42
|
-
index: 'standard-index'
|
|
43
|
-
max_chunk_bytes: 104857600
|
|
44
|
-
embedding_dim: 768
|
|
45
|
-
return_embedding: false
|
|
46
|
-
method:
|
|
47
|
-
mappings:
|
|
48
|
-
settings:
|
|
49
|
-
create_index: true
|
|
50
|
-
http_auth:
|
|
51
|
-
use_ssl:
|
|
52
|
-
verify_certs:
|
|
53
|
-
timeout:
|
|
54
|
-
top_k: 20 # The number of results to return
|
|
55
|
-
|
|
56
|
-
query_embedder:
|
|
57
|
-
type: deepset_cloud_custom_nodes.embedders.nvidia.text_embedder.DeepsetNvidiaTextEmbedder
|
|
58
|
-
init_parameters:
|
|
59
|
-
normalize_embeddings: true
|
|
60
|
-
model: intfloat/e5-base-v2
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
embedding_retriever: # Selects the most similar documents from the document store
|
|
64
|
-
type: haystack_integrations.components.retrievers.opensearch.embedding_retriever.OpenSearchEmbeddingRetriever
|
|
65
|
-
init_parameters:
|
|
66
|
-
document_store:
|
|
67
|
-
type: haystack_integrations.document_stores.opensearch.document_store.OpenSearchDocumentStore
|
|
68
|
-
init_parameters:
|
|
69
|
-
hosts:
|
|
70
|
-
index: 'standard-index'
|
|
71
|
-
max_chunk_bytes: 104857600
|
|
72
|
-
embedding_dim: 768
|
|
73
|
-
return_embedding: false
|
|
74
|
-
method:
|
|
75
|
-
mappings:
|
|
76
|
-
settings:
|
|
77
|
-
create_index: true
|
|
78
|
-
http_auth:
|
|
79
|
-
use_ssl:
|
|
80
|
-
verify_certs:
|
|
81
|
-
timeout:
|
|
82
|
-
top_k: 20 # The number of results to return
|
|
83
|
-
|
|
84
|
-
document_joiner:
|
|
85
|
-
type: haystack.components.joiners.document_joiner.DocumentJoiner
|
|
86
|
-
init_parameters:
|
|
87
|
-
join_mode: concatenate
|
|
88
|
-
|
|
89
|
-
ranker:
|
|
90
|
-
type: deepset_cloud_custom_nodes.rankers.nvidia.ranker.DeepsetNvidiaRanker
|
|
91
|
-
init_parameters:
|
|
92
|
-
model: intfloat/simlm-msmarco-reranker
|
|
93
|
-
top_k: 8
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
qa_prompt_builder:
|
|
97
|
-
type: haystack.components.builders.prompt_builder.PromptBuilder
|
|
98
|
-
init_parameters:
|
|
99
|
-
template: |-
|
|
100
|
-
You are a technical expert.
|
|
101
|
-
You answer questions truthfully based on provided documents.
|
|
102
|
-
Ignore typing errors in the question.
|
|
103
|
-
For each document check whether it is related to the question.
|
|
104
|
-
Only use documents that are related to the question to answer it.
|
|
105
|
-
Ignore documents that are not related to the question.
|
|
106
|
-
If the answer exists in several documents, summarize them.
|
|
107
|
-
Only answer based on the documents provided. Don't make things up.
|
|
108
|
-
Just output the structured, informative and precise answer and nothing else.
|
|
109
|
-
If the documents can't answer the question, say so.
|
|
110
|
-
Always use references in the form [NUMBER OF DOCUMENT] when using information from a document, e.g. [3] for Document [3] .
|
|
111
|
-
Never name the documents, only enter a number in square brackets as a reference.
|
|
112
|
-
The reference must only refer to the number that comes in square brackets after the document.
|
|
113
|
-
Otherwise, do not use brackets in your answer and reference ONLY the number of the document without mentioning the word document.
|
|
114
|
-
|
|
115
|
-
These are the documents:
|
|
116
|
-
{%- if documents|length > 0 %}
|
|
117
|
-
{%- for document in documents %}
|
|
118
|
-
Document [{{ loop.index }}] :
|
|
119
|
-
Name of Source File: {{ document.meta.file_name }}
|
|
120
|
-
{{ document.content }}
|
|
121
|
-
{% endfor -%}
|
|
122
|
-
{%- else %}
|
|
123
|
-
No relevant documents found.
|
|
124
|
-
Respond with "Sorry, no matching documents were found, please adjust the filters or try a different question."
|
|
125
|
-
{% endif %}
|
|
126
|
-
|
|
127
|
-
Question: {{ question }}
|
|
128
|
-
Answer:
|
|
129
|
-
|
|
130
|
-
qa_llm:
|
|
131
|
-
type: haystack.components.generators.openai.OpenAIGenerator
|
|
132
|
-
init_parameters:
|
|
133
|
-
api_key: {"type": "env_var", "env_vars": ["OPENAI_API_KEY"], "strict": false}
|
|
134
|
-
model: "gpt-4o"
|
|
135
|
-
generation_kwargs:
|
|
136
|
-
max_tokens: 650
|
|
137
|
-
temperature: 0
|
|
138
|
-
seed: 0
|
|
139
|
-
|
|
140
|
-
answer_builder:
|
|
141
|
-
type: deepset_cloud_custom_nodes.augmenters.deepset_answer_builder.DeepsetAnswerBuilder
|
|
142
|
-
init_parameters:
|
|
143
|
-
reference_pattern: acm
|
|
144
|
-
|
|
145
|
-
connections: # Defines how the components are connected
|
|
146
|
-
- sender: chat_summary_prompt_builder.prompt
|
|
147
|
-
receiver: chat_summary_llm.prompt
|
|
148
|
-
- sender: chat_summary_llm.replies
|
|
149
|
-
receiver: replies_to_query.replies
|
|
150
|
-
- sender: replies_to_query.output
|
|
151
|
-
receiver: bm25_retriever.query
|
|
152
|
-
- sender: replies_to_query.output
|
|
153
|
-
receiver: query_embedder.text
|
|
154
|
-
- sender: replies_to_query.output
|
|
155
|
-
receiver: ranker.query
|
|
156
|
-
- sender: replies_to_query.output
|
|
157
|
-
receiver: qa_prompt_builder.question
|
|
158
|
-
- sender: replies_to_query.output
|
|
159
|
-
receiver: answer_builder.query
|
|
160
|
-
- sender: bm25_retriever.documents
|
|
161
|
-
receiver: document_joiner.documents
|
|
162
|
-
- sender: query_embedder.embedding
|
|
163
|
-
receiver: embedding_retriever.query_embedding
|
|
164
|
-
- sender: embedding_retriever.documents
|
|
165
|
-
receiver: document_joiner.documents
|
|
166
|
-
- sender: document_joiner.documents
|
|
167
|
-
receiver: ranker.documents
|
|
168
|
-
- sender: ranker.documents
|
|
169
|
-
receiver: qa_prompt_builder.documents
|
|
170
|
-
- sender: ranker.documents
|
|
171
|
-
receiver: answer_builder.documents
|
|
172
|
-
- sender: qa_prompt_builder.prompt
|
|
173
|
-
receiver: qa_llm.prompt
|
|
174
|
-
- sender: qa_prompt_builder.prompt
|
|
175
|
-
receiver: answer_builder.prompt
|
|
176
|
-
- sender: qa_llm.replies
|
|
177
|
-
receiver: answer_builder.replies
|
|
178
|
-
|
|
179
|
-
inputs: # Define the inputs for your pipeline
|
|
180
|
-
|
|
181
|
-
filters: # These components will receive a potential query filter as input
|
|
182
|
-
- "bm25_retriever.filters"
|
|
183
|
-
- "embedding_retriever.filters"
|
|
184
|
-
|
|
185
|
-
outputs: # Defines the output of your pipeline
|
|
186
|
-
documents: "ranker.documents" # The output of the pipeline is the retrieved documents
|
|
187
|
-
answers: "answer_builder.answers" # The output of the pipeline is the generated answers
|
|
188
|
-
|
|
189
|
-
max_runs_per_component: 100
|
|
190
|
-
|
|
191
|
-
metadata: {}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
# If you need help with the YAML format, have a look at https://docs.cloud.deepset.ai/v2.0/docs/create-a-pipeline#create-a-pipeline-using-pipeline-editor.
|
|
2
|
-
# This section defines components that you want to use in your pipelines. Each component must have a name and a type. You can also set the component's parameters here.
|
|
3
|
-
# The name is up to you, you can give your component a friendly name. You then use components' names when specifying the connections in the pipeline.
|
|
4
|
-
# Type is the class path of the component. You can check the type on the component's documentation page.
|
|
5
|
-
components:
|
|
6
|
-
file_classifier:
|
|
7
|
-
type: haystack.components.routers.file_type_router.FileTypeRouter
|
|
8
|
-
init_parameters:
|
|
9
|
-
mime_types:
|
|
10
|
-
- text/plain
|
|
11
|
-
- application/pdf
|
|
12
|
-
- text/markdown
|
|
13
|
-
- text/html
|
|
14
|
-
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
|
15
|
-
- application/vnd.openxmlformats-officedocument.presentationml.presentation
|
|
16
|
-
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
|
17
|
-
- text/csv
|
|
18
|
-
|
|
19
|
-
text_converter:
|
|
20
|
-
type: haystack.components.converters.txt.TextFileToDocument
|
|
21
|
-
init_parameters:
|
|
22
|
-
encoding: utf-8
|
|
23
|
-
|
|
24
|
-
pdf_converter:
|
|
25
|
-
type: haystack.components.converters.pdfminer.PDFMinerToDocument
|
|
26
|
-
init_parameters:
|
|
27
|
-
line_overlap: 0.5
|
|
28
|
-
char_margin: 2
|
|
29
|
-
line_margin: 0.5
|
|
30
|
-
word_margin: 0.1
|
|
31
|
-
boxes_flow: 0.5
|
|
32
|
-
detect_vertical: true
|
|
33
|
-
all_texts: false
|
|
34
|
-
store_full_path: false
|
|
35
|
-
|
|
36
|
-
markdown_converter:
|
|
37
|
-
type: haystack.components.converters.txt.TextFileToDocument
|
|
38
|
-
init_parameters:
|
|
39
|
-
encoding: utf-8
|
|
40
|
-
|
|
41
|
-
html_converter:
|
|
42
|
-
type: haystack.components.converters.html.HTMLToDocument
|
|
43
|
-
init_parameters:
|
|
44
|
-
# A dictionary of keyword arguments to customize how you want to extract content from your HTML files.
|
|
45
|
-
# For the full list of available arguments, see
|
|
46
|
-
# the [Trafilatura documentation](https://trafilatura.readthedocs.io/en/latest/corefunctions.html#extract).
|
|
47
|
-
extraction_kwargs:
|
|
48
|
-
output_format: markdown # Extract text from HTML. You can also also choose "txt"
|
|
49
|
-
target_language: # You can define a language (using the ISO 639-1 format) to discard documents that don't match that language.
|
|
50
|
-
include_tables: true # If true, includes tables in the output
|
|
51
|
-
include_links: true # If true, keeps links along with their targets
|
|
52
|
-
|
|
53
|
-
docx_converter:
|
|
54
|
-
type: haystack.components.converters.docx.DOCXToDocument
|
|
55
|
-
init_parameters:
|
|
56
|
-
link_format: markdown
|
|
57
|
-
|
|
58
|
-
pptx_converter:
|
|
59
|
-
type: haystack.components.converters.pptx.PPTXToDocument
|
|
60
|
-
init_parameters: {}
|
|
61
|
-
|
|
62
|
-
xlsx_converter:
|
|
63
|
-
type: haystack.components.converters.xlsx.XLSXToDocument
|
|
64
|
-
init_parameters: {}
|
|
65
|
-
|
|
66
|
-
csv_converter:
|
|
67
|
-
type: haystack.components.converters.csv.CSVToDocument
|
|
68
|
-
init_parameters:
|
|
69
|
-
encoding: utf-8
|
|
70
|
-
|
|
71
|
-
joiner:
|
|
72
|
-
type: haystack.components.joiners.document_joiner.DocumentJoiner
|
|
73
|
-
init_parameters:
|
|
74
|
-
join_mode: concatenate
|
|
75
|
-
sort_by_score: false
|
|
76
|
-
|
|
77
|
-
joiner_xlsx: # merge split documents with non-split xlsx documents
|
|
78
|
-
type: haystack.components.joiners.document_joiner.DocumentJoiner
|
|
79
|
-
init_parameters:
|
|
80
|
-
join_mode: concatenate
|
|
81
|
-
sort_by_score: false
|
|
82
|
-
|
|
83
|
-
splitter:
|
|
84
|
-
type: haystack.components.preprocessors.document_splitter.DocumentSplitter
|
|
85
|
-
init_parameters:
|
|
86
|
-
split_by: word
|
|
87
|
-
split_length: 250
|
|
88
|
-
split_overlap: 30
|
|
89
|
-
respect_sentence_boundary: true
|
|
90
|
-
language: en
|
|
91
|
-
|
|
92
|
-
document_embedder:
|
|
93
|
-
type: haystack.components.embedders.sentence_transformers_document_embedder.SentenceTransformersDocumentEmbedder
|
|
94
|
-
init_parameters:
|
|
95
|
-
normalize_embeddings: true
|
|
96
|
-
model: intfloat/e5-base-v2
|
|
97
|
-
|
|
98
|
-
writer:
|
|
99
|
-
type: haystack.components.writers.document_writer.DocumentWriter
|
|
100
|
-
init_parameters:
|
|
101
|
-
document_store:
|
|
102
|
-
type: haystack_integrations.document_stores.opensearch.document_store.OpenSearchDocumentStore
|
|
103
|
-
init_parameters:
|
|
104
|
-
hosts:
|
|
105
|
-
index: ''
|
|
106
|
-
max_chunk_bytes: 104857600
|
|
107
|
-
embedding_dim: 768
|
|
108
|
-
return_embedding: false
|
|
109
|
-
method:
|
|
110
|
-
mappings:
|
|
111
|
-
settings:
|
|
112
|
-
create_index: true
|
|
113
|
-
http_auth:
|
|
114
|
-
use_ssl:
|
|
115
|
-
verify_certs:
|
|
116
|
-
timeout:
|
|
117
|
-
policy: OVERWRITE
|
|
118
|
-
|
|
119
|
-
connections: # Defines how the components are connected
|
|
120
|
-
- sender: file_classifier.text/plain
|
|
121
|
-
receiver: text_converter.sources
|
|
122
|
-
- sender: file_classifier.application/pdf
|
|
123
|
-
receiver: pdf_converter.sources
|
|
124
|
-
- sender: file_classifier.text/markdown
|
|
125
|
-
receiver: markdown_converter.sources
|
|
126
|
-
- sender: file_classifier.text/html
|
|
127
|
-
receiver: html_converter.sources
|
|
128
|
-
- sender: file_classifier.application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
|
129
|
-
receiver: docx_converter.sources
|
|
130
|
-
- sender: file_classifier.application/vnd.openxmlformats-officedocument.presentationml.presentation
|
|
131
|
-
receiver: pptx_converter.sources
|
|
132
|
-
- sender: file_classifier.application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
|
133
|
-
receiver: xlsx_converter.sources
|
|
134
|
-
- sender: file_classifier.text/csv
|
|
135
|
-
receiver: csv_converter.sources
|
|
136
|
-
- sender: text_converter.documents
|
|
137
|
-
receiver: joiner.documents
|
|
138
|
-
- sender: pdf_converter.documents
|
|
139
|
-
receiver: joiner.documents
|
|
140
|
-
- sender: markdown_converter.documents
|
|
141
|
-
receiver: joiner.documents
|
|
142
|
-
- sender: html_converter.documents
|
|
143
|
-
receiver: joiner.documents
|
|
144
|
-
- sender: docx_converter.documents
|
|
145
|
-
receiver: joiner.documents
|
|
146
|
-
- sender: pptx_converter.documents
|
|
147
|
-
receiver: joiner.documents
|
|
148
|
-
- sender: joiner.documents
|
|
149
|
-
receiver: splitter.documents
|
|
150
|
-
- sender: splitter.documents
|
|
151
|
-
receiver: joiner_xlsx.documents
|
|
152
|
-
- sender: xlsx_converter.documents
|
|
153
|
-
receiver: joiner_xlsx.documents
|
|
154
|
-
- sender: csv_converter.documents
|
|
155
|
-
receiver: joiner_xlsx.documents
|
|
156
|
-
- sender: joiner_xlsx.documents
|
|
157
|
-
receiver: document_embedder.documents
|
|
158
|
-
- sender: document_embedder.documents
|
|
159
|
-
receiver: writer.documents
|
|
160
|
-
|
|
161
|
-
inputs: # Define the inputs for your pipeline
|
|
162
|
-
files: # This component will receive the files to index as input
|
|
163
|
-
- file_classifier.sources
|
|
164
|
-
|
|
165
|
-
max_runs_per_component: 100
|
|
166
|
-
|
|
167
|
-
metadata: {}
|