File tree Expand file tree Collapse file tree 5 files changed +64
-5
lines changed Expand file tree Collapse file tree 5 files changed +64
-5
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,65 @@ $ pf run create \
66
66
--stream
67
67
```
68
68
69
+ ### playground
70
+
71
+ ``` shell
72
+ cd apps/11_promptflow
73
+
74
+ # Initialize a new flow
75
+ $ pf flow init \
76
+ --flow playground \
77
+ --type chat
78
+
79
+ $ cd playground
80
+
81
+ # Set parameters
82
+ $ CONNECTION_NAME=open_ai_connection
83
+ $ AZURE_OPENAI_KEY=< your_api_key>
84
+ $ AZURE_OPENAI_ENDPOINT=< your_api_endpoint>
85
+
86
+ # List connections
87
+ $ pf connection list
88
+
89
+
90
+ # Delete connection (if needed)
91
+ $ pf connection delete \
92
+ --name $CONNECTION_NAME
93
+
94
+ # Create connection
95
+ $ pf connection create \
96
+ --file azure_openai.yaml \
97
+ --set api_key=$AZURE_OPENAI_KEY \
98
+ --set api_base=$AZURE_OPENAI_ENDPOINT \
99
+ --name $CONNECTION_NAME
100
+
101
+ # Show connection
102
+ $ pf connection show \
103
+ --name $CONNECTION_NAME
104
+
105
+ # Interact with chat flow
106
+ $ pf flow test \
107
+ --flow . \
108
+ --interactive
109
+
110
+ # Test flow
111
+ $ pf flow test \
112
+ --flow . \
113
+ --inputs question=" What's the capital of France?"
114
+
115
+ # Create run with multiple lines data
116
+ $ RUN_NAME=playground-$( date +%s)
117
+ $ pf run create \
118
+ --name $RUN_NAME \
119
+ --flow . \
120
+ --data ./data.jsonl \
121
+ --column-mapping question=' ${data.question}' \
122
+ --stream
123
+
124
+ # Show run details
125
+ $ pf run show-details --name $RUN_NAME
126
+ ```
127
+
69
128
## References
70
129
71
130
- [ Prompt flow > repos] ( https://github.com/microsoft/promptflow )
Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ type: azure_open_ai
4
4
api_key : " <user-input>"
5
5
api_base : " <user-input>"
6
6
api_type : " azure"
7
+ api_version : " 2024-07-01-preview"
Original file line number Diff line number Diff line change
1
+ {"question" : " What's the capital of France?" }
2
+ {"question" : " What's the capital of Japan?" }
3
+ {"question" : " What's the capital of China?" }
Original file line number Diff line number Diff line change 19
19
type : code
20
20
path : chat.jinja2
21
21
inputs :
22
- deployment_name : gpt-35-turbo
22
+ deployment_name : gpt-4o
23
23
max_tokens : ' 256'
24
24
temperature : ' 0.7'
25
25
chat_history : ${inputs.chat_history}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments