import requestsimport json# The URL for the chat endpointurl ='https://api.knowbase.ai/api/v1/chat'# Replace 'your_access_token_here' with the actual access token you received from the APIheaders ={'access-token':'your_access_token_here','Content-Type':'application/json'# Specify the content type as JSON}# Replace 'your_file_id_here' with the actual file ID you want to query# Replace 'your_query_here' with the actual query textdata ={'file_id':'your_file_id_here','query':'your_query_here'}# Make the POST request to send the queryresponse = requests.post(url, headers=headers, data=json.dumps(data))# Check the responseif response.status_code ==200:print("Query processed successfully.")print(response.text)# This will print the response to the queryelif response.status_code ==404:print("File not found or has not been processed yet.")print(response.json())# This will print the error messageelif response.status_code ==429:print("Rate limit reached.")print(response.json())# This will print the error messageelse:print("Failed to process the query.")print(response.json())# This will print the error message