-
Notifications
You must be signed in to change notification settings - Fork 898
/
flow.dag.yaml
77 lines (77 loc) · 1.93 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
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/Flow.schema.json
inputs:
chat_history:
type: list
default: []
question:
type: string
default: What is ChatGPT?
is_chat_input: true
outputs:
answer:
type: string
reference: ${augmented_chat.output}
is_chat_output: true
nodes:
- name: extract_query_from_question
type: llm
source:
type: code
path: extract_query_from_question.jinja2
inputs:
# This is for easily switch between openai and azure openai.
# deployment_name is required by azure openai, model is required by openai.
deployment_name: gpt-35-turbo
model: gpt-3.5-turbo
temperature: '0.7'
top_p: '1.0'
stop: ''
max_tokens: '256'
presence_penalty: '0'
frequency_penalty: '0'
logit_bias: ''
question: ${inputs.question}
chat_history: ${inputs.chat_history}
connection: open_ai_connection
api: chat
- name: get_wiki_url
type: python
source:
type: code
path: get_wiki_url.py
inputs:
entity: ${extract_query_from_question.output}
count: '2'
- name: search_result_from_url
type: python
source:
type: code
path: search_result_from_url.py
inputs:
url_list: ${get_wiki_url.output}
count: '10'
- name: process_search_result
type: python
source:
type: code
path: process_search_result.py
inputs:
search_result: ${search_result_from_url.output}
- name: augmented_chat
type: llm
source:
type: code
path: augmented_chat.jinja2
inputs:
# This is to easily switch between openai and azure openai.
# deployment_name is required by azure openai, model is required by openai.
deployment_name: gpt-35-turbo
model: gpt-3.5-turbo
temperature: '0.8'
question: ${inputs.question}
chat_history: ${inputs.chat_history}
contexts: ${process_search_result.output}
connection: open_ai_connection
api: chat
environment:
python_requirements_txt: requirements.txt