forked from sisbell/chatgpt-plugin-store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalorie.chat.yaml
187 lines (187 loc) · 5.97 KB
/
calorie.chat.yaml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
openapi: 3.0.1
info:
title: Calorie Chat
description: A plugin that allows users to easily estimate and log the calories and nutritional information from the food they consume.
version: 1.0.0
servers:
- url: https://calorie.chat
paths:
/add_food_logs:
post:
summary: Add food logs
operationId: addFoodLogs
description: Add a list of food logs with food name, description, calorie count, and attributes like protein, carbohydrates, and fats. Seperate food items when appropriate.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
date:
type: string
format: date
description: The date for which the food logs should be added (default is current date with format yyyy-mm-dd).
required: false
foodItems:
type: array
items:
type: object
properties:
foodName:
type: string
description: Name of the food
foodDescription:
type: string
description: Description of the food
calorieCount:
type: number
format: float
description: Calorie count of the food
protein:
type: number
format: float
description: Protein content in grams (estimated if not provided)
carbohydrates:
type: number
format: float
description: Carbohydrates content in grams (estimated if not provided)
sugar:
type: number
format: float
description: Sugar content in grams (estimated if not provided)
fats:
type: number
format: float
description: Fats content in grams (estimated if not provided)
minItems: 1
responses:
"200":
description: Success message and Markdown table with updated food logs.
content:
application/json:
schema:
type: object
properties:
message:
type: string
updatedFoodLogs:
type: string
"400":
description: Missing required parameters
content:
text/plain:
schema:
type: string
/read_food_logs:
get:
operationId: readFoodLogs
summary: Read food logs
description: Retrieve markdown table for all entered food logs for a given date.
parameters:
- name: date
in: query
description: The date to retrieve the food logs for. (default is current date)
required: true
schema:
type: string
responses:
"200":
description: Food logs retrieved successfully
content:
text/plain:
schema:
type: string
"500":
description: Server error
content:
text/plain:
schema:
type: string
/remove_food_log/{id}:
delete:
operationId: removeFoodLog
summary: Remove a food log
description: Remove a food log with the specified ID.
parameters:
- name: id
in: path
description: ID of the food log to remove. Must be deduced by conversation context
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Success message and Markdown table with updated food logs.
content:
application/json:
schema:
type: object
properties:
message:
type: string
updatedFoodLogs:
type: string
"400":
description: Bad request
content:
text/plain:
schema:
type: string
"404":
description: Food log not found
content:
text/plain:
schema:
type: string
/update_food_log:
put:
operationId: updateFoodLog
summary: Update a food log
description: Update the specified Nutrient Name of a food log with the given ID.
parameters:
- name: id
in: query
description: ID of the food log to update
required: true
schema:
type: integer
format: int64
- name: nutrientName
in: query
description: Nutrient Name to update (calories, fats, protein, or carbs or sugar)
required: true
schema:
type: string
- name: value
in: query
description: New value for the attribute
required: true
schema:
type: number
format: float
responses:
"200":
description: Success message and Markdown table with updated food logs.
content:
application/json:
schema:
type: object
properties:
message:
type: string
updatedFoodLogs:
type: string
"400":
description: Bad request
content:
text/plain:
schema:
type: string
"404":
description: Food log not found or invalid nutrient name.
content:
text/plain:
schema:
type: string