-
Notifications
You must be signed in to change notification settings - Fork 754
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c5ed8f
commit a674de5
Showing
9 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.env | ||
__pycache__/ | ||
.promptflow/* | ||
!.promptflow/flow.tools.json | ||
.runs/ |
53 changes: 53 additions & 0 deletions
53
standard-flow-from-zero/basic/joke_prompt/.promptflow/flow.tools.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"package": {}, | ||
"code": { | ||
"hello.jinja2": { | ||
"type": "prompt", | ||
"inputs": { | ||
"text": { | ||
"type": [ | ||
"string" | ||
] | ||
} | ||
}, | ||
"description": "Please replace the template with your own prompt.", | ||
"source": "hello.jinja2" | ||
}, | ||
"hello.py": { | ||
"type": "python", | ||
"inputs": { | ||
"input1": { | ||
"type": [ | ||
"string" | ||
] | ||
} | ||
}, | ||
"source": "hello.py", | ||
"function": "my_python_tool" | ||
}, | ||
"joke.jinja2": { | ||
"type": "llm", | ||
"inputs": { | ||
"topic": { | ||
"type": [ | ||
"string" | ||
] | ||
} | ||
}, | ||
"description": "Prompt is a jinja2 template that generates prompt for LLM", | ||
"source": "joke.jinja2" | ||
}, | ||
"echo.py": { | ||
"type": "python", | ||
"inputs": { | ||
"input1": { | ||
"type": [ | ||
"string" | ||
] | ||
} | ||
}, | ||
"source": "echo.py", | ||
"function": "my_python_tool" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"text": "Hello World!"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# --------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# --------------------------------------------------------- | ||
|
||
from promptflow.core import tool | ||
|
||
# The inputs section will change based on the arguments of the tool function, after you save the code | ||
# Adding type to arguments and return value will help the system show the types properly | ||
# Please update the function name/signature per need | ||
|
||
|
||
@tool | ||
def my_python_tool(input1: str) -> str: | ||
return "Prompt: " + input1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
id: template_standard_flow | ||
name: Template Standard Flow | ||
environment: | ||
python_requirements_txt: requirements.txt | ||
inputs: | ||
topic: | ||
type: string | ||
is_chat_input: false | ||
default: atom | ||
outputs: | ||
joke: | ||
type: string | ||
reference: ${echo.output} | ||
nodes: | ||
- name: echo | ||
type: python | ||
source: | ||
type: code | ||
path: echo.py | ||
inputs: | ||
input1: ${joke.output} | ||
use_variants: false | ||
- name: joke | ||
type: llm | ||
source: | ||
type: code | ||
path: joke.jinja2 | ||
inputs: | ||
deployment_name: gpt-4-32k | ||
temperature: 1 | ||
top_p: 1 | ||
max_tokens: 256 | ||
topic: ${inputs.topic} | ||
response_format: | ||
type: text | ||
connection: connection_name | ||
api: chat | ||
use_variants: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
$schema: https://azuremlschemas.azureedge.net/latest/flow.schema.json | ||
name: template_standard_flow | ||
display_name: Template Standard Flow | ||
type: standard | ||
path: ./flow.dag.yaml | ||
description: Template Standard Flow | ||
properties: | ||
promptflow.stage: prod | ||
promptflow.section: template | ||
promptflow.batch_inputs: samples.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{# Prompt is a jinja2 template that generates prompt for LLM #} | ||
|
||
# system: | ||
|
||
You are a bot can tell good jokes | ||
|
||
# user: | ||
|
||
A joke about {{topic}} please |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
promptflow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[ | ||
{ | ||
"topic": "atom" | ||
} | ||
] |