forked from microsoft/promptflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflow.dag.yaml
81 lines (81 loc) · 1.83 KB
/
flow.dag.yaml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/Flow.schema.json
inputs:
chat_history:
type: list
default: []
pdf_url:
type: string
default: https://arxiv.org/pdf/1810.04805.pdf
question:
type: string
is_chat_input: true
default: what is BERT?
config:
type: object
default:
EMBEDDING_MODEL_DEPLOYMENT_NAME: text-embedding-ada-002
CHAT_MODEL_DEPLOYMENT_NAME: gpt-4
PROMPT_TOKEN_LIMIT: 3000
MAX_COMPLETION_TOKENS: 256
VERBOSE: true
CHUNK_SIZE: 1024
CHUNK_OVERLAP: 64
outputs:
answer:
type: string
is_chat_output: true
reference: ${qna_tool.output.answer}
context:
type: string
reference: ${find_context_tool.output.context}
nodes:
- name: setup_env
type: python
source:
type: code
path: setup_env.py
inputs:
connection: open_ai_connection
config: ${inputs.config}
- name: download_tool
type: python
source:
type: code
path: download_tool.py
inputs:
url: ${inputs.pdf_url}
env_ready_signal: ${setup_env.output}
- name: build_index_tool
type: python
source:
type: code
path: build_index_tool.py
inputs:
pdf_path: ${download_tool.output}
- name: find_context_tool
type: python
source:
type: code
path: find_context_tool.py
inputs:
question: ${rewrite_question_tool.output}
index_path: ${build_index_tool.output}
- name: qna_tool
type: python
source:
type: code
path: qna_tool.py
inputs:
prompt: ${find_context_tool.output.prompt}
history: ${inputs.chat_history}
- name: rewrite_question_tool
type: python
source:
type: code
path: rewrite_question_tool.py
inputs:
question: ${inputs.question}
history: ${inputs.chat_history}
env_ready_signal: ${setup_env.output}
environment:
python_requirements_txt: requirements.txt