File tree Expand file tree Collapse file tree 8 files changed +102
-0
lines changed Expand file tree Collapse file tree 8 files changed +102
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,31 @@ $ pf run create \
152
152
$ pf run show-details --name $RUN_NAME
153
153
```
154
154
155
+ ### playground_standard
156
+
157
+ ``` shell
158
+ cd apps/11_promptflow
159
+
160
+ # Initialize a new flow
161
+ $ pf flow init \
162
+ --flow playground_standard \
163
+ --type standard
164
+
165
+ $ cd playground_standard
166
+
167
+ # Create run with multiple lines data
168
+ $ RUN_NAME=playground_standard-$( date +%s)
169
+ $ pf run create \
170
+ --name $RUN_NAME \
171
+ --flow . \
172
+ --data ./data.jsonl \
173
+ --column-mapping text=' ${data.text}' \
174
+ --stream
175
+
176
+ # Show run details
177
+ $ pf run show-details --name $RUN_NAME
178
+ ```
179
+
155
180
## References
156
181
157
182
- [ Prompt flow > repos] ( https://github.com/microsoft/promptflow )
Original file line number Diff line number Diff line change
1
+ .env
2
+ __pycache__ /
3
+ .promptflow /*
4
+ ! .promptflow /flow.tools.json
5
+ .runs /
Original file line number Diff line number Diff line change
1
+ {
2
+ "package" : {},
3
+ "code" : {
4
+ "hello.jinja2" : {
5
+ "type" : " prompt" ,
6
+ "inputs" : {
7
+ "text" : {
8
+ "type" : [
9
+ " string"
10
+ ]
11
+ }
12
+ },
13
+ "description" : " Please replace the template with your own prompt." ,
14
+ "source" : " hello.jinja2"
15
+ },
16
+ "hello.py" : {
17
+ "type" : " python" ,
18
+ "inputs" : {
19
+ "input1" : {
20
+ "type" : [
21
+ " string"
22
+ ]
23
+ }
24
+ },
25
+ "source" : " hello.py" ,
26
+ "function" : " my_python_tool"
27
+ }
28
+ }
29
+ }
Original file line number Diff line number Diff line change
1
+ {"text" : " Hello World!" }
Original file line number Diff line number Diff line change
1
+ $schema : https://azuremlschemas.azureedge.net/promptflow/latest/Flow.schema.json
2
+ inputs :
3
+ text :
4
+ type : string
5
+ outputs :
6
+ output_prompt :
7
+ type : string
8
+ reference : ${echo_my_prompt.output}
9
+ nodes :
10
+ - name : hello_prompt
11
+ type : prompt
12
+ source :
13
+ type : code
14
+ path : hello.jinja2
15
+ inputs :
16
+ text : ${inputs.text}
17
+ - name : echo_my_prompt
18
+ type : python
19
+ source :
20
+ type : code
21
+ path : hello.py
22
+ inputs :
23
+ input1 : ${hello_prompt.output}
24
+ environment :
25
+ python_requirements_txt : requirements.txt
Original file line number Diff line number Diff line change
1
+ {# Please replace the template with your own prompt. #}
2
+ Write a simple {{text}} program that displays the greeting message.
Original file line number Diff line number Diff line change
1
+ # ---------------------------------------------------------
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # ---------------------------------------------------------
4
+
5
+ from promptflow .core import tool
6
+
7
+ # The inputs section will change based on the arguments of the tool function, after you save the code
8
+ # Adding type to arguments and return value will help the system show the types properly
9
+ # Please update the function name/signature per need
10
+
11
+
12
+ @tool
13
+ def my_python_tool (input1 : str ) -> str :
14
+ return "Prompt: " + input1
Original file line number Diff line number Diff line change
1
+ promptflow
You can’t perform that action at this time.
0 commit comments