UPDATE 12-ago-2025
This commit is contained in:
@@ -1,85 +1,64 @@
|
||||
# Firestore Configuration Properties
|
||||
# --------------------------------
|
||||
# Copyright 2025 Google. This software is provided as-is, without warranty or representation for any use or purpose.
|
||||
# Your use of it is subject to your agreement with Google.
|
||||
|
||||
# Project ID Configuration
|
||||
# Use this setting if you want to manually specify a GCP Project instead of inferring
|
||||
# from your machine's environment.
|
||||
spring.cloud.gcp.firestore.project-id=app-jovenes
|
||||
# =========================================
|
||||
# Spring Boot Configuration Template
|
||||
# =========================================
|
||||
# This file serves as a reference template for all application configuration properties.
|
||||
|
||||
# Credentials Configuration
|
||||
# Use this setting if you want to manually specify service account credentials instead of inferring
|
||||
# from the machine's environment for firestore.
|
||||
#spring.cloud.gcp.firestore.credentials.location=file:{PATH_TO_YOUR_CREDENTIALS_FILE}
|
||||
# Best Practices:
|
||||
# - Use Spring Profiles (e.g., application-dev.properties, application-prod.properties)
|
||||
# to manage environment-specific settings.
|
||||
# - Do not store in PROD sensitive information (e.g., API keys, passwords) directly here.
|
||||
# Use environment variables or a configuration server for production environments.
|
||||
# - This template can be adapted for logging configuration, database connections,
|
||||
# and other external service settings.
|
||||
|
||||
# =========================================================
|
||||
# Orchestrator general Configuration
|
||||
# =========================================================
|
||||
spring.cloud.gcp.project-id=app-jovenes
|
||||
|
||||
# Firestore Emulator Configuration (for local development)
|
||||
#spring.cloud.gcp.firestore.emulator-host=localhost:8080
|
||||
spring.cloud.gcp.firestore.emulator.enabled=false
|
||||
|
||||
# Firestore Database Configuration
|
||||
# ------------------------------------------
|
||||
spring.cloud.gcp.firestore.database-id=app-jovenes-cache-database
|
||||
spring.cloud.gcp.firestore.host=firestore.googleapis.com
|
||||
spring.cloud.gcp.firestore.port=443
|
||||
|
||||
# Memorystore (Redis) Configuration Properties
|
||||
# ------------------------------------------
|
||||
|
||||
# Basic Connection Settings
|
||||
#Secret Manager recomendation for credentials
|
||||
spring.data.redis.host=10.241.0.11
|
||||
spring.data.redis.port=6379
|
||||
#spring.data.redis.password=23cb4c76-9d96-4c74-b8c0-778fb364877a
|
||||
#spring.data.redis.username=default
|
||||
|
||||
# Connection Pool Settings
|
||||
# spring.data.redis.lettuce.pool.max-active=8
|
||||
# spring.data.redis.lettuce.pool.max-idle=8
|
||||
# spring.data.redis.lettuce.pool.min-idle=0
|
||||
# spring.data.redis.lettuce.pool.max-wait=-1ms
|
||||
# =========================================================
|
||||
# Google Firestore Configuration
|
||||
# =========================================================
|
||||
spring.cloud.gcp.firestore.project-id=app-jovenes
|
||||
spring.cloud.gcp.firestore.database-id=app-jovenes-cache-database
|
||||
spring.cloud.gcp.firestore.host=firestore.googleapis.com
|
||||
spring.cloud.gcp.firestore.port=443
|
||||
# =========================================================
|
||||
# Google Memorystore(Redis) Configuration
|
||||
# =========================================================
|
||||
spring.data.redis.host=10.241.0.11
|
||||
spring.data.redis.port=6379
|
||||
#spring.data.redis.password=23cb4c76-9d96-4c74-b8c0-778fb364877a
|
||||
#spring.data.redis.username=default
|
||||
|
||||
# SSL Configuration (if using SSL)
|
||||
# spring.data.redis.ssl=true
|
||||
# spring.data.redis.ssl.key-store=classpath:keystore.p12
|
||||
# spring.data.redis.ssl.key-store-password=your-keystore-password
|
||||
|
||||
# Timeout Settings
|
||||
# spring.data.redis.timeout=2000ms
|
||||
# spring.data.redis.lettuce.shutdown-timeout=100ms
|
||||
|
||||
# Cluster Configuration (if using Redis Cluster)
|
||||
# spring.data.redis.cluster.nodes=localhost:6379,localhost:6380,localhost:6381
|
||||
# spring.data.redis.cluster.max-redirects=3
|
||||
|
||||
# Sentinel Configuration (if using Redis Sentinel)
|
||||
# spring.data.redis.sentinel.master=mymaster
|
||||
# spring.data.redis.sentinel.nodes=localhost:26379,localhost:26380,localhost:26381
|
||||
|
||||
# Additional Redis Settings
|
||||
# spring.data.redis.database=0
|
||||
# spring.data.redis.client-type=lettuce
|
||||
# spring.data.redis.lettuce.cluster.refresh.period=1000ms
|
||||
|
||||
# Google Cloud StorageConfiguration
|
||||
# ------------------------------------------
|
||||
gcs.bucket.name=app-jovenes-bucket
|
||||
spring.cloud.gcp.project-id=app-jovenes
|
||||
|
||||
# Dialogflow CX Configuration
|
||||
# ------------------------------------------
|
||||
# =========================================================
|
||||
# Google Conversational Agents Configuration
|
||||
# =========================================================
|
||||
dialogflow.cx.project-id=app-jovenes
|
||||
dialogflow.cx.location=us-central1
|
||||
dialogflow.cx.agent-id=3b9f2354-8556-4363-9e70-fa8283582a3e
|
||||
dialogflow.cx.agent-id=ff65fd2a-99d1-477f-9d10-4d75461f9568
|
||||
dialogflow.default-language-code=es
|
||||
|
||||
# =========================================================
|
||||
# Google Generative AI (Gemini) Configuration
|
||||
# =========================================================
|
||||
# Your Google Cloud Project ID where the Vertex AI service is enabled.
|
||||
google.cloud.project=app-jovenes
|
||||
|
||||
# The Google Cloud region where you want to access the Gemini model.
|
||||
# Common regions: us-central1, europe-west1, asia-northeast1 etc.
|
||||
google.cloud.location=us-central1
|
||||
|
||||
# The name of the Gemini model to use for summarization.
|
||||
gemini.model.name=gemini-2.0-flash-001
|
||||
gemini.model.name=gemini-2.0-flash-001
|
||||
# =========================================================
|
||||
# (Gemini) MessageFilter Configuration
|
||||
# =========================================================
|
||||
messagefilter.geminimodel=gemini-2.0-flash-001
|
||||
messagefilter.temperature=0.1f
|
||||
messagefilter.maxOutputTokens=800
|
||||
messagefilter.topP= 0.1f
|
||||
messagefilter.prompt=prompts/message_filter_prompt.txt
|
||||
|
||||
54
src/main/resources/prompts/message_filter_prompt.txt
Normal file
54
src/main/resources/prompts/message_filter_prompt.txt
Normal file
@@ -0,0 +1,54 @@
|
||||
You are an expert AI classification agent.
|
||||
Your task is to analyze a user's final message after an external notification interrupts an ongoing conversation.
|
||||
|
||||
You will receive three pieces of information:
|
||||
1. `CONVERSATION_HISTORY`: The dialogue between the agent and the user *before* the notification.
|
||||
2. `INTERRUPTING_NOTIFICATION`: The specific alert that appeared.
|
||||
3. `USER_FINAL_INPUT`: The user's message that you must classify.
|
||||
|
||||
Your goal is to determine if the `USER_FINAL_INPUT` is a reaction to the `INTERRUPTING_NOTIFICATION` or a continuation of the `CONVERSATION_HISTORY`.
|
||||
|
||||
**Classification Rules:**
|
||||
|
||||
* **`%s`**: Classify as `%s` if the `USER_FINAL_INPUT` is a direct question, comment, or reaction related to the `INTERRUPTING_NOTIFICATION`. The user has switched their focus to the notification.
|
||||
* **`%s`**: Classify as `%s` if the `USER_FINAL_INPUT` ignores the notification and continues the topic from the `CONVERSATION_HISTORY`.
|
||||
* **Ambiguity Rule**: If the input is ambiguous (e.g., "ok, thanks"), default to `%s`. It's safer to assume the user is concluding the original topic.
|
||||
* **Acknowledgement Rule**: If the user briefly acknowledges the notification but immediately pivots back to the original conversation (e.g., "Okay thank you, but back to my question about loans..."), classify it as `%s`. The PRIMARY INTENT is to continue the original dialogue.
|
||||
|
||||
Your response must be a single word: `%s` or `%s`. Do not add any other text, punctuation, or explanations.
|
||||
|
||||
---
|
||||
**Examples (Few-Shot Learning):**
|
||||
|
||||
**Example 1:**
|
||||
`CONVERSATION_HISTORY`:
|
||||
Agent: Claro, para un crédito de vehículo, las tasas actuales inician en el 1.2%% mensual.
|
||||
User: Entiendo, ¿y el plazo máximo de cuánto sería?
|
||||
`INTERRUPTING_NOTIFICATION`: Tu pago de la tarjeta de crédito por $1,500.00 ha sido procesado.
|
||||
`USER_FINAL_INPUT`: ¡Perfecto! Justo de eso quería saber, ¿ese pago ya se ve reflejado en el cupo disponible?
|
||||
Classification: %s
|
||||
|
||||
**Example 2:**
|
||||
`CONVERSATION_HISTORY`:
|
||||
Agent: No es necesario, puedes completar todo el proceso para abrir tu cuenta desde nuestra app.
|
||||
User: Ok, suena fácil.
|
||||
`INTERRUPTING_NOTIFICATION`: Tu estado de cuenta de Julio ya está disponible.
|
||||
`USER_FINAL_INPUT`: Bueno, y qué documentos necesito tener a la mano para hacerlo en la app?
|
||||
Classification: %s
|
||||
|
||||
**Example 3:**
|
||||
`CONVERSATION_HISTORY`:
|
||||
Agent: Ese fondo de inversión tiene un perfil de alto riesgo, pero históricamente ha dado un rendimiento superior al 15%% anual.
|
||||
User: Suena interesante...
|
||||
`INTERRUPTING_NOTIFICATION`: Alerta: Tu cuenta de ahorros tiene un saldo bajo de $50.00.
|
||||
`USER_FINAL_INPUT`: Umm, ok gracias cuando fue el ultimo retiro?. Pero volviendo al fondo, ¿cuál es la inversión mínima para entrar?
|
||||
Classification: %s
|
||||
---
|
||||
|
||||
**Task:**
|
||||
|
||||
`CONVERSATION_HISTORY`:
|
||||
%s
|
||||
`INTERRUPTING_NOTIFICATION`: %s
|
||||
`USER_FINAL_INPUT`: %s
|
||||
Classification:
|
||||
@@ -1,57 +0,0 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Spring Data Firestore Sample</title>
|
||||
</head>
|
||||
|
||||
<style>
|
||||
html * {
|
||||
font-family: Roboto, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 50em;
|
||||
}
|
||||
|
||||
.panel {
|
||||
margin: 1em;
|
||||
padding: 1em;
|
||||
border: 1px solid black;
|
||||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Spring Data Firestore Sample</h1>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<h2>Firestore Control Panel</h2>
|
||||
|
||||
<p>
|
||||
This section allows you to read User entities in Firestore.
|
||||
Some values are prefilled as an example of what you can type in.
|
||||
</p>
|
||||
|
||||
<div class="panel">
|
||||
<a href="/users">Show all users</a>
|
||||
</div>
|
||||
|
||||
<div class="panel">
|
||||
<b>Show all users with age</b>
|
||||
<form action="/users/age" method="get">
|
||||
Age: <input type="text" name="age" value="30">
|
||||
<input type="submit" value="submit">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="panel">
|
||||
<a href="https://console.cloud.google.com/firestore/data">View your Firestore data in the Cloud Console</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user