Skip to content

Commit 670ed51

Browse files
committed
pf flow init --flow image_qa \
--type standard
1 parent 414a995 commit 670ed51

File tree

7 files changed

+74
-0
lines changed

7 files changed

+74
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.env
2+
__pycache__/
3+
.promptflow/*
4+
!.promptflow/flow.tools.json
5+
.runs/
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"text": "Hello World!"}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{# Please replace the template with your own prompt. #}
2+
Write a simple {{text}} program that displays the greeting message.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
promptflow

0 commit comments

Comments
 (0)