MCPcopy Create free account
hub / github.com/caesarHQ/textSQL / get_feed_data

Function get_feed_data

api/app/api/utils/caesar_logging.py:251–281  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

249
250@failsoft
251def get_feed_data(app):
252 if not EVENTS_ENGINE:
253 return None
254
255 params = {
256 "app": app,
257 }
258
259 query = text("""
260 select input_text, category, emoji, id
261 from featured_queries
262 where app = :app
263 and featured = true
264 """)
265
266 with EVENTS_ENGINE.connect() as conn:
267 result = conn.execute(query, params)
268 conn.commit()
269 rows = result.fetchall()
270
271 rows = [
272 {
273 "input_text": row[0],
274 "category": row[1],
275 "emoji": row[2],
276 "img": "https://census-gpt-assets.s3.us-west-2.amazonaws.com/" + str(row[3]) + ".png",
277 }
278 for row in rows
279 ]
280
281 return rows

Callers 1

get_discoverabilityFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected