I’m building with Google Cloud Conversational Analytics (Gemini Data Analytics) and I need a way to restrict or scope the data my Data Agent returns.
What I’m using
from google.cloud import geminidataanalytics
data_agent_client = geminidataanalytics.DataAgentServiceClient()
data_chat_client = geminidataanalytics.DataChatServiceClient()
I can start a conversation like this:
messages = [
geminidataanalytics.Message(
user_message=geminidataanalytics.UserMessage(text=question)
)
]
conversation_reference = geminidataanalytics.ConversationReference(
conversation=data_chat_client.conversation_path(
billing_project, location, conversation_id
),
data_agent_context=geminidataanalytics.DataAgentContext(
data_agent=data_chat_client.data_agent_path(
billing_project, location, data_agent_id
),
credentials=looker_credentials
),
)
request = geminidataanalytics.ChatRequest(
parent=f"projects/{billing_project}/locations/{location}",
messages=messages,
conversation_reference=conversation_reference,
)
stream = data_chat_client.chat(request=request)
for response in stream:
print(response)
What I need help with
I’d like to apply filters in a controlled way, either:
-
When creating/updating the Data Agent so that every query it runs is automatically scoped (for example: always filter by
region = 'EMEA'), or -
Dynamically per conversation so a user’s chat session can include temporary filters (like a date range) without depending on the LLM to infer them.
My question
Is there an officially supported way—agent-level or per-conversation—to attach filters like these when using the Python client?
Any code snippets, API fields, or best practices would be hugely appreciated!
Thanks in advance for any pointers or sample code