From a8bc5babb0d5e71d192d713654b858eb59b1205e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?th=E1=BB=8Bnh?= Date: Mon, 19 Aug 2024 14:33:08 +0700 Subject: [PATCH] Update: response list instead of single object when fetch sample on zapier trigger --- plugins/example/zapier/memory_created.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/example/zapier/memory_created.py b/plugins/example/zapier/memory_created.py index a18db60ab..9a95e8af4 100644 --- a/plugins/example/zapier/memory_created.py +++ b/plugins/example/zapier/memory_created.py @@ -1,3 +1,4 @@ +from typing import List from fastapi import HTTPException, Request, APIRouter, Form from fastapi.responses import HTMLResponse from fastapi.templating import Jinja2Templates @@ -109,7 +110,7 @@ async def unsubscribe_zapier_trigger(subscriber: ZapierSubcribeModel, uid: str): return {} -@router.get('/zapier/trigger/memory/sample', tags=['zapier'], response_model=ZapierCreateMemory) +@router.get('/zapier/trigger/memory/sample', tags=['zapier'], response_model=List[ZapierCreateMemory]) async def get_trigger_memory_sample(request: Request, uid: str): """ Get the latest memory or a sample to fullfill the triggers On memory created @@ -161,7 +162,7 @@ async def get_trigger_memory_sample(request: Request, uid: str): overview=memory.structured.overview, ) - return sample + return [sample] @router.get('/zapier/me', tags=['zapier'], response_model=EndpointResponse)