Add auto create session #6
@@ -26,4 +26,9 @@ session_service = FirestoreSessionService(
|
|||||||
genai_client=genai.Client(),
|
genai_client=genai.Client(),
|
||||||
)
|
)
|
||||||
|
|
||||||
runner = Runner(app_name="va_agent", agent=agent, session_service=session_service)
|
runner = Runner(
|
||||||
|
app_name="va_agent",
|
||||||
|
agent=agent,
|
||||||
|
session_service=session_service,
|
||||||
|
auto_create_session=True,
|
||||||
|
)
|
||||||
|
|||||||
@@ -66,13 +66,10 @@ def _build_user_message(request: QueryRequest) -> str:
|
|||||||
if request.type == "notification" and request.notification:
|
if request.type == "notification" and request.notification:
|
||||||
parts = [request.text]
|
parts = [request.text]
|
||||||
if request.notification.text:
|
if request.notification.text:
|
||||||
parts.append(
|
parts.append(f"\n[Notificación recibida]: {request.notification.text}")
|
||||||
f"\n[Notificación recibida]: {request.notification.text}"
|
|
||||||
)
|
|
||||||
if request.notification.parameters:
|
if request.notification.parameters:
|
||||||
formatted = ", ".join(
|
formatted = ", ".join(
|
||||||
f"{k}: {v}"
|
f"{k}: {v}" for k, v in request.notification.parameters.items()
|
||||||
for k, v in request.notification.parameters.items()
|
|
||||||
)
|
)
|
||||||
parts.append(f"[Parámetros de notificación]: {formatted}")
|
parts.append(f"[Parámetros de notificación]: {formatted}")
|
||||||
return "\n".join(parts)
|
return "\n".join(parts)
|
||||||
|
|||||||
Reference in New Issue
Block a user