cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Generative AI
Explore discussions on generative artificial intelligence techniques and applications within the Databricks Community. Share ideas, challenges, and breakthroughs in this cutting-edge field.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Unable to read message from Genie Conversation API

RitikaKulshrest
New Contributor

Hi Team,

I am facing issue in getting the message details from the genie conversation API. I have created the conversation, which returns the message ID and conversation ID. But I am unable to see the message. I am getting error, when hitting the Get conversation message API. Request details below: 

Request:
curl --request GET \ --url https://<instance-url>/api/2.0/genie/spaces/01f02373ddca138c8fba681fbdbc6048/conversations/01f02d59328d15a0bff50c404a402104/messages/01f02d59329e1cfd994ada581f5a90d1 \ --header 'authorization: Bearer <redacted>'

Response:
{
"id": "01f02d59329e1cfd994ada581f5a90d1",
"space_id": "01f02373ddca138c8fba681fbdbc6048",
"conversation_id": "01f02d59328d15a0bff50c404a402104",
"user_id": 4005002501632047,
"created_timestamp": 1746852157309,
"last_updated_timestamp": 1746852201368,
"status": "FAILED",
"content": "Give me the top five open opportunities from the Opportunity table ",
"error": {
"error": "INTERNAL_ERROR: AI service did not respond with a valid answer. Message-ID: 01f02d59329e1cfd994ada581f5a90d1. Code: 22.",
"type": "FUNCTION_ARGUMENTS_INVALID_JSON_EXCEPTION"
},
"auto_regenerate_count": 0,
"message_id": "01f02d59329e1cfd994ada581f5a90d1"
}

What am I doing wrong? Any suggestions will be helpful.

1 REPLY 1

LRALVA
Honored Contributor

@RitikaKulshrest 

I can see what's happening with your Genie conversation API issue. The problem is not with your API call but with the Genie service's attempt to execute your query.
The response indicates that your message was received but failed to process:

"status": "FAILED",
"content": "Give me the top five open opportunities from the Opportunity table",
"error": {
"error": "INTERNAL_ERROR: AI service did not respond with a valid answer. Message-ID: 01f02d59329e1cfd994ada581f5a90d1. Code: 22.",
"type": "FUNCTION_ARGUMENTS_INVALID_JSON_EXCEPTION"
}

This specific error (FUNCTION_ARGUMENTS_INVALID_JSON_EXCEPTION) typically occurs when:

-- The Genie Agent tried to execute a SQL query but encountered an issue with the function arguments formatting
-- The Opportunity table might not exist or have the expected schema
-- There might be an issue with the underlying AI service's response format.

Troubleshooting Steps:

1. Verify Table Existence Check if the Opportunity table exists in your Databricks catalog:
SHOW TABLES LIKE '*opportunity*'
2. Test Table Access
Try running a simple query in a notebook to confirm the table is accessible:
SELECT COUNT(*) FROM Opportunity.
3. Simplify Your Initial Query Start with a simpler query to see if it works:
Show me the schema of the Opportunity table
Or
List the available tables
4. Check Genie Configuration Make sure Genie has access to the catalog/schema where your Opportunity table resides.
5. Examine API Permissions Verify that the bearer token you're using has the necessary permissions for both the Genie API and the underlying data.

 

 

LR

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now