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

Function update_suggestion_as_used

api/app/api/utils/caesar_logging.py:207–225  ·  view source on GitHub ↗
(suggestion_id)

Source from the content-addressed store, hash-verified

205
206@failsoft
207def update_suggestion_as_used(suggestion_id):
208 if not EVENTS_ENGINE:
209 return None
210
211 params = {
212 "suggestion_id": suggestion_id,
213 }
214
215 update_query = text("""
216 UPDATE suggested_queries
217 SET used_at = CURRENT_TIMESTAMP
218 WHERE id = :suggestion_id
219 """)
220 with EVENTS_ENGINE.connect() as conn:
221 # get the ID back
222 result = conn.execute(update_query, params)
223 conn.commit()
224
225 return True
226
227@failsoft
228def create_session(app_name, user_id):

Callers 1

accept_suggestionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected