Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Datastore in Vertex Ai Agents

Does Datastore provide any confidence or generator score for the responses generated in Dialogflow CX?
I need to classify the responses based on their accuracy confidence levels. For example:

  • Very High: Datastore is highly confident that the response is accurate.
  • Good: Datastore is somewhat confident in the accuracy of the response.
  • Very Low: Datastore is confident that the response is not accurate.
Solved Solved
1 4 314
1 ACCEPTED SOLUTION

To be able to see the Snippets Section in Web Platform, I believe you need to add datastore handler in Start or Any Preferred Page in Dialogflow CX.
Try this - Datastore Agents in Dialogflow CX 
* * To be able to use datastore inside dialogflow CX, you need to enable Vertex AI API in console.**

Did some R&D and got to know the searchSnippets is not logged inside response body when calling dialogflow via API.

 

View solution in original post

4 REPLIES 4

Hi! Using the web platform or API? 

In the Web Platform , I guess we can see the inside the original response for score -

"generativePrediction": {
"groundingInfo": {
"accepted": true,
"score": "VERY_HIGH",
"snippetsSupportingIndices": [
{
"indices": [
1,
2,
0
]},]}}

Wondering do we get same/similiar kind of score of response via API  in response body?

You get a lot of info from the API. I was trying but with my current setup I'm not seeing the snippets section. I will let you know if I get them.

Try this:

```python

def detect_intent_texts(agent, session_id, text, language_code="en-us"😞
    """
    Returns the result of detect intent with texts as inputs.

    Using the same `session_id` between requests allows continuation
    of the conversation.
    """
   
    session_path = f"{agent}/sessions/{session_id}"
   
    client_options = None
   
    agent_components = AgentsClient.parse_agent_path(agent)
   
    location_id = agent_components["location"]
   
    if location_id != "global":
        api_endpoint = f"{location_id}-dialogflow.googleapis.com:443"
       
        print(f"API Endpoint: {api_endpoint}\n")
       
        client_options = {"api_endpoint": api_endpoint}
       
    session_client = SessionsClient(client_options=client_options)

    # Prepare request
    text_input = session.TextInput(text=text)
   
    query_input = session.QueryInput(text=text_input, language_code=language_code)
   
    request = session.DetectIntentRequest(
        session=session_path, query_input=query_input
    )
   
    intent_detection_response = session_client.detect_intent(request=request)
   
    response_json = MessageToDict(intent_detection_response._pb)
   
    response_messages = response_json["queryResult"]["responseMessages"]
   
    response_text = response_messages[0]["text"]["text"][0]
   
    return response_text
```

To be able to see the Snippets Section in Web Platform, I believe you need to add datastore handler in Start or Any Preferred Page in Dialogflow CX.
Try this - Datastore Agents in Dialogflow CX 
* * To be able to use datastore inside dialogflow CX, you need to enable Vertex AI API in console.**

Did some R&D and got to know the searchSnippets is not logged inside response body when calling dialogflow via API.