-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtowerapi.py
35 lines (31 loc) · 1.33 KB
/
towerapi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from flask import Flask, jsonify, request
app = Flask(__name__)
# Custom PROMPT route
@app.route('/ProjectedIncome', methods=['PROMPT'])
def handle_prompt():
# Create your JSON response data
response_data = {
"context": "The user is inquiring about the projected income of the ABC company from its operations in California for the next year.",
"prompt": "What is the projected income of the ABC company from its California operations for next year?",
"examples": [
{"prompt": "Can you provide an estimate of the income of the ABC company from its California operations for the upcoming year?"},
{"prompt": "What is the projected revenue of the ABC company's California operations for next year?"}
]
}
@app.route('/ProjectedIncome', methods=['VALIDATE'])
def handle_validate(data):
# Create your JSON response data
#validate the response format with the schema expected.
pass
@app.route('/ProjectedIncome', methods=['POST'])
def handle_completion(data):
# Create your JSON response data
#Save the data received from the AI response and send to another integration point
pass
@app.route('/ProjectedIncome', methods=['TRAIN'])
def handle_train():
#respond with training data for shorts if required for this ProjectIncome
pass
# Run the application
if __name__ == '__main__':
app.run()