File tree Expand file tree Collapse file tree 7 files changed +74
-0
lines changed
apps/11_promptflow/image_qa Expand file tree Collapse file tree 7 files changed +74
-0
lines changed 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
+ },
14
+ "hello.py" : {
15
+ "type" : " python" ,
16
+ "inputs" : {
17
+ "input1" : {
18
+ "type" : [
19
+ " string"
20
+ ]
21
+ }
22
+ },
23
+ "function" : " my_python_tool"
24
+ }
25
+ }
26
+ }
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