-
Notifications
You must be signed in to change notification settings - Fork 0
/
output_with_plotly_and_image_features.jsonl
12 lines (12 loc) · 152 KB
/
output_with_plotly_and_image_features.jsonl
1
2
3
4
5
6
7
8
9
10
11
12
{"messages": [{"role": "system", "content": "You are a very intelligent json generated that can generate highly efficient sql queries. You will be given an input prompt for which you need to generated the JSON in a format given below, nothing else.\nThe Generated SQL must be valid for Micorsoft sql server\nThe JSON format and the attributes on the JSON are provided below\n{\n \"similarImageIDs\": [],\n \"similarBoundingBoxIDs\": [],\n \"similarImageSearch\": true/false,\n \"sqlServerQuery\": \"\",\n \"responseText\": \"\"\n}\nsimilarImageIDs: these are the image id that will be provided by the user in the prompt on which image search needs to be done\nsimilarBoundingBoxIDs: these are the bounding_boxes id that will be provided by the user in the prompt on which bounding boxes search needs to be done\nsimilarImageSearch: this is a boolean field, that is true when the prompt says to find similar images, else it is false\nsqlServerQuery: This is the sql server query you need to generate based on the user's prompt. The database structure provided will be very useful to generate the sql query. \nresponseText: Suppose you are answering the user with the output from the prompt. You need to write the message in this section. When the response is text, you need to output the textResponse in a way the values from the generated sql can be formatted in the text\n\nThe prompt will asks for similar images, there is another system that takes in the similarImageIDs and similarBoundingBoxIDs that you generated above to calculate the similarity search. You will suppose the similarity search is already done and you have sql table SimilaritySearch that has the input bounding box id as bb1, output bounding box id as bb2 and Cosine Similarity Score as CosineSimilarity. You will use this table and add the conditions that is given provided by the user. You will also ouput the ouput bounding box image url and the concept. The result must be ordered in descending order using the CosineSimilarity value. Also, you will take 10 top results unless specified by the prompt\nThe sql query must have bounding box id of the species, concept of the species and the image url of the species on all inputs"}, {"role": "user", "content": "\nMicrosoft SQL Server Database Structure:\n\nCREATE TABLE \"dbo\".\"bounding_box_comments\" ( \"id\" bigint NOT NULL, \"bounding_box_uuid\" uniqueidentifier NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"text\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"alternate_concept\" varchar(255) NULL, \"flagged\" bit NULL, CONSTRAINT \"PK__bounding__3213E83F71625CCD\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"bounding_boxes\" (\"id\" bigint NOT NULL,\"concept\" varchar(255) NULL,\"created_timestamp\" datetime2(6) NULL,\"group_of\" bit NULL,\"height\" int NULL,\"last_updated_timestamp\" datetime2(6) NULL,\"observer\" varchar(256) NULL,\"occluded\" bit NULL,\"truncated\" bit NULL,\"uuid\" uniqueidentifier NOT NULL,\"verification_timestamp\" datetimeoffset(6) NULL,\"verified\" bit NULL,\"verifier\" varchar(256) NULL,\"width\" int NULL,\"x\" int NULL,\"y\" int NULL,\"image_id\" bigint NULL,\"alt_concept\" varchar(255) NULL,\"user_defined_key\" varchar(56) NULL, \"magnitude\" decimal(18,5) NULL, CONSTRAINT \"PK__bounding__3213E83F3E4C2D08\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE dbo.bounding_box_image_feature_vectors ( bounding_box_id bigint NOT NULL, vector_index int NULL, vector_value decimal(18,5) NULL, CONSTRAINT FK_bounding_box_image_feature_vectors_bounding_box_id FOREIGN KEY (bounding_box_id) REFERENCES dbo.bounding_boxes (id) ON DELETE CASCADE);\nCREATE TABLE \"dbo\".\"bounding_boxes_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"concept\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"group_of\" bit NULL, \"height\" int NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"observer\" varchar(256) NULL, \"occluded\" bit NULL, \"truncated\" bit NULL, \"uuid\" uniqueidentifier NULL, \"verification_timestamp\" datetimeoffset(6) NULL, \"verified\" bit NULL, \"verifier\" varchar(256) NULL, \"width\" int NULL, \"x\" int NULL, \"y\" int NULL, \"image_id\" bigint NULL, \"alt_concept\" varchar(255) NULL, \"user_defined_key\" varchar(56) NULL, CONSTRAINT \"PK__bounding__BE3894F99D30F28A\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"darwin_cores\" ( \"id\" bigint NOT NULL, \"access_rights\" varchar(1024) NULL, \"basis_of_record\" varchar(64) NULL, \"bibliographic_citation\" varchar(512) NULL, \"collection_code\" varchar(64) NULL, \"collection_id\" varchar(2048) NULL, \"data_generalizations\" varchar(512) NULL, \"dataset_id\" uniqueidentifier NULL, \"dataset_name\" varchar(255) NULL, \"dynamic_properties\"varchar(2048) NULL, \"information_withheld\" varchar(255) NULL, \"institution_code\" varchar(255) NULL, \"institution_id\" varchar(255) NULL, \"license\" varchar(2048) NULL, \"modified\" datetimeoffset(6) NULL, \"owner_institution_code\" varchar(255) NULL, \"record_language\" varchar(35) NULL, \"record_references\" varchar(2048) NULL, \"record_type\" varchar(32) NULL, \"rights_holder\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"image_set_upload_id\" bigint NULL, CONSTRAINT \"PK__darwin_c__3213E83F92DAE497\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities\" ( \"id\" bigint NOT NULL, \"api_key\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(255) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(255) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"avatar_url\" varchar(2000) NULL, \"orcid\" varchar(32) NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__3213E83F59FE1468\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"api_key\" varchar(255) NULL, \"avatar_url\" varchar(2000) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(254) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(64) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"orcid\" varchar(32) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__BE3894F9CD98EF78\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"followed_topics\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"notification\" bit NULL, \"target\" varchar(256) NULL, \"topic\" varchar(32) NULL, \"uuid\" uniqueidentifier NOT NULL, CONSTRAINT \"PK__followed__3213E83F4A1EA9E0\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_set_uploads\" ( \"id\" bigint NOT NULL, \"contributors_email\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"format\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"local_path\" varchar(2048) NULL, \"rejection_details\" varchar(255) NULL, \"rejection_reason\" varchar(255) NULL, \"remote_uri\" varchar(2048) NULL, \"sha256\" varchar(64) NULL, \"status\" varchar(255) NULL, \"status_update_timestamp\" datetimeoffset(6) NULL, \"status_updater_email\" varchar(254) NULL, \"uuid\" uniqueidentifier NOT NULL, \"darwincore_id\" bigint NULL, CONSTRAINT \"PK__image_se__3213E83F9C72A0E9\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_uploads_join\" ( \"imagesetupload_id\" bigint NOT NULL, \"image_id\" bigint NOT NULL, CONSTRAINT \"PK__image_up__8A53EE0EBD9D776A\" PRIMARY KEY CLUSTERED(\"imagesetupload_id\",\"image_id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"submitter\" varchar(255) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"valid\" bit NULL, \"width\" int NULL, \"contributors_email\"varchar(254) NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images__3213E83FD76E309F\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"contributors_email\"varchar(254) NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"valid\" bit NULL, \"width\" int NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images_a__BE3894F92DF6715C\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"marine_regions\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"last_updated_timestamp\" datetime2 NULL, \"max_latitude\" float NOT NULL, \"max_longitude\" float NOT NULL, \"min_latitude\" float NOT NULL, \"min_longitude\" float NOT NULL, \"mrgid\" bigint NULL, \"name\" varchar(255) NULL, CONSTRAINT \"PK__marine_r__3213E83FE987FC8B\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"revinfo\" ( \"rev\" int IDENTITY(1,1) NOT NULL, \"revtstmp\" bigint NULL, CONSTRAINT \"PK__revinfo__C2B7CC69D3938648\" PRIMARY KEY CLUSTERED(\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NOT NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"value\" varchar(255) NOT NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags__3213E83F3A490684\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"value\" varchar(255) NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags_aud__BE3894F94F1608A8\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE VIEW \"dbo\".\"boundingbox_extended_info\" AS\nSELECT b.concept, b.alt_concept, b.observer, b.verified, b.verifier, b.verification_timestamp, b.user_defined_key, i.url, i.width, i.height, i.submitter, i.[timestamp], i.contributors_email AS image_contributors_email, u.contributors_email AS upload_contributors_email, dc.owner_institution_code, dc.institution_code, dc.rights_holder, dc.collection_code, dc.collection_id, dc.dataset_name\nFROM dbo.darwin_cores dc LEFT JOIN dbo.image_set_uploads u ON dc.id = u.darwincore_id LEFT JOIN dbo.image_uploads_join j ON j.imagesetupload_id = u.id LEFT JOIN dbo.images i ON j.image_id = i.id LEFT JOIN dbo.bounding_boxes b ON b.image_id = i.id;\n\n\n User Prompt: Find me images similar to image found in bounding box 2290084\n "}, {"role": "assistant", "content": "{\"similarImageIDs\": [2290084], \"similarBoundingBoxIDs\": [], \"similarImageSearch\": true, \"sqlServerQuery\": \"SELECT TOP 10 SS.bb1, SS.bb2, BB.concept, IMG.url, SS.CosineSimilarity FROM SimilaritySearch SS INNER JOIN bounding_boxes BB ON BB.id = SS.bb2 INNER JOIN images IMG ON BB.image_id = IMG.id ORDER BY SS.CosineSimilarity DESC;\", \"responseText\": \"Here are the images similar to image found in bounding box 2290084.\"}"}]}
{"messages": [{"role": "system", "content": "You are a very intelligent json generated that can generate highly efficient sql queries. You will be given an input prompt for which you need to generated the JSON in a format given below, nothing else.\nThe Generated SQL must be valid for Micorsoft sql server\nThe JSON format and the attributes on the JSON are provided below\n{\n \"similarImageIDs\": [],\n \"similarBoundingBoxIDs\": [],\n \"similarImageSearch\": true/false,\n \"sqlServerQuery\": \"\",\n \"responseText\": \"\"\n}\nsimilarImageIDs: these are the image id that will be provided by the user in the prompt on which image search needs to be done\nsimilarBoundingBoxIDs: these are the bounding_boxes id that will be provided by the user in the prompt on which bounding boxes search needs to be done\nsimilarImageSearch: this is a boolean field, that is true when the prompt says to find similar images, else it is false\nsqlServerQuery: This is the sql server query you need to generate based on the user's prompt. The database structure provided will be very useful to generate the sql query. \nresponseText: Suppose you are answering the user with the output from the prompt. You need to write the message in this section. When the response is text, you need to output the textResponse in a way the values from the generated sql can be formatted in the text\n\nThe prompt will asks for similar images, there is another system that takes in the similarImageIDs and similarBoundingBoxIDs that you generated above to calculate the similarity search. You will suppose the similarity search is already done and you have sql table SimilaritySearch that has the input bounding box id as bb1, output bounding box id as bb2 and Cosine Similarity Score as CosineSimilarity. You will use this table and add the conditions that is given provided by the user. You will also ouput the ouput bounding box image url and the concept. The result must be ordered in descending order using the CosineSimilarity value. Also, you will take 10 top results unless specified by the prompt\nThe sql query must have bounding box id of the species, concept of the species and the image url of the species on all inputs"}, {"role": "user", "content": "\nMicrosoft SQL Server Database Structure:\n\nCREATE TABLE \"dbo\".\"bounding_box_comments\" ( \"id\" bigint NOT NULL, \"bounding_box_uuid\" uniqueidentifier NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"text\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"alternate_concept\" varchar(255) NULL, \"flagged\" bit NULL, CONSTRAINT \"PK__bounding__3213E83F71625CCD\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"bounding_boxes\" (\"id\" bigint NOT NULL,\"concept\" varchar(255) NULL,\"created_timestamp\" datetime2(6) NULL,\"group_of\" bit NULL,\"height\" int NULL,\"last_updated_timestamp\" datetime2(6) NULL,\"observer\" varchar(256) NULL,\"occluded\" bit NULL,\"truncated\" bit NULL,\"uuid\" uniqueidentifier NOT NULL,\"verification_timestamp\" datetimeoffset(6) NULL,\"verified\" bit NULL,\"verifier\" varchar(256) NULL,\"width\" int NULL,\"x\" int NULL,\"y\" int NULL,\"image_id\" bigint NULL,\"alt_concept\" varchar(255) NULL,\"user_defined_key\" varchar(56) NULL, \"magnitude\" decimal(18,5) NULL, CONSTRAINT \"PK__bounding__3213E83F3E4C2D08\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE dbo.bounding_box_image_feature_vectors ( bounding_box_id bigint NOT NULL, vector_index int NULL, vector_value decimal(18,5) NULL, CONSTRAINT FK_bounding_box_image_feature_vectors_bounding_box_id FOREIGN KEY (bounding_box_id) REFERENCES dbo.bounding_boxes (id) ON DELETE CASCADE);\nCREATE TABLE \"dbo\".\"bounding_boxes_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"concept\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"group_of\" bit NULL, \"height\" int NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"observer\" varchar(256) NULL, \"occluded\" bit NULL, \"truncated\" bit NULL, \"uuid\" uniqueidentifier NULL, \"verification_timestamp\" datetimeoffset(6) NULL, \"verified\" bit NULL, \"verifier\" varchar(256) NULL, \"width\" int NULL, \"x\" int NULL, \"y\" int NULL, \"image_id\" bigint NULL, \"alt_concept\" varchar(255) NULL, \"user_defined_key\" varchar(56) NULL, CONSTRAINT \"PK__bounding__BE3894F99D30F28A\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"darwin_cores\" ( \"id\" bigint NOT NULL, \"access_rights\" varchar(1024) NULL, \"basis_of_record\" varchar(64) NULL, \"bibliographic_citation\" varchar(512) NULL, \"collection_code\" varchar(64) NULL, \"collection_id\" varchar(2048) NULL, \"data_generalizations\" varchar(512) NULL, \"dataset_id\" uniqueidentifier NULL, \"dataset_name\" varchar(255) NULL, \"dynamic_properties\"varchar(2048) NULL, \"information_withheld\" varchar(255) NULL, \"institution_code\" varchar(255) NULL, \"institution_id\" varchar(255) NULL, \"license\" varchar(2048) NULL, \"modified\" datetimeoffset(6) NULL, \"owner_institution_code\" varchar(255) NULL, \"record_language\" varchar(35) NULL, \"record_references\" varchar(2048) NULL, \"record_type\" varchar(32) NULL, \"rights_holder\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"image_set_upload_id\" bigint NULL, CONSTRAINT \"PK__darwin_c__3213E83F92DAE497\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities\" ( \"id\" bigint NOT NULL, \"api_key\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(255) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(255) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"avatar_url\" varchar(2000) NULL, \"orcid\" varchar(32) NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__3213E83F59FE1468\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"api_key\" varchar(255) NULL, \"avatar_url\" varchar(2000) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(254) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(64) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"orcid\" varchar(32) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__BE3894F9CD98EF78\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"followed_topics\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"notification\" bit NULL, \"target\" varchar(256) NULL, \"topic\" varchar(32) NULL, \"uuid\" uniqueidentifier NOT NULL, CONSTRAINT \"PK__followed__3213E83F4A1EA9E0\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_set_uploads\" ( \"id\" bigint NOT NULL, \"contributors_email\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"format\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"local_path\" varchar(2048) NULL, \"rejection_details\" varchar(255) NULL, \"rejection_reason\" varchar(255) NULL, \"remote_uri\" varchar(2048) NULL, \"sha256\" varchar(64) NULL, \"status\" varchar(255) NULL, \"status_update_timestamp\" datetimeoffset(6) NULL, \"status_updater_email\" varchar(254) NULL, \"uuid\" uniqueidentifier NOT NULL, \"darwincore_id\" bigint NULL, CONSTRAINT \"PK__image_se__3213E83F9C72A0E9\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_uploads_join\" ( \"imagesetupload_id\" bigint NOT NULL, \"image_id\" bigint NOT NULL, CONSTRAINT \"PK__image_up__8A53EE0EBD9D776A\" PRIMARY KEY CLUSTERED(\"imagesetupload_id\",\"image_id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"submitter\" varchar(255) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"valid\" bit NULL, \"width\" int NULL, \"contributors_email\"varchar(254) NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images__3213E83FD76E309F\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"contributors_email\"varchar(254) NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"valid\" bit NULL, \"width\" int NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images_a__BE3894F92DF6715C\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"marine_regions\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"last_updated_timestamp\" datetime2 NULL, \"max_latitude\" float NOT NULL, \"max_longitude\" float NOT NULL, \"min_latitude\" float NOT NULL, \"min_longitude\" float NOT NULL, \"mrgid\" bigint NULL, \"name\" varchar(255) NULL, CONSTRAINT \"PK__marine_r__3213E83FE987FC8B\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"revinfo\" ( \"rev\" int IDENTITY(1,1) NOT NULL, \"revtstmp\" bigint NULL, CONSTRAINT \"PK__revinfo__C2B7CC69D3938648\" PRIMARY KEY CLUSTERED(\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NOT NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"value\" varchar(255) NOT NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags__3213E83F3A490684\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"value\" varchar(255) NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags_aud__BE3894F94F1608A8\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE VIEW \"dbo\".\"boundingbox_extended_info\" AS\nSELECT b.concept, b.alt_concept, b.observer, b.verified, b.verifier, b.verification_timestamp, b.user_defined_key, i.url, i.width, i.height, i.submitter, i.[timestamp], i.contributors_email AS image_contributors_email, u.contributors_email AS upload_contributors_email, dc.owner_institution_code, dc.institution_code, dc.rights_holder, dc.collection_code, dc.collection_id, dc.dataset_name\nFROM dbo.darwin_cores dc LEFT JOIN dbo.image_set_uploads u ON dc.id = u.darwincore_id LEFT JOIN dbo.image_uploads_join j ON j.imagesetupload_id = u.id LEFT JOIN dbo.images i ON j.image_id = i.id LEFT JOIN dbo.bounding_boxes b ON b.image_id = i.id;\n\n\n User Prompt: Find me similar images of species that are found depth level of 5000m and lower\n "}, {"role": "assistant", "content": "{\"similarImageIDs\": [], \"similarBoundingBoxIDs\": [], \"similarImageSearch\": true, \"sqlServerQuery\": \"SELECT TOP 10 SS.bb1, SS.bb2, BB.concept, IMG.url, SS.CosineSimilarity FROM SimilaritySearch SS INNER JOIN bounding_boxes BB ON BB.id = SS.bb2 INNER JOIN images IMG ON BB.image_id = IMG.id WHERE IMG.depth_meters < 5000 ORDER BY SS.CosineSimilarity DESC;\", \"responseText\": \"Here are the similar images of species that are found below depth level of 5000m and lower\"}"}]}
{"messages": [{"role": "system", "content": "You are a very intelligent json generated that can generate highly efficient sql queries. You will be given an input prompt for which you need to generated the JSON in a format given below, nothing else.\nThe Generated SQL must be valid for Micorsoft sql server\nThe JSON format and the attributes on the JSON are provided below\n{\n \"similarImageIDs\": [],\n \"similarBoundingBoxIDs\": [],\n \"similarImageSearch\": true/false,\n \"sqlServerQuery\": \"\",\n \"responseText\": \"\"\n}\nsimilarImageIDs: these are the image id that will be provided by the user in the prompt on which image search needs to be done\nsimilarBoundingBoxIDs: these are the bounding_boxes id that will be provided by the user in the prompt on which bounding boxes search needs to be done\nsimilarImageSearch: this is a boolean field, that is true when the prompt says to find similar images, else it is false\nsqlServerQuery: This is the sql server query you need to generate based on the user's prompt. The database structure provided will be very useful to generate the sql query. \nresponseText: Suppose you are answering the user with the output from the prompt. You need to write the message in this section. When the response is text, you need to output the textResponse in a way the values from the generated sql can be formatted in the text\n\nThe prompt will asks for similar images, there is another system that takes in the similarImageIDs and similarBoundingBoxIDs that you generated above to calculate the similarity search. You will suppose the similarity search is already done and you have sql table SimilaritySearch that has the input bounding box id as bb1, output bounding box id as bb2 and Cosine Similarity Score as CosineSimilarity. You will use this table and add the conditions that is given provided by the user. You will also ouput the ouput bounding box image url and the concept. The result must be ordered in descending order using the CosineSimilarity value. Also, you will take 10 top results unless specified by the prompt\nThe sql query must have bounding box id of the species, concept of the species and the image url of the species on all inputs"}, {"role": "user", "content": "\nMicrosoft SQL Server Database Structure:\n\nCREATE TABLE \"dbo\".\"bounding_box_comments\" ( \"id\" bigint NOT NULL, \"bounding_box_uuid\" uniqueidentifier NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"text\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"alternate_concept\" varchar(255) NULL, \"flagged\" bit NULL, CONSTRAINT \"PK__bounding__3213E83F71625CCD\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"bounding_boxes\" (\"id\" bigint NOT NULL,\"concept\" varchar(255) NULL,\"created_timestamp\" datetime2(6) NULL,\"group_of\" bit NULL,\"height\" int NULL,\"last_updated_timestamp\" datetime2(6) NULL,\"observer\" varchar(256) NULL,\"occluded\" bit NULL,\"truncated\" bit NULL,\"uuid\" uniqueidentifier NOT NULL,\"verification_timestamp\" datetimeoffset(6) NULL,\"verified\" bit NULL,\"verifier\" varchar(256) NULL,\"width\" int NULL,\"x\" int NULL,\"y\" int NULL,\"image_id\" bigint NULL,\"alt_concept\" varchar(255) NULL,\"user_defined_key\" varchar(56) NULL, \"magnitude\" decimal(18,5) NULL, CONSTRAINT \"PK__bounding__3213E83F3E4C2D08\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE dbo.bounding_box_image_feature_vectors ( bounding_box_id bigint NOT NULL, vector_index int NULL, vector_value decimal(18,5) NULL, CONSTRAINT FK_bounding_box_image_feature_vectors_bounding_box_id FOREIGN KEY (bounding_box_id) REFERENCES dbo.bounding_boxes (id) ON DELETE CASCADE);\nCREATE TABLE \"dbo\".\"bounding_boxes_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"concept\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"group_of\" bit NULL, \"height\" int NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"observer\" varchar(256) NULL, \"occluded\" bit NULL, \"truncated\" bit NULL, \"uuid\" uniqueidentifier NULL, \"verification_timestamp\" datetimeoffset(6) NULL, \"verified\" bit NULL, \"verifier\" varchar(256) NULL, \"width\" int NULL, \"x\" int NULL, \"y\" int NULL, \"image_id\" bigint NULL, \"alt_concept\" varchar(255) NULL, \"user_defined_key\" varchar(56) NULL, CONSTRAINT \"PK__bounding__BE3894F99D30F28A\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"darwin_cores\" ( \"id\" bigint NOT NULL, \"access_rights\" varchar(1024) NULL, \"basis_of_record\" varchar(64) NULL, \"bibliographic_citation\" varchar(512) NULL, \"collection_code\" varchar(64) NULL, \"collection_id\" varchar(2048) NULL, \"data_generalizations\" varchar(512) NULL, \"dataset_id\" uniqueidentifier NULL, \"dataset_name\" varchar(255) NULL, \"dynamic_properties\"varchar(2048) NULL, \"information_withheld\" varchar(255) NULL, \"institution_code\" varchar(255) NULL, \"institution_id\" varchar(255) NULL, \"license\" varchar(2048) NULL, \"modified\" datetimeoffset(6) NULL, \"owner_institution_code\" varchar(255) NULL, \"record_language\" varchar(35) NULL, \"record_references\" varchar(2048) NULL, \"record_type\" varchar(32) NULL, \"rights_holder\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"image_set_upload_id\" bigint NULL, CONSTRAINT \"PK__darwin_c__3213E83F92DAE497\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities\" ( \"id\" bigint NOT NULL, \"api_key\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(255) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(255) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"avatar_url\" varchar(2000) NULL, \"orcid\" varchar(32) NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__3213E83F59FE1468\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"api_key\" varchar(255) NULL, \"avatar_url\" varchar(2000) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(254) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(64) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"orcid\" varchar(32) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__BE3894F9CD98EF78\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"followed_topics\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"notification\" bit NULL, \"target\" varchar(256) NULL, \"topic\" varchar(32) NULL, \"uuid\" uniqueidentifier NOT NULL, CONSTRAINT \"PK__followed__3213E83F4A1EA9E0\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_set_uploads\" ( \"id\" bigint NOT NULL, \"contributors_email\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"format\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"local_path\" varchar(2048) NULL, \"rejection_details\" varchar(255) NULL, \"rejection_reason\" varchar(255) NULL, \"remote_uri\" varchar(2048) NULL, \"sha256\" varchar(64) NULL, \"status\" varchar(255) NULL, \"status_update_timestamp\" datetimeoffset(6) NULL, \"status_updater_email\" varchar(254) NULL, \"uuid\" uniqueidentifier NOT NULL, \"darwincore_id\" bigint NULL, CONSTRAINT \"PK__image_se__3213E83F9C72A0E9\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_uploads_join\" ( \"imagesetupload_id\" bigint NOT NULL, \"image_id\" bigint NOT NULL, CONSTRAINT \"PK__image_up__8A53EE0EBD9D776A\" PRIMARY KEY CLUSTERED(\"imagesetupload_id\",\"image_id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"submitter\" varchar(255) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"valid\" bit NULL, \"width\" int NULL, \"contributors_email\"varchar(254) NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images__3213E83FD76E309F\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"contributors_email\"varchar(254) NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"valid\" bit NULL, \"width\" int NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images_a__BE3894F92DF6715C\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"marine_regions\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"last_updated_timestamp\" datetime2 NULL, \"max_latitude\" float NOT NULL, \"max_longitude\" float NOT NULL, \"min_latitude\" float NOT NULL, \"min_longitude\" float NOT NULL, \"mrgid\" bigint NULL, \"name\" varchar(255) NULL, CONSTRAINT \"PK__marine_r__3213E83FE987FC8B\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"revinfo\" ( \"rev\" int IDENTITY(1,1) NOT NULL, \"revtstmp\" bigint NULL, CONSTRAINT \"PK__revinfo__C2B7CC69D3938648\" PRIMARY KEY CLUSTERED(\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NOT NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"value\" varchar(255) NOT NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags__3213E83F3A490684\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"value\" varchar(255) NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags_aud__BE3894F94F1608A8\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE VIEW \"dbo\".\"boundingbox_extended_info\" AS\nSELECT b.concept, b.alt_concept, b.observer, b.verified, b.verifier, b.verification_timestamp, b.user_defined_key, i.url, i.width, i.height, i.submitter, i.[timestamp], i.contributors_email AS image_contributors_email, u.contributors_email AS upload_contributors_email, dc.owner_institution_code, dc.institution_code, dc.rights_holder, dc.collection_code, dc.collection_id, dc.dataset_name\nFROM dbo.darwin_cores dc LEFT JOIN dbo.image_set_uploads u ON dc.id = u.darwincore_id LEFT JOIN dbo.image_uploads_join j ON j.imagesetupload_id = u.id LEFT JOIN dbo.images i ON j.image_id = i.id LEFT JOIN dbo.bounding_boxes b ON b.image_id = i.id;\n\n\n User Prompt: Find me similar looking fish found in Atlantic Ocean\n "}, {"role": "assistant", "content": "{\"similarImageIDs\": [], \"similarBoundingBoxIDs\": [], \"similarImageSearch\": true, \"sqlServerQuery\": \"SELECT TOP 10 SS.bb1, SS.bb2, BB.concept, IMG.url, SS.CosineSimilarity FROM SimilaritySearch SS INNER JOIN bounding_boxes BB ON BB.id = SS.bb2 INNER JOIN images IMG ON BB.image_id = IMG.id INNER JOIN marine_regions MR ON IMG.latitude BETWEEN MR.min_latitude AND MR.max_latitude AND IMG.longitude BETWEEN MR.min_longitude AND MR.max_longitude WHERE MR.name = 'Atlantic Ocean' ORDER BY SS.CosineSimilarity DESC;\", \"responseText\": \"Below are similar looking fish found in Atlantic Ocean.\"}"}]}
{"messages": [{"role": "system", "content": "You are a very intelligent json generated that can generate highly efficient sql queries. You will be given an input prompt for which you need to generated the JSON in a format given below, nothing else.\nThe Generated SQL must be valid for Micorsoft sql server\nThe JSON format and the attributes on the JSON are provided below\n{\n \"similarImageIDs\": [],\n \"similarBoundingBoxIDs\": [],\n \"similarImageSearch\": true/false,\n \"sqlServerQuery\": \"\",\n \"responseText\": \"\"\n}\nsimilarImageIDs: these are the image id that will be provided by the user in the prompt on which image search needs to be done\nsimilarBoundingBoxIDs: these are the bounding_boxes id that will be provided by the user in the prompt on which bounding boxes search needs to be done\nsimilarImageSearch: this is a boolean field, that is true when the prompt says to find similar images, else it is false\nsqlServerQuery: This is the sql server query you need to generate based on the user's prompt. The database structure provided will be very useful to generate the sql query. \nresponseText: Suppose you are answering the user with the output from the prompt. You need to write the message in this section. When the response is text, you need to output the textResponse in a way the values from the generated sql can be formatted in the text\n\nThe prompt will asks for similar images, there is another system that takes in the similarImageIDs and similarBoundingBoxIDs that you generated above to calculate the similarity search. You will suppose the similarity search is already done and you have sql table SimilaritySearch that has the input bounding box id as bb1, output bounding box id as bb2 and Cosine Similarity Score as CosineSimilarity. You will use this table and add the conditions that is given provided by the user. You will also ouput the ouput bounding box image url and the concept. The result must be ordered in descending order using the CosineSimilarity value. Also, you will take 10 top results unless specified by the prompt\nThe sql query must have bounding box id of the species, concept of the species and the image url of the species on all inputs"}, {"role": "user", "content": "\nMicrosoft SQL Server Database Structure:\n\nCREATE TABLE \"dbo\".\"bounding_box_comments\" ( \"id\" bigint NOT NULL, \"bounding_box_uuid\" uniqueidentifier NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"text\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"alternate_concept\" varchar(255) NULL, \"flagged\" bit NULL, CONSTRAINT \"PK__bounding__3213E83F71625CCD\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"bounding_boxes\" (\"id\" bigint NOT NULL,\"concept\" varchar(255) NULL,\"created_timestamp\" datetime2(6) NULL,\"group_of\" bit NULL,\"height\" int NULL,\"last_updated_timestamp\" datetime2(6) NULL,\"observer\" varchar(256) NULL,\"occluded\" bit NULL,\"truncated\" bit NULL,\"uuid\" uniqueidentifier NOT NULL,\"verification_timestamp\" datetimeoffset(6) NULL,\"verified\" bit NULL,\"verifier\" varchar(256) NULL,\"width\" int NULL,\"x\" int NULL,\"y\" int NULL,\"image_id\" bigint NULL,\"alt_concept\" varchar(255) NULL,\"user_defined_key\" varchar(56) NULL, \"magnitude\" decimal(18,5) NULL, CONSTRAINT \"PK__bounding__3213E83F3E4C2D08\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE dbo.bounding_box_image_feature_vectors ( bounding_box_id bigint NOT NULL, vector_index int NULL, vector_value decimal(18,5) NULL, CONSTRAINT FK_bounding_box_image_feature_vectors_bounding_box_id FOREIGN KEY (bounding_box_id) REFERENCES dbo.bounding_boxes (id) ON DELETE CASCADE);\nCREATE TABLE \"dbo\".\"bounding_boxes_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"concept\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"group_of\" bit NULL, \"height\" int NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"observer\" varchar(256) NULL, \"occluded\" bit NULL, \"truncated\" bit NULL, \"uuid\" uniqueidentifier NULL, \"verification_timestamp\" datetimeoffset(6) NULL, \"verified\" bit NULL, \"verifier\" varchar(256) NULL, \"width\" int NULL, \"x\" int NULL, \"y\" int NULL, \"image_id\" bigint NULL, \"alt_concept\" varchar(255) NULL, \"user_defined_key\" varchar(56) NULL, CONSTRAINT \"PK__bounding__BE3894F99D30F28A\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"darwin_cores\" ( \"id\" bigint NOT NULL, \"access_rights\" varchar(1024) NULL, \"basis_of_record\" varchar(64) NULL, \"bibliographic_citation\" varchar(512) NULL, \"collection_code\" varchar(64) NULL, \"collection_id\" varchar(2048) NULL, \"data_generalizations\" varchar(512) NULL, \"dataset_id\" uniqueidentifier NULL, \"dataset_name\" varchar(255) NULL, \"dynamic_properties\"varchar(2048) NULL, \"information_withheld\" varchar(255) NULL, \"institution_code\" varchar(255) NULL, \"institution_id\" varchar(255) NULL, \"license\" varchar(2048) NULL, \"modified\" datetimeoffset(6) NULL, \"owner_institution_code\" varchar(255) NULL, \"record_language\" varchar(35) NULL, \"record_references\" varchar(2048) NULL, \"record_type\" varchar(32) NULL, \"rights_holder\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"image_set_upload_id\" bigint NULL, CONSTRAINT \"PK__darwin_c__3213E83F92DAE497\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities\" ( \"id\" bigint NOT NULL, \"api_key\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(255) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(255) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"avatar_url\" varchar(2000) NULL, \"orcid\" varchar(32) NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__3213E83F59FE1468\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"api_key\" varchar(255) NULL, \"avatar_url\" varchar(2000) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(254) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(64) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"orcid\" varchar(32) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__BE3894F9CD98EF78\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"followed_topics\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"notification\" bit NULL, \"target\" varchar(256) NULL, \"topic\" varchar(32) NULL, \"uuid\" uniqueidentifier NOT NULL, CONSTRAINT \"PK__followed__3213E83F4A1EA9E0\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_set_uploads\" ( \"id\" bigint NOT NULL, \"contributors_email\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"format\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"local_path\" varchar(2048) NULL, \"rejection_details\" varchar(255) NULL, \"rejection_reason\" varchar(255) NULL, \"remote_uri\" varchar(2048) NULL, \"sha256\" varchar(64) NULL, \"status\" varchar(255) NULL, \"status_update_timestamp\" datetimeoffset(6) NULL, \"status_updater_email\" varchar(254) NULL, \"uuid\" uniqueidentifier NOT NULL, \"darwincore_id\" bigint NULL, CONSTRAINT \"PK__image_se__3213E83F9C72A0E9\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_uploads_join\" ( \"imagesetupload_id\" bigint NOT NULL, \"image_id\" bigint NOT NULL, CONSTRAINT \"PK__image_up__8A53EE0EBD9D776A\" PRIMARY KEY CLUSTERED(\"imagesetupload_id\",\"image_id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"submitter\" varchar(255) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"valid\" bit NULL, \"width\" int NULL, \"contributors_email\"varchar(254) NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images__3213E83FD76E309F\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"contributors_email\"varchar(254) NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"valid\" bit NULL, \"width\" int NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images_a__BE3894F92DF6715C\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"marine_regions\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"last_updated_timestamp\" datetime2 NULL, \"max_latitude\" float NOT NULL, \"max_longitude\" float NOT NULL, \"min_latitude\" float NOT NULL, \"min_longitude\" float NOT NULL, \"mrgid\" bigint NULL, \"name\" varchar(255) NULL, CONSTRAINT \"PK__marine_r__3213E83FE987FC8B\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"revinfo\" ( \"rev\" int IDENTITY(1,1) NOT NULL, \"revtstmp\" bigint NULL, CONSTRAINT \"PK__revinfo__C2B7CC69D3938648\" PRIMARY KEY CLUSTERED(\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NOT NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"value\" varchar(255) NOT NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags__3213E83F3A490684\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"value\" varchar(255) NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags_aud__BE3894F94F1608A8\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE VIEW \"dbo\".\"boundingbox_extended_info\" AS\nSELECT b.concept, b.alt_concept, b.observer, b.verified, b.verifier, b.verification_timestamp, b.user_defined_key, i.url, i.width, i.height, i.submitter, i.[timestamp], i.contributors_email AS image_contributors_email, u.contributors_email AS upload_contributors_email, dc.owner_institution_code, dc.institution_code, dc.rights_holder, dc.collection_code, dc.collection_id, dc.dataset_name\nFROM dbo.darwin_cores dc LEFT JOIN dbo.image_set_uploads u ON dc.id = u.darwincore_id LEFT JOIN dbo.image_uploads_join j ON j.imagesetupload_id = u.id LEFT JOIN dbo.images i ON j.image_id = i.id LEFT JOIN dbo.bounding_boxes b ON b.image_id = i.id;\n\n\n User Prompt: Find me images of species that looks alike to the provided image and are found in Monterey Bay\n "}, {"role": "assistant", "content": "{\"similarImageIDs\": [], \"similarBoundingBoxIDs\": [], \"similarImageSearch\": true, \"sqlServerQuery\": \"SELECT TOP 10 SS.bb1, SS.bb2, BB.concept, IMG.url, SS.CosineSimilarity FROM SimilaritySearch SS INNER JOIN bounding_boxes BB ON BB.id = SS.bb2 INNER JOIN images IMG ON BB.image_id = IMG.id INNER JOIN marine_regions MR ON IMG.latitude BETWEEN MR.min_latitude AND MR.max_latitude AND IMG.longitude BETWEEN MR.min_longitude AND MR.max_longitude WHERE MR.name = 'Monterey Bay' ORDER BY SS.CosineSimilarity DESC;\", \"responseText\": \"Below are images of species that looks alike to the provided image and are found in Monterey Bay.\"}"}]}
{"messages": [{"role": "system", "content": "You are a very intelligent json generated that can generate highly efficient sql queries. You will be given an input prompt for which you need to generated the JSON in a format given below, nothing else.\nThe Generated SQL must be valid for Micorsoft sql server\nThe JSON format and the attributes on the JSON are provided below\n{\n \"similarImageIDs\": [],\n \"similarBoundingBoxIDs\": [],\n \"similarImageSearch\": true/false,\n \"sqlServerQuery\": \"\",\n \"responseText\": \"\"\n}\nsimilarImageIDs: these are the image id that will be provided by the user in the prompt on which image search needs to be done\nsimilarBoundingBoxIDs: these are the bounding_boxes id that will be provided by the user in the prompt on which bounding boxes search needs to be done\nsimilarImageSearch: this is a boolean field, that is true when the prompt says to find similar images, else it is false\nsqlServerQuery: This is the sql server query you need to generate based on the user's prompt. The database structure provided will be very useful to generate the sql query. \nresponseText: Suppose you are answering the user with the output from the prompt. You need to write the message in this section. When the response is text, you need to output the textResponse in a way the values from the generated sql can be formatted in the text\n\nThe prompt will asks for similar images, there is another system that takes in the similarImageIDs and similarBoundingBoxIDs that you generated above to calculate the similarity search. You will suppose the similarity search is already done and you have sql table SimilaritySearch that has the input bounding box id as bb1, output bounding box id as bb2 and Cosine Similarity Score as CosineSimilarity. You will use this table and add the conditions that is given provided by the user. You will also ouput the ouput bounding box image url and the concept. The result must be ordered in descending order using the CosineSimilarity value. Also, you will take 10 top results unless specified by the prompt\nThe sql query must have bounding box id of the species, concept of the species and the image url of the species on all inputs"}, {"role": "user", "content": "\nMicrosoft SQL Server Database Structure:\n\nCREATE TABLE \"dbo\".\"bounding_box_comments\" ( \"id\" bigint NOT NULL, \"bounding_box_uuid\" uniqueidentifier NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"text\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"alternate_concept\" varchar(255) NULL, \"flagged\" bit NULL, CONSTRAINT \"PK__bounding__3213E83F71625CCD\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"bounding_boxes\" (\"id\" bigint NOT NULL,\"concept\" varchar(255) NULL,\"created_timestamp\" datetime2(6) NULL,\"group_of\" bit NULL,\"height\" int NULL,\"last_updated_timestamp\" datetime2(6) NULL,\"observer\" varchar(256) NULL,\"occluded\" bit NULL,\"truncated\" bit NULL,\"uuid\" uniqueidentifier NOT NULL,\"verification_timestamp\" datetimeoffset(6) NULL,\"verified\" bit NULL,\"verifier\" varchar(256) NULL,\"width\" int NULL,\"x\" int NULL,\"y\" int NULL,\"image_id\" bigint NULL,\"alt_concept\" varchar(255) NULL,\"user_defined_key\" varchar(56) NULL, \"magnitude\" decimal(18,5) NULL, CONSTRAINT \"PK__bounding__3213E83F3E4C2D08\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE dbo.bounding_box_image_feature_vectors ( bounding_box_id bigint NOT NULL, vector_index int NULL, vector_value decimal(18,5) NULL, CONSTRAINT FK_bounding_box_image_feature_vectors_bounding_box_id FOREIGN KEY (bounding_box_id) REFERENCES dbo.bounding_boxes (id) ON DELETE CASCADE);\nCREATE TABLE \"dbo\".\"bounding_boxes_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"concept\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"group_of\" bit NULL, \"height\" int NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"observer\" varchar(256) NULL, \"occluded\" bit NULL, \"truncated\" bit NULL, \"uuid\" uniqueidentifier NULL, \"verification_timestamp\" datetimeoffset(6) NULL, \"verified\" bit NULL, \"verifier\" varchar(256) NULL, \"width\" int NULL, \"x\" int NULL, \"y\" int NULL, \"image_id\" bigint NULL, \"alt_concept\" varchar(255) NULL, \"user_defined_key\" varchar(56) NULL, CONSTRAINT \"PK__bounding__BE3894F99D30F28A\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"darwin_cores\" ( \"id\" bigint NOT NULL, \"access_rights\" varchar(1024) NULL, \"basis_of_record\" varchar(64) NULL, \"bibliographic_citation\" varchar(512) NULL, \"collection_code\" varchar(64) NULL, \"collection_id\" varchar(2048) NULL, \"data_generalizations\" varchar(512) NULL, \"dataset_id\" uniqueidentifier NULL, \"dataset_name\" varchar(255) NULL, \"dynamic_properties\"varchar(2048) NULL, \"information_withheld\" varchar(255) NULL, \"institution_code\" varchar(255) NULL, \"institution_id\" varchar(255) NULL, \"license\" varchar(2048) NULL, \"modified\" datetimeoffset(6) NULL, \"owner_institution_code\" varchar(255) NULL, \"record_language\" varchar(35) NULL, \"record_references\" varchar(2048) NULL, \"record_type\" varchar(32) NULL, \"rights_holder\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"image_set_upload_id\" bigint NULL, CONSTRAINT \"PK__darwin_c__3213E83F92DAE497\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities\" ( \"id\" bigint NOT NULL, \"api_key\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(255) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(255) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"avatar_url\" varchar(2000) NULL, \"orcid\" varchar(32) NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__3213E83F59FE1468\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"api_key\" varchar(255) NULL, \"avatar_url\" varchar(2000) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(254) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(64) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"orcid\" varchar(32) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__BE3894F9CD98EF78\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"followed_topics\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"notification\" bit NULL, \"target\" varchar(256) NULL, \"topic\" varchar(32) NULL, \"uuid\" uniqueidentifier NOT NULL, CONSTRAINT \"PK__followed__3213E83F4A1EA9E0\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_set_uploads\" ( \"id\" bigint NOT NULL, \"contributors_email\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"format\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"local_path\" varchar(2048) NULL, \"rejection_details\" varchar(255) NULL, \"rejection_reason\" varchar(255) NULL, \"remote_uri\" varchar(2048) NULL, \"sha256\" varchar(64) NULL, \"status\" varchar(255) NULL, \"status_update_timestamp\" datetimeoffset(6) NULL, \"status_updater_email\" varchar(254) NULL, \"uuid\" uniqueidentifier NOT NULL, \"darwincore_id\" bigint NULL, CONSTRAINT \"PK__image_se__3213E83F9C72A0E9\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_uploads_join\" ( \"imagesetupload_id\" bigint NOT NULL, \"image_id\" bigint NOT NULL, CONSTRAINT \"PK__image_up__8A53EE0EBD9D776A\" PRIMARY KEY CLUSTERED(\"imagesetupload_id\",\"image_id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"submitter\" varchar(255) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"valid\" bit NULL, \"width\" int NULL, \"contributors_email\"varchar(254) NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images__3213E83FD76E309F\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"contributors_email\"varchar(254) NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"valid\" bit NULL, \"width\" int NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images_a__BE3894F92DF6715C\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"marine_regions\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"last_updated_timestamp\" datetime2 NULL, \"max_latitude\" float NOT NULL, \"max_longitude\" float NOT NULL, \"min_latitude\" float NOT NULL, \"min_longitude\" float NOT NULL, \"mrgid\" bigint NULL, \"name\" varchar(255) NULL, CONSTRAINT \"PK__marine_r__3213E83FE987FC8B\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"revinfo\" ( \"rev\" int IDENTITY(1,1) NOT NULL, \"revtstmp\" bigint NULL, CONSTRAINT \"PK__revinfo__C2B7CC69D3938648\" PRIMARY KEY CLUSTERED(\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NOT NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"value\" varchar(255) NOT NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags__3213E83F3A490684\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"value\" varchar(255) NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags_aud__BE3894F94F1608A8\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE VIEW \"dbo\".\"boundingbox_extended_info\" AS\nSELECT b.concept, b.alt_concept, b.observer, b.verified, b.verifier, b.verification_timestamp, b.user_defined_key, i.url, i.width, i.height, i.submitter, i.[timestamp], i.contributors_email AS image_contributors_email, u.contributors_email AS upload_contributors_email, dc.owner_institution_code, dc.institution_code, dc.rights_holder, dc.collection_code, dc.collection_id, dc.dataset_name\nFROM dbo.darwin_cores dc LEFT JOIN dbo.image_set_uploads u ON dc.id = u.darwincore_id LEFT JOIN dbo.image_uploads_join j ON j.imagesetupload_id = u.id LEFT JOIN dbo.images i ON j.image_id = i.id LEFT JOIN dbo.bounding_boxes b ON b.image_id = i.id;\n\n\n User Prompt: Find me images of species that looks alike that live at oxygen level between 0.5 to 1 ml per liter\n "}, {"role": "assistant", "content": "{\"similarImageIDs\": [], \"similarBoundingBoxIDs\": [], \"similarImageSearch\": true, \"sqlServerQuery\": \"SELECT TOP 10 SS.bb1, SS.bb2, BB.concept, IMG.url, SS.CosineSimilarity FROM SimilaritySearch SS INNER JOIN bounding_boxes BB ON BB.id = SS.bb2 INNER JOIN images IMG ON BB.image_id = IMG.id WHERE IMG.oxygen_ml_l BETWEEN 0.5 AND 1 ORDER BY SS.CosineSimilarity DESC;\", \"responseText\": \"Below are images of species that looks alike that live at oxygen level between 0.5 to 1 ml per liter.\"}"}]}
{"messages": [{"role": "system", "content": "You are a very intelligent json generated that can generate highly efficient sql queries. You will be given an input prompt for which you need to generated the JSON in a format given below, nothing else.\nThe Generated SQL must be valid for Micorsoft sql server\nThe JSON format and the attributes on the JSON are provided below\n{\n \"similarImageIDs\": [],\n \"similarBoundingBoxIDs\": [],\n \"similarImageSearch\": true/false,\n \"sqlServerQuery\": \"\",\n \"responseText\": \"\"\n}\nsimilarImageIDs: these are the image id that will be provided by the user in the prompt on which image search needs to be done\nsimilarBoundingBoxIDs: these are the bounding_boxes id that will be provided by the user in the prompt on which bounding boxes search needs to be done\nsimilarImageSearch: this is a boolean field, that is true when the prompt says to find similar images, else it is false\nsqlServerQuery: This is the sql server query you need to generate based on the user's prompt. The database structure provided will be very useful to generate the sql query. \nresponseText: Suppose you are answering the user with the output from the prompt. You need to write the message in this section. When the response is text, you need to output the textResponse in a way the values from the generated sql can be formatted in the text\n\nThe prompt will asks for similar images, there is another system that takes in the similarImageIDs and similarBoundingBoxIDs that you generated above to calculate the similarity search. You will suppose the similarity search is already done and you have sql table SimilaritySearch that has the input bounding box id as bb1, output bounding box id as bb2 and Cosine Similarity Score as CosineSimilarity. You will use this table and add the conditions that is given provided by the user. You will also ouput the ouput bounding box image url and the concept. The result must be ordered in descending order using the CosineSimilarity value. Also, you will take 10 top results unless specified by the prompt\nThe sql query must have bounding box id of the species, concept of the species and the image url of the species on all inputs"}, {"role": "user", "content": "\nMicrosoft SQL Server Database Structure:\n\nCREATE TABLE \"dbo\".\"bounding_box_comments\" ( \"id\" bigint NOT NULL, \"bounding_box_uuid\" uniqueidentifier NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"text\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"alternate_concept\" varchar(255) NULL, \"flagged\" bit NULL, CONSTRAINT \"PK__bounding__3213E83F71625CCD\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"bounding_boxes\" (\"id\" bigint NOT NULL,\"concept\" varchar(255) NULL,\"created_timestamp\" datetime2(6) NULL,\"group_of\" bit NULL,\"height\" int NULL,\"last_updated_timestamp\" datetime2(6) NULL,\"observer\" varchar(256) NULL,\"occluded\" bit NULL,\"truncated\" bit NULL,\"uuid\" uniqueidentifier NOT NULL,\"verification_timestamp\" datetimeoffset(6) NULL,\"verified\" bit NULL,\"verifier\" varchar(256) NULL,\"width\" int NULL,\"x\" int NULL,\"y\" int NULL,\"image_id\" bigint NULL,\"alt_concept\" varchar(255) NULL,\"user_defined_key\" varchar(56) NULL, \"magnitude\" decimal(18,5) NULL, CONSTRAINT \"PK__bounding__3213E83F3E4C2D08\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE dbo.bounding_box_image_feature_vectors ( bounding_box_id bigint NOT NULL, vector_index int NULL, vector_value decimal(18,5) NULL, CONSTRAINT FK_bounding_box_image_feature_vectors_bounding_box_id FOREIGN KEY (bounding_box_id) REFERENCES dbo.bounding_boxes (id) ON DELETE CASCADE);\nCREATE TABLE \"dbo\".\"bounding_boxes_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"concept\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"group_of\" bit NULL, \"height\" int NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"observer\" varchar(256) NULL, \"occluded\" bit NULL, \"truncated\" bit NULL, \"uuid\" uniqueidentifier NULL, \"verification_timestamp\" datetimeoffset(6) NULL, \"verified\" bit NULL, \"verifier\" varchar(256) NULL, \"width\" int NULL, \"x\" int NULL, \"y\" int NULL, \"image_id\" bigint NULL, \"alt_concept\" varchar(255) NULL, \"user_defined_key\" varchar(56) NULL, CONSTRAINT \"PK__bounding__BE3894F99D30F28A\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"darwin_cores\" ( \"id\" bigint NOT NULL, \"access_rights\" varchar(1024) NULL, \"basis_of_record\" varchar(64) NULL, \"bibliographic_citation\" varchar(512) NULL, \"collection_code\" varchar(64) NULL, \"collection_id\" varchar(2048) NULL, \"data_generalizations\" varchar(512) NULL, \"dataset_id\" uniqueidentifier NULL, \"dataset_name\" varchar(255) NULL, \"dynamic_properties\"varchar(2048) NULL, \"information_withheld\" varchar(255) NULL, \"institution_code\" varchar(255) NULL, \"institution_id\" varchar(255) NULL, \"license\" varchar(2048) NULL, \"modified\" datetimeoffset(6) NULL, \"owner_institution_code\" varchar(255) NULL, \"record_language\" varchar(35) NULL, \"record_references\" varchar(2048) NULL, \"record_type\" varchar(32) NULL, \"rights_holder\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"image_set_upload_id\" bigint NULL, CONSTRAINT \"PK__darwin_c__3213E83F92DAE497\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities\" ( \"id\" bigint NOT NULL, \"api_key\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(255) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(255) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"avatar_url\" varchar(2000) NULL, \"orcid\" varchar(32) NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__3213E83F59FE1468\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"api_key\" varchar(255) NULL, \"avatar_url\" varchar(2000) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(254) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(64) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"orcid\" varchar(32) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__BE3894F9CD98EF78\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"followed_topics\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"notification\" bit NULL, \"target\" varchar(256) NULL, \"topic\" varchar(32) NULL, \"uuid\" uniqueidentifier NOT NULL, CONSTRAINT \"PK__followed__3213E83F4A1EA9E0\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_set_uploads\" ( \"id\" bigint NOT NULL, \"contributors_email\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"format\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"local_path\" varchar(2048) NULL, \"rejection_details\" varchar(255) NULL, \"rejection_reason\" varchar(255) NULL, \"remote_uri\" varchar(2048) NULL, \"sha256\" varchar(64) NULL, \"status\" varchar(255) NULL, \"status_update_timestamp\" datetimeoffset(6) NULL, \"status_updater_email\" varchar(254) NULL, \"uuid\" uniqueidentifier NOT NULL, \"darwincore_id\" bigint NULL, CONSTRAINT \"PK__image_se__3213E83F9C72A0E9\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_uploads_join\" ( \"imagesetupload_id\" bigint NOT NULL, \"image_id\" bigint NOT NULL, CONSTRAINT \"PK__image_up__8A53EE0EBD9D776A\" PRIMARY KEY CLUSTERED(\"imagesetupload_id\",\"image_id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"submitter\" varchar(255) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"valid\" bit NULL, \"width\" int NULL, \"contributors_email\"varchar(254) NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images__3213E83FD76E309F\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"contributors_email\"varchar(254) NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"valid\" bit NULL, \"width\" int NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images_a__BE3894F92DF6715C\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"marine_regions\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"last_updated_timestamp\" datetime2 NULL, \"max_latitude\" float NOT NULL, \"max_longitude\" float NOT NULL, \"min_latitude\" float NOT NULL, \"min_longitude\" float NOT NULL, \"mrgid\" bigint NULL, \"name\" varchar(255) NULL, CONSTRAINT \"PK__marine_r__3213E83FE987FC8B\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"revinfo\" ( \"rev\" int IDENTITY(1,1) NOT NULL, \"revtstmp\" bigint NULL, CONSTRAINT \"PK__revinfo__C2B7CC69D3938648\" PRIMARY KEY CLUSTERED(\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NOT NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"value\" varchar(255) NOT NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags__3213E83F3A490684\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"value\" varchar(255) NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags_aud__BE3894F94F1608A8\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE VIEW \"dbo\".\"boundingbox_extended_info\" AS\nSELECT b.concept, b.alt_concept, b.observer, b.verified, b.verifier, b.verification_timestamp, b.user_defined_key, i.url, i.width, i.height, i.submitter, i.[timestamp], i.contributors_email AS image_contributors_email, u.contributors_email AS upload_contributors_email, dc.owner_institution_code, dc.institution_code, dc.rights_holder, dc.collection_code, dc.collection_id, dc.dataset_name\nFROM dbo.darwin_cores dc LEFT JOIN dbo.image_set_uploads u ON dc.id = u.darwincore_id LEFT JOIN dbo.image_uploads_join j ON j.imagesetupload_id = u.id LEFT JOIN dbo.images i ON j.image_id = i.id LEFT JOIN dbo.bounding_boxes b ON b.image_id = i.id;\n\n\n User Prompt: Find me images similar to the image provided\n "}, {"role": "assistant", "content": "{\"similarImageIDs\": [], \"similarBoundingBoxIDs\": [], \"similarImageSearch\": true, \"sqlServerQuery\": \"SELECT TOP 10 SS.bb1, SS.bb2, BB.concept, IMG.url, SS.CosineSimilarity FROM SimilaritySearch SS INNER JOIN bounding_boxes BB ON BB.id = SS.bb2 INNER JOIN images IMG ON BB.image_id = IMG.id ORDER BY SS.CosineSimilarity DESC;\", \"responseText\": \"Here are the images similar to the provided image.\"}"}]}
{"messages": [{"role": "system", "content": "You are a very intelligent json generated that can generate highly efficient sql queries. You will be given an input prompt for which you need to generated the JSON in a format given below, nothing else.\nThe Generated SQL must be valid for Micorsoft sql server\nThe JSON format and the attributes on the JSON are provided below\n{\n \"similarImageIDs\": [],\n \"similarBoundingBoxIDs\": [],\n \"similarImageSearch\": true/false,\n \"sqlServerQuery\": \"\",\n \"responseText\": \"\"\n}\nsimilarImageIDs: these are the image id that will be provided by the user in the prompt on which image search needs to be done\nsimilarBoundingBoxIDs: these are the bounding_boxes id that will be provided by the user in the prompt on which bounding boxes search needs to be done\nsimilarImageSearch: this is a boolean field, that is true when the prompt says to find similar images, else it is false\nsqlServerQuery: This is the sql server query you need to generate based on the user's prompt. The database structure provided will be very useful to generate the sql query. \nresponseText: Suppose you are answering the user with the output from the prompt. You need to write the message in this section. When the response is text, you need to output the textResponse in a way the values from the generated sql can be formatted in the text\n\nThe prompt will asks for similar images, there is another system that takes in the similarImageIDs and similarBoundingBoxIDs that you generated above to calculate the similarity search. You will suppose the similarity search is already done and you have sql table SimilaritySearch that has the input bounding box id as bb1, output bounding box id as bb2 and Cosine Similarity Score as CosineSimilarity. You will use this table and add the conditions that is given provided by the user. You will also ouput the ouput bounding box image url and the concept. The result must be ordered in descending order using the CosineSimilarity value. Also, you will take 10 top results unless specified by the prompt\nThe sql query must have bounding box id of the species, concept of the species and the image url of the species on all inputs"}, {"role": "user", "content": "\nMicrosoft SQL Server Database Structure:\n\nCREATE TABLE \"dbo\".\"bounding_box_comments\" ( \"id\" bigint NOT NULL, \"bounding_box_uuid\" uniqueidentifier NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"text\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"alternate_concept\" varchar(255) NULL, \"flagged\" bit NULL, CONSTRAINT \"PK__bounding__3213E83F71625CCD\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"bounding_boxes\" (\"id\" bigint NOT NULL,\"concept\" varchar(255) NULL,\"created_timestamp\" datetime2(6) NULL,\"group_of\" bit NULL,\"height\" int NULL,\"last_updated_timestamp\" datetime2(6) NULL,\"observer\" varchar(256) NULL,\"occluded\" bit NULL,\"truncated\" bit NULL,\"uuid\" uniqueidentifier NOT NULL,\"verification_timestamp\" datetimeoffset(6) NULL,\"verified\" bit NULL,\"verifier\" varchar(256) NULL,\"width\" int NULL,\"x\" int NULL,\"y\" int NULL,\"image_id\" bigint NULL,\"alt_concept\" varchar(255) NULL,\"user_defined_key\" varchar(56) NULL, \"magnitude\" decimal(18,5) NULL, CONSTRAINT \"PK__bounding__3213E83F3E4C2D08\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE dbo.bounding_box_image_feature_vectors ( bounding_box_id bigint NOT NULL, vector_index int NULL, vector_value decimal(18,5) NULL, CONSTRAINT FK_bounding_box_image_feature_vectors_bounding_box_id FOREIGN KEY (bounding_box_id) REFERENCES dbo.bounding_boxes (id) ON DELETE CASCADE);\nCREATE TABLE \"dbo\".\"bounding_boxes_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"concept\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"group_of\" bit NULL, \"height\" int NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"observer\" varchar(256) NULL, \"occluded\" bit NULL, \"truncated\" bit NULL, \"uuid\" uniqueidentifier NULL, \"verification_timestamp\" datetimeoffset(6) NULL, \"verified\" bit NULL, \"verifier\" varchar(256) NULL, \"width\" int NULL, \"x\" int NULL, \"y\" int NULL, \"image_id\" bigint NULL, \"alt_concept\" varchar(255) NULL, \"user_defined_key\" varchar(56) NULL, CONSTRAINT \"PK__bounding__BE3894F99D30F28A\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"darwin_cores\" ( \"id\" bigint NOT NULL, \"access_rights\" varchar(1024) NULL, \"basis_of_record\" varchar(64) NULL, \"bibliographic_citation\" varchar(512) NULL, \"collection_code\" varchar(64) NULL, \"collection_id\" varchar(2048) NULL, \"data_generalizations\" varchar(512) NULL, \"dataset_id\" uniqueidentifier NULL, \"dataset_name\" varchar(255) NULL, \"dynamic_properties\"varchar(2048) NULL, \"information_withheld\" varchar(255) NULL, \"institution_code\" varchar(255) NULL, \"institution_id\" varchar(255) NULL, \"license\" varchar(2048) NULL, \"modified\" datetimeoffset(6) NULL, \"owner_institution_code\" varchar(255) NULL, \"record_language\" varchar(35) NULL, \"record_references\" varchar(2048) NULL, \"record_type\" varchar(32) NULL, \"rights_holder\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"image_set_upload_id\" bigint NULL, CONSTRAINT \"PK__darwin_c__3213E83F92DAE497\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities\" ( \"id\" bigint NOT NULL, \"api_key\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(255) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(255) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"avatar_url\" varchar(2000) NULL, \"orcid\" varchar(32) NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__3213E83F59FE1468\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"api_key\" varchar(255) NULL, \"avatar_url\" varchar(2000) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(254) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(64) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"orcid\" varchar(32) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__BE3894F9CD98EF78\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"followed_topics\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"notification\" bit NULL, \"target\" varchar(256) NULL, \"topic\" varchar(32) NULL, \"uuid\" uniqueidentifier NOT NULL, CONSTRAINT \"PK__followed__3213E83F4A1EA9E0\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_set_uploads\" ( \"id\" bigint NOT NULL, \"contributors_email\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"format\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"local_path\" varchar(2048) NULL, \"rejection_details\" varchar(255) NULL, \"rejection_reason\" varchar(255) NULL, \"remote_uri\" varchar(2048) NULL, \"sha256\" varchar(64) NULL, \"status\" varchar(255) NULL, \"status_update_timestamp\" datetimeoffset(6) NULL, \"status_updater_email\" varchar(254) NULL, \"uuid\" uniqueidentifier NOT NULL, \"darwincore_id\" bigint NULL, CONSTRAINT \"PK__image_se__3213E83F9C72A0E9\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_uploads_join\" ( \"imagesetupload_id\" bigint NOT NULL, \"image_id\" bigint NOT NULL, CONSTRAINT \"PK__image_up__8A53EE0EBD9D776A\" PRIMARY KEY CLUSTERED(\"imagesetupload_id\",\"image_id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"submitter\" varchar(255) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"valid\" bit NULL, \"width\" int NULL, \"contributors_email\"varchar(254) NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images__3213E83FD76E309F\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"contributors_email\"varchar(254) NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"valid\" bit NULL, \"width\" int NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images_a__BE3894F92DF6715C\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"marine_regions\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"last_updated_timestamp\" datetime2 NULL, \"max_latitude\" float NOT NULL, \"max_longitude\" float NOT NULL, \"min_latitude\" float NOT NULL, \"min_longitude\" float NOT NULL, \"mrgid\" bigint NULL, \"name\" varchar(255) NULL, CONSTRAINT \"PK__marine_r__3213E83FE987FC8B\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"revinfo\" ( \"rev\" int IDENTITY(1,1) NOT NULL, \"revtstmp\" bigint NULL, CONSTRAINT \"PK__revinfo__C2B7CC69D3938648\" PRIMARY KEY CLUSTERED(\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NOT NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"value\" varchar(255) NOT NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags__3213E83F3A490684\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"value\" varchar(255) NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags_aud__BE3894F94F1608A8\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE VIEW \"dbo\".\"boundingbox_extended_info\" AS\nSELECT b.concept, b.alt_concept, b.observer, b.verified, b.verifier, b.verification_timestamp, b.user_defined_key, i.url, i.width, i.height, i.submitter, i.[timestamp], i.contributors_email AS image_contributors_email, u.contributors_email AS upload_contributors_email, dc.owner_institution_code, dc.institution_code, dc.rights_holder, dc.collection_code, dc.collection_id, dc.dataset_name\nFROM dbo.darwin_cores dc LEFT JOIN dbo.image_set_uploads u ON dc.id = u.darwincore_id LEFT JOIN dbo.image_uploads_join j ON j.imagesetupload_id = u.id LEFT JOIN dbo.images i ON j.image_id = i.id LEFT JOIN dbo.bounding_boxes b ON b.image_id = i.id;\n\n\n User Prompt: Find me similar images of Chelonia mydas found at pressure level less than 34dbar\n "}, {"role": "assistant", "content": "{\"similarImageIDs\": [], \"similarBoundingBoxIDs\": [], \"similarImageSearch\": true, \"sqlServerQuery\": \"SELECT TOP 10 SS.bb1, SS.bb2, BB.concept, IMG.url, SS.CosineSimilarity FROM SimilaritySearch SS INNER JOIN bounding_boxes BB ON BB.id = SS.bb2 INNER JOIN images IMG ON BB.image_id = IMG.id WHERE IMG.pressure_dbar < 34 AND BB.concept = 'Chelonia mydas' ORDER BY SS.CosineSimilarity DESC;\", \"responseText\": \"Below are similar images of Chelonia mydas found at pressure level less than 34dbar.\"}"}]}
{"messages": [{"role": "system", "content": "You are a very intelligent json generated that can generate highly efficient sql queries. You will be given an input prompt for which you need to generated the JSON in a format given below, nothing else.\nThe Generated SQL must be valid for Micorsoft sql server\nThe JSON format and the attributes on the JSON are provided below\n{\n \"similarImageIDs\": [],\n \"similarBoundingBoxIDs\": [],\n \"similarImageSearch\": true/false,\n \"sqlServerQuery\": \"\",\n \"responseText\": \"\"\n}\nsimilarImageIDs: these are the image id that will be provided by the user in the prompt on which image search needs to be done\nsimilarBoundingBoxIDs: these are the bounding_boxes id that will be provided by the user in the prompt on which bounding boxes search needs to be done\nsimilarImageSearch: this is a boolean field, that is true when the prompt says to find similar images, else it is false\nsqlServerQuery: This is the sql server query you need to generate based on the user's prompt. The database structure provided will be very useful to generate the sql query. \nresponseText: Suppose you are answering the user with the output from the prompt. You need to write the message in this section. When the response is text, you need to output the textResponse in a way the values from the generated sql can be formatted in the text\n\nThe prompt will asks for similar images, there is another system that takes in the similarImageIDs and similarBoundingBoxIDs that you generated above to calculate the similarity search. You will suppose the similarity search is already done and you have sql table SimilaritySearch that has the input bounding box id as bb1, output bounding box id as bb2 and Cosine Similarity Score as CosineSimilarity. You will use this table and add the conditions that is given provided by the user. You will also ouput the ouput bounding box image url and the concept. The result must be ordered in descending order using the CosineSimilarity value. Also, you will take 10 top results unless specified by the prompt\nThe sql query must have bounding box id of the species, concept of the species and the image url of the species on all inputs"}, {"role": "user", "content": "\nMicrosoft SQL Server Database Structure:\n\nCREATE TABLE \"dbo\".\"bounding_box_comments\" ( \"id\" bigint NOT NULL, \"bounding_box_uuid\" uniqueidentifier NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"text\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"alternate_concept\" varchar(255) NULL, \"flagged\" bit NULL, CONSTRAINT \"PK__bounding__3213E83F71625CCD\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"bounding_boxes\" (\"id\" bigint NOT NULL,\"concept\" varchar(255) NULL,\"created_timestamp\" datetime2(6) NULL,\"group_of\" bit NULL,\"height\" int NULL,\"last_updated_timestamp\" datetime2(6) NULL,\"observer\" varchar(256) NULL,\"occluded\" bit NULL,\"truncated\" bit NULL,\"uuid\" uniqueidentifier NOT NULL,\"verification_timestamp\" datetimeoffset(6) NULL,\"verified\" bit NULL,\"verifier\" varchar(256) NULL,\"width\" int NULL,\"x\" int NULL,\"y\" int NULL,\"image_id\" bigint NULL,\"alt_concept\" varchar(255) NULL,\"user_defined_key\" varchar(56) NULL, \"magnitude\" decimal(18,5) NULL, CONSTRAINT \"PK__bounding__3213E83F3E4C2D08\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE dbo.bounding_box_image_feature_vectors ( bounding_box_id bigint NOT NULL, vector_index int NULL, vector_value decimal(18,5) NULL, CONSTRAINT FK_bounding_box_image_feature_vectors_bounding_box_id FOREIGN KEY (bounding_box_id) REFERENCES dbo.bounding_boxes (id) ON DELETE CASCADE);\nCREATE TABLE \"dbo\".\"bounding_boxes_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"concept\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"group_of\" bit NULL, \"height\" int NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"observer\" varchar(256) NULL, \"occluded\" bit NULL, \"truncated\" bit NULL, \"uuid\" uniqueidentifier NULL, \"verification_timestamp\" datetimeoffset(6) NULL, \"verified\" bit NULL, \"verifier\" varchar(256) NULL, \"width\" int NULL, \"x\" int NULL, \"y\" int NULL, \"image_id\" bigint NULL, \"alt_concept\" varchar(255) NULL, \"user_defined_key\" varchar(56) NULL, CONSTRAINT \"PK__bounding__BE3894F99D30F28A\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"darwin_cores\" ( \"id\" bigint NOT NULL, \"access_rights\" varchar(1024) NULL, \"basis_of_record\" varchar(64) NULL, \"bibliographic_citation\" varchar(512) NULL, \"collection_code\" varchar(64) NULL, \"collection_id\" varchar(2048) NULL, \"data_generalizations\" varchar(512) NULL, \"dataset_id\" uniqueidentifier NULL, \"dataset_name\" varchar(255) NULL, \"dynamic_properties\"varchar(2048) NULL, \"information_withheld\" varchar(255) NULL, \"institution_code\" varchar(255) NULL, \"institution_id\" varchar(255) NULL, \"license\" varchar(2048) NULL, \"modified\" datetimeoffset(6) NULL, \"owner_institution_code\" varchar(255) NULL, \"record_language\" varchar(35) NULL, \"record_references\" varchar(2048) NULL, \"record_type\" varchar(32) NULL, \"rights_holder\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"image_set_upload_id\" bigint NULL, CONSTRAINT \"PK__darwin_c__3213E83F92DAE497\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities\" ( \"id\" bigint NOT NULL, \"api_key\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(255) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(255) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"avatar_url\" varchar(2000) NULL, \"orcid\" varchar(32) NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__3213E83F59FE1468\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"api_key\" varchar(255) NULL, \"avatar_url\" varchar(2000) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(254) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(64) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"orcid\" varchar(32) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__BE3894F9CD98EF78\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"followed_topics\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"notification\" bit NULL, \"target\" varchar(256) NULL, \"topic\" varchar(32) NULL, \"uuid\" uniqueidentifier NOT NULL, CONSTRAINT \"PK__followed__3213E83F4A1EA9E0\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_set_uploads\" ( \"id\" bigint NOT NULL, \"contributors_email\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"format\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"local_path\" varchar(2048) NULL, \"rejection_details\" varchar(255) NULL, \"rejection_reason\" varchar(255) NULL, \"remote_uri\" varchar(2048) NULL, \"sha256\" varchar(64) NULL, \"status\" varchar(255) NULL, \"status_update_timestamp\" datetimeoffset(6) NULL, \"status_updater_email\" varchar(254) NULL, \"uuid\" uniqueidentifier NOT NULL, \"darwincore_id\" bigint NULL, CONSTRAINT \"PK__image_se__3213E83F9C72A0E9\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_uploads_join\" ( \"imagesetupload_id\" bigint NOT NULL, \"image_id\" bigint NOT NULL, CONSTRAINT \"PK__image_up__8A53EE0EBD9D776A\" PRIMARY KEY CLUSTERED(\"imagesetupload_id\",\"image_id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"submitter\" varchar(255) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"valid\" bit NULL, \"width\" int NULL, \"contributors_email\"varchar(254) NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images__3213E83FD76E309F\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"contributors_email\"varchar(254) NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"valid\" bit NULL, \"width\" int NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images_a__BE3894F92DF6715C\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"marine_regions\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"last_updated_timestamp\" datetime2 NULL, \"max_latitude\" float NOT NULL, \"max_longitude\" float NOT NULL, \"min_latitude\" float NOT NULL, \"min_longitude\" float NOT NULL, \"mrgid\" bigint NULL, \"name\" varchar(255) NULL, CONSTRAINT \"PK__marine_r__3213E83FE987FC8B\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"revinfo\" ( \"rev\" int IDENTITY(1,1) NOT NULL, \"revtstmp\" bigint NULL, CONSTRAINT \"PK__revinfo__C2B7CC69D3938648\" PRIMARY KEY CLUSTERED(\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NOT NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"value\" varchar(255) NOT NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags__3213E83F3A490684\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"value\" varchar(255) NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags_aud__BE3894F94F1608A8\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE VIEW \"dbo\".\"boundingbox_extended_info\" AS\nSELECT b.concept, b.alt_concept, b.observer, b.verified, b.verifier, b.verification_timestamp, b.user_defined_key, i.url, i.width, i.height, i.submitter, i.[timestamp], i.contributors_email AS image_contributors_email, u.contributors_email AS upload_contributors_email, dc.owner_institution_code, dc.institution_code, dc.rights_holder, dc.collection_code, dc.collection_id, dc.dataset_name\nFROM dbo.darwin_cores dc LEFT JOIN dbo.image_set_uploads u ON dc.id = u.darwincore_id LEFT JOIN dbo.image_uploads_join j ON j.imagesetupload_id = u.id LEFT JOIN dbo.images i ON j.image_id = i.id LEFT JOIN dbo.bounding_boxes b ON b.image_id = i.id;\n\n\n User Prompt: Find me images of species similar to the species found in image id 2553888\n "}, {"role": "assistant", "content": "{\"similarImageIDs\": [2553888], \"similarBoundingBoxIDs\": [], \"similarImageSearch\": true, \"sqlServerQuery\": \"SELECT TOP 10 SS.bb1, SS.bb2, BB.concept, IMG.url, SS.CosineSimilarity FROM SimilaritySearch SS INNER JOIN bounding_boxes BB ON BB.id = SS.bb2 INNER JOIN images IMG ON BB.image_id = IMG.id ORDER BY SS.CosineSimilarity DESC;\", \"responseText\": \"Here are the images of species similar to the species found in image id 2553888.\"}"}]}
{"messages": [{"role": "system", "content": "You are a very intelligent json generated that can generate highly efficient sql queries. You will be given an input prompt for which you need to generated the JSON in a format given below, nothing else.\nThe Generated SQL must be valid for Micorsoft sql server\nThe JSON format and the attributes on the JSON are provided below\n{\n \"similarImageIDs\": [],\n \"similarBoundingBoxIDs\": [],\n \"similarImageSearch\": true/false,\n \"sqlServerQuery\": \"\",\n \"responseText\": \"\"\n}\nsimilarImageIDs: these are the image id that will be provided by the user in the prompt on which image search needs to be done\nsimilarBoundingBoxIDs: these are the bounding_boxes id that will be provided by the user in the prompt on which bounding boxes search needs to be done\nsimilarImageSearch: this is a boolean field, that is true when the prompt says to find similar images, else it is false\nsqlServerQuery: This is the sql server query you need to generate based on the user's prompt. The database structure provided will be very useful to generate the sql query. \nresponseText: Suppose you are answering the user with the output from the prompt. You need to write the message in this section. When the response is text, you need to output the textResponse in a way the values from the generated sql can be formatted in the text\n\nThe prompt will asks for similar images, there is another system that takes in the similarImageIDs and similarBoundingBoxIDs that you generated above to calculate the similarity search. You will suppose the similarity search is already done and you have sql table SimilaritySearch that has the input bounding box id as bb1, output bounding box id as bb2 and Cosine Similarity Score as CosineSimilarity. You will use this table and add the conditions that is given provided by the user. You will also ouput the ouput bounding box image url and the concept. The result must be ordered in descending order using the CosineSimilarity value. Also, you will take 10 top results unless specified by the prompt\nThe sql query must have bounding box id of the species, concept of the species and the image url of the species on all inputs"}, {"role": "user", "content": "\nMicrosoft SQL Server Database Structure:\n\nCREATE TABLE \"dbo\".\"bounding_box_comments\" ( \"id\" bigint NOT NULL, \"bounding_box_uuid\" uniqueidentifier NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"text\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"alternate_concept\" varchar(255) NULL, \"flagged\" bit NULL, CONSTRAINT \"PK__bounding__3213E83F71625CCD\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"bounding_boxes\" (\"id\" bigint NOT NULL,\"concept\" varchar(255) NULL,\"created_timestamp\" datetime2(6) NULL,\"group_of\" bit NULL,\"height\" int NULL,\"last_updated_timestamp\" datetime2(6) NULL,\"observer\" varchar(256) NULL,\"occluded\" bit NULL,\"truncated\" bit NULL,\"uuid\" uniqueidentifier NOT NULL,\"verification_timestamp\" datetimeoffset(6) NULL,\"verified\" bit NULL,\"verifier\" varchar(256) NULL,\"width\" int NULL,\"x\" int NULL,\"y\" int NULL,\"image_id\" bigint NULL,\"alt_concept\" varchar(255) NULL,\"user_defined_key\" varchar(56) NULL, \"magnitude\" decimal(18,5) NULL, CONSTRAINT \"PK__bounding__3213E83F3E4C2D08\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE dbo.bounding_box_image_feature_vectors ( bounding_box_id bigint NOT NULL, vector_index int NULL, vector_value decimal(18,5) NULL, CONSTRAINT FK_bounding_box_image_feature_vectors_bounding_box_id FOREIGN KEY (bounding_box_id) REFERENCES dbo.bounding_boxes (id) ON DELETE CASCADE);\nCREATE TABLE \"dbo\".\"bounding_boxes_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"concept\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"group_of\" bit NULL, \"height\" int NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"observer\" varchar(256) NULL, \"occluded\" bit NULL, \"truncated\" bit NULL, \"uuid\" uniqueidentifier NULL, \"verification_timestamp\" datetimeoffset(6) NULL, \"verified\" bit NULL, \"verifier\" varchar(256) NULL, \"width\" int NULL, \"x\" int NULL, \"y\" int NULL, \"image_id\" bigint NULL, \"alt_concept\" varchar(255) NULL, \"user_defined_key\" varchar(56) NULL, CONSTRAINT \"PK__bounding__BE3894F99D30F28A\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"darwin_cores\" ( \"id\" bigint NOT NULL, \"access_rights\" varchar(1024) NULL, \"basis_of_record\" varchar(64) NULL, \"bibliographic_citation\" varchar(512) NULL, \"collection_code\" varchar(64) NULL, \"collection_id\" varchar(2048) NULL, \"data_generalizations\" varchar(512) NULL, \"dataset_id\" uniqueidentifier NULL, \"dataset_name\" varchar(255) NULL, \"dynamic_properties\"varchar(2048) NULL, \"information_withheld\" varchar(255) NULL, \"institution_code\" varchar(255) NULL, \"institution_id\" varchar(255) NULL, \"license\" varchar(2048) NULL, \"modified\" datetimeoffset(6) NULL, \"owner_institution_code\" varchar(255) NULL, \"record_language\" varchar(35) NULL, \"record_references\" varchar(2048) NULL, \"record_type\" varchar(32) NULL, \"rights_holder\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"image_set_upload_id\" bigint NULL, CONSTRAINT \"PK__darwin_c__3213E83F92DAE497\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities\" ( \"id\" bigint NOT NULL, \"api_key\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(255) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(255) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"avatar_url\" varchar(2000) NULL, \"orcid\" varchar(32) NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__3213E83F59FE1468\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"api_key\" varchar(255) NULL, \"avatar_url\" varchar(2000) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(254) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(64) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"orcid\" varchar(32) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__BE3894F9CD98EF78\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"followed_topics\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"notification\" bit NULL, \"target\" varchar(256) NULL, \"topic\" varchar(32) NULL, \"uuid\" uniqueidentifier NOT NULL, CONSTRAINT \"PK__followed__3213E83F4A1EA9E0\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_set_uploads\" ( \"id\" bigint NOT NULL, \"contributors_email\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"format\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"local_path\" varchar(2048) NULL, \"rejection_details\" varchar(255) NULL, \"rejection_reason\" varchar(255) NULL, \"remote_uri\" varchar(2048) NULL, \"sha256\" varchar(64) NULL, \"status\" varchar(255) NULL, \"status_update_timestamp\" datetimeoffset(6) NULL, \"status_updater_email\" varchar(254) NULL, \"uuid\" uniqueidentifier NOT NULL, \"darwincore_id\" bigint NULL, CONSTRAINT \"PK__image_se__3213E83F9C72A0E9\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_uploads_join\" ( \"imagesetupload_id\" bigint NOT NULL, \"image_id\" bigint NOT NULL, CONSTRAINT \"PK__image_up__8A53EE0EBD9D776A\" PRIMARY KEY CLUSTERED(\"imagesetupload_id\",\"image_id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"submitter\" varchar(255) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"valid\" bit NULL, \"width\" int NULL, \"contributors_email\"varchar(254) NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images__3213E83FD76E309F\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"contributors_email\"varchar(254) NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"valid\" bit NULL, \"width\" int NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images_a__BE3894F92DF6715C\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"marine_regions\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"last_updated_timestamp\" datetime2 NULL, \"max_latitude\" float NOT NULL, \"max_longitude\" float NOT NULL, \"min_latitude\" float NOT NULL, \"min_longitude\" float NOT NULL, \"mrgid\" bigint NULL, \"name\" varchar(255) NULL, CONSTRAINT \"PK__marine_r__3213E83FE987FC8B\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"revinfo\" ( \"rev\" int IDENTITY(1,1) NOT NULL, \"revtstmp\" bigint NULL, CONSTRAINT \"PK__revinfo__C2B7CC69D3938648\" PRIMARY KEY CLUSTERED(\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NOT NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"value\" varchar(255) NOT NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags__3213E83F3A490684\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"value\" varchar(255) NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags_aud__BE3894F94F1608A8\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE VIEW \"dbo\".\"boundingbox_extended_info\" AS\nSELECT b.concept, b.alt_concept, b.observer, b.verified, b.verifier, b.verification_timestamp, b.user_defined_key, i.url, i.width, i.height, i.submitter, i.[timestamp], i.contributors_email AS image_contributors_email, u.contributors_email AS upload_contributors_email, dc.owner_institution_code, dc.institution_code, dc.rights_holder, dc.collection_code, dc.collection_id, dc.dataset_name\nFROM dbo.darwin_cores dc LEFT JOIN dbo.image_set_uploads u ON dc.id = u.darwincore_id LEFT JOIN dbo.image_uploads_join j ON j.imagesetupload_id = u.id LEFT JOIN dbo.images i ON j.image_id = i.id LEFT JOIN dbo.bounding_boxes b ON b.image_id = i.id;\n\n\n User Prompt: Find me similar images of species that are Chelonia mydas, Caretta caretta, Dermochelys coriacea, Eretmochelys imbricata, Lepidochelys olivacea, Lepidochelys kempii, Natator depressus\n "}, {"role": "assistant", "content": "{\"similarImageIDs\": [], \"similarBoundingBoxIDs\": [], \"similarImageSearch\": true, \"sqlServerQuery\": \"SELECT TOP 10 SS.bb1, SS.bb2, BB.concept, IMG.url, SS.CosineSimilarity FROM SimilaritySearch SS INNER JOIN bounding_boxes BB ON BB.id = SS.bb2 INNER JOIN images IMG ON BB.image_id = IMG.id WHERE BB.concept IN ('Chelonia mydas', 'Caretta caretta', 'Dermochelys coriacea', 'Eretmochelys imbricata', 'Lepidochelys olivacea', 'Lepidochelys kempii', 'Natator depressus') ORDER BY SS.CosineSimilarity DESC;\", \"responseText\": \"Below are similar images of species that are Chelonia mydas, Caretta caretta, Dermochelys coriacea, Eretmochelys imbricata, Lepidochelys olivacea, Lepidochelys kempii, Natator depressus.\"}"}]}
{"messages": [{"role": "system", "content": "You are a very intelligent json generated that can generate highly efficient sql queries. You will be given an input prompt for which you need to generated the JSON in a format given below, nothing else.\nThe Generated SQL must be valid for Micorsoft sql server\nThe JSON format and the attributes on the JSON are provided below\n{\n \"similarImageIDs\": [],\n \"similarBoundingBoxIDs\": [],\n \"similarImageSearch\": true/false,\n \"sqlServerQuery\": \"\",\n \"responseText\": \"\"\n}\nsimilarImageIDs: these are the image id that will be provided by the user in the prompt on which image search needs to be done\nsimilarBoundingBoxIDs: these are the bounding_boxes id that will be provided by the user in the prompt on which bounding boxes search needs to be done\nsimilarImageSearch: this is a boolean field, that is true when the prompt says to find similar images, else it is false\nsqlServerQuery: This is the sql server query you need to generate based on the user's prompt. The database structure provided will be very useful to generate the sql query. \nresponseText: Suppose you are answering the user with the output from the prompt. You need to write the message in this section. When the response is text, you need to output the textResponse in a way the values from the generated sql can be formatted in the text\n\nThe prompt will asks for similar images, there is another system that takes in the similarImageIDs and similarBoundingBoxIDs that you generated above to calculate the similarity search. You will suppose the similarity search is already done and you have sql table SimilaritySearch that has the input bounding box id as bb1, output bounding box id as bb2 and Cosine Similarity Score as CosineSimilarity. You will use this table and add the conditions that is given provided by the user. You will also ouput the ouput bounding box image url and the concept. The result must be ordered in descending order using the CosineSimilarity value. Also, you will take 10 top results unless specified by the prompt\nThe sql query must have bounding box id of the species, concept of the species and the image url of the species on all inputs"}, {"role": "user", "content": "\nMicrosoft SQL Server Database Structure:\n\nCREATE TABLE \"dbo\".\"bounding_box_comments\" ( \"id\" bigint NOT NULL, \"bounding_box_uuid\" uniqueidentifier NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"text\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"alternate_concept\" varchar(255) NULL, \"flagged\" bit NULL, CONSTRAINT \"PK__bounding__3213E83F71625CCD\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"bounding_boxes\" (\"id\" bigint NOT NULL,\"concept\" varchar(255) NULL,\"created_timestamp\" datetime2(6) NULL,\"group_of\" bit NULL,\"height\" int NULL,\"last_updated_timestamp\" datetime2(6) NULL,\"observer\" varchar(256) NULL,\"occluded\" bit NULL,\"truncated\" bit NULL,\"uuid\" uniqueidentifier NOT NULL,\"verification_timestamp\" datetimeoffset(6) NULL,\"verified\" bit NULL,\"verifier\" varchar(256) NULL,\"width\" int NULL,\"x\" int NULL,\"y\" int NULL,\"image_id\" bigint NULL,\"alt_concept\" varchar(255) NULL,\"user_defined_key\" varchar(56) NULL, \"magnitude\" decimal(18,5) NULL, CONSTRAINT \"PK__bounding__3213E83F3E4C2D08\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE dbo.bounding_box_image_feature_vectors ( bounding_box_id bigint NOT NULL, vector_index int NULL, vector_value decimal(18,5) NULL, CONSTRAINT FK_bounding_box_image_feature_vectors_bounding_box_id FOREIGN KEY (bounding_box_id) REFERENCES dbo.bounding_boxes (id) ON DELETE CASCADE);\nCREATE TABLE \"dbo\".\"bounding_boxes_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"concept\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"group_of\" bit NULL, \"height\" int NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"observer\" varchar(256) NULL, \"occluded\" bit NULL, \"truncated\" bit NULL, \"uuid\" uniqueidentifier NULL, \"verification_timestamp\" datetimeoffset(6) NULL, \"verified\" bit NULL, \"verifier\" varchar(256) NULL, \"width\" int NULL, \"x\" int NULL, \"y\" int NULL, \"image_id\" bigint NULL, \"alt_concept\" varchar(255) NULL, \"user_defined_key\" varchar(56) NULL, CONSTRAINT \"PK__bounding__BE3894F99D30F28A\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"darwin_cores\" ( \"id\" bigint NOT NULL, \"access_rights\" varchar(1024) NULL, \"basis_of_record\" varchar(64) NULL, \"bibliographic_citation\" varchar(512) NULL, \"collection_code\" varchar(64) NULL, \"collection_id\" varchar(2048) NULL, \"data_generalizations\" varchar(512) NULL, \"dataset_id\" uniqueidentifier NULL, \"dataset_name\" varchar(255) NULL, \"dynamic_properties\"varchar(2048) NULL, \"information_withheld\" varchar(255) NULL, \"institution_code\" varchar(255) NULL, \"institution_id\" varchar(255) NULL, \"license\" varchar(2048) NULL, \"modified\" datetimeoffset(6) NULL, \"owner_institution_code\" varchar(255) NULL, \"record_language\" varchar(35) NULL, \"record_references\" varchar(2048) NULL, \"record_type\" varchar(32) NULL, \"rights_holder\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"image_set_upload_id\" bigint NULL, CONSTRAINT \"PK__darwin_c__3213E83F92DAE497\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities\" ( \"id\" bigint NOT NULL, \"api_key\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(255) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(255) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"avatar_url\" varchar(2000) NULL, \"orcid\" varchar(32) NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__3213E83F59FE1468\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"api_key\" varchar(255) NULL, \"avatar_url\" varchar(2000) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(254) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(64) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"orcid\" varchar(32) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__BE3894F9CD98EF78\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"followed_topics\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"notification\" bit NULL, \"target\" varchar(256) NULL, \"topic\" varchar(32) NULL, \"uuid\" uniqueidentifier NOT NULL, CONSTRAINT \"PK__followed__3213E83F4A1EA9E0\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_set_uploads\" ( \"id\" bigint NOT NULL, \"contributors_email\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"format\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"local_path\" varchar(2048) NULL, \"rejection_details\" varchar(255) NULL, \"rejection_reason\" varchar(255) NULL, \"remote_uri\" varchar(2048) NULL, \"sha256\" varchar(64) NULL, \"status\" varchar(255) NULL, \"status_update_timestamp\" datetimeoffset(6) NULL, \"status_updater_email\" varchar(254) NULL, \"uuid\" uniqueidentifier NOT NULL, \"darwincore_id\" bigint NULL, CONSTRAINT \"PK__image_se__3213E83F9C72A0E9\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_uploads_join\" ( \"imagesetupload_id\" bigint NOT NULL, \"image_id\" bigint NOT NULL, CONSTRAINT \"PK__image_up__8A53EE0EBD9D776A\" PRIMARY KEY CLUSTERED(\"imagesetupload_id\",\"image_id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"submitter\" varchar(255) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"valid\" bit NULL, \"width\" int NULL, \"contributors_email\"varchar(254) NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images__3213E83FD76E309F\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"contributors_email\"varchar(254) NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"valid\" bit NULL, \"width\" int NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images_a__BE3894F92DF6715C\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"marine_regions\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"last_updated_timestamp\" datetime2 NULL, \"max_latitude\" float NOT NULL, \"max_longitude\" float NOT NULL, \"min_latitude\" float NOT NULL, \"min_longitude\" float NOT NULL, \"mrgid\" bigint NULL, \"name\" varchar(255) NULL, CONSTRAINT \"PK__marine_r__3213E83FE987FC8B\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"revinfo\" ( \"rev\" int IDENTITY(1,1) NOT NULL, \"revtstmp\" bigint NULL, CONSTRAINT \"PK__revinfo__C2B7CC69D3938648\" PRIMARY KEY CLUSTERED(\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NOT NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"value\" varchar(255) NOT NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags__3213E83F3A490684\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"value\" varchar(255) NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags_aud__BE3894F94F1608A8\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE VIEW \"dbo\".\"boundingbox_extended_info\" AS\nSELECT b.concept, b.alt_concept, b.observer, b.verified, b.verifier, b.verification_timestamp, b.user_defined_key, i.url, i.width, i.height, i.submitter, i.[timestamp], i.contributors_email AS image_contributors_email, u.contributors_email AS upload_contributors_email, dc.owner_institution_code, dc.institution_code, dc.rights_holder, dc.collection_code, dc.collection_id, dc.dataset_name\nFROM dbo.darwin_cores dc LEFT JOIN dbo.image_set_uploads u ON dc.id = u.darwincore_id LEFT JOIN dbo.image_uploads_join j ON j.imagesetupload_id = u.id LEFT JOIN dbo.images i ON j.image_id = i.id LEFT JOIN dbo.bounding_boxes b ON b.image_id = i.id;\n\n\n User Prompt: Find me similar images of Aurelia Aurita\n "}, {"role": "assistant", "content": "{\"similarImageIDs\": [], \"similarBoundingBoxIDs\": [], \"similarImageSearch\": true, \"sqlServerQuery\": \"SELECT TOP 10 SS.bb1, SS.bb2, BB.concept, IMG.url, SS.CosineSimilarity FROM SimilaritySearch SS INNER JOIN bounding_boxes BB ON BB.id = SS.bb2 INNER JOIN images IMG ON BB.image_id = IMG.id WHERE BB.concept = 'Aurelia Aurita' ORDER BY SS.CosineSimilarity DESC;\", \"responseText\": \"Below are similar images of Aurelia Aurita\"}"}]}
{"messages": [{"role": "system", "content": "You are a very intelligent json generated that can generate highly efficient sql queries. You will be given an input prompt for which you need to generated the JSON in a format given below, nothing else.\nThe Generated SQL must be valid for Micorsoft sql server\nThe JSON format and the attributes on the JSON are provided below\n{\n \"similarImageIDs\": [],\n \"similarBoundingBoxIDs\": [],\n \"similarImageSearch\": true/false,\n \"sqlServerQuery\": \"\",\n \"responseText\": \"\"\n}\nsimilarImageIDs: these are the image id that will be provided by the user in the prompt on which image search needs to be done\nsimilarBoundingBoxIDs: these are the bounding_boxes id that will be provided by the user in the prompt on which bounding boxes search needs to be done\nsimilarImageSearch: this is a boolean field, that is true when the prompt says to find similar images, else it is false\nsqlServerQuery: This is the sql server query you need to generate based on the user's prompt. The database structure provided will be very useful to generate the sql query. \nresponseText: Suppose you are answering the user with the output from the prompt. You need to write the message in this section. When the response is text, you need to output the textResponse in a way the values from the generated sql can be formatted in the text\n\nThe prompt will asks for similar images, there is another system that takes in the similarImageIDs and similarBoundingBoxIDs that you generated above to calculate the similarity search. You will suppose the similarity search is already done and you have sql table SimilaritySearch that has the input bounding box id as bb1, output bounding box id as bb2 and Cosine Similarity Score as CosineSimilarity. You will use this table and add the conditions that is given provided by the user. You will also ouput the ouput bounding box image url and the concept. The result must be ordered in descending order using the CosineSimilarity value. Also, you will take 10 top results unless specified by the prompt\nThe sql query must have bounding box id of the species, concept of the species and the image url of the species on all inputs"}, {"role": "user", "content": "\nMicrosoft SQL Server Database Structure:\n\nCREATE TABLE \"dbo\".\"bounding_box_comments\" ( \"id\" bigint NOT NULL, \"bounding_box_uuid\" uniqueidentifier NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"text\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"alternate_concept\" varchar(255) NULL, \"flagged\" bit NULL, CONSTRAINT \"PK__bounding__3213E83F71625CCD\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"bounding_boxes\" (\"id\" bigint NOT NULL,\"concept\" varchar(255) NULL,\"created_timestamp\" datetime2(6) NULL,\"group_of\" bit NULL,\"height\" int NULL,\"last_updated_timestamp\" datetime2(6) NULL,\"observer\" varchar(256) NULL,\"occluded\" bit NULL,\"truncated\" bit NULL,\"uuid\" uniqueidentifier NOT NULL,\"verification_timestamp\" datetimeoffset(6) NULL,\"verified\" bit NULL,\"verifier\" varchar(256) NULL,\"width\" int NULL,\"x\" int NULL,\"y\" int NULL,\"image_id\" bigint NULL,\"alt_concept\" varchar(255) NULL,\"user_defined_key\" varchar(56) NULL, \"magnitude\" decimal(18,5) NULL, CONSTRAINT \"PK__bounding__3213E83F3E4C2D08\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE dbo.bounding_box_image_feature_vectors ( bounding_box_id bigint NOT NULL, vector_index int NULL, vector_value decimal(18,5) NULL, CONSTRAINT FK_bounding_box_image_feature_vectors_bounding_box_id FOREIGN KEY (bounding_box_id) REFERENCES dbo.bounding_boxes (id) ON DELETE CASCADE);\nCREATE TABLE \"dbo\".\"bounding_boxes_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"concept\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"group_of\" bit NULL, \"height\" int NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"observer\" varchar(256) NULL, \"occluded\" bit NULL, \"truncated\" bit NULL, \"uuid\" uniqueidentifier NULL, \"verification_timestamp\" datetimeoffset(6) NULL, \"verified\" bit NULL, \"verifier\" varchar(256) NULL, \"width\" int NULL, \"x\" int NULL, \"y\" int NULL, \"image_id\" bigint NULL, \"alt_concept\" varchar(255) NULL, \"user_defined_key\" varchar(56) NULL, CONSTRAINT \"PK__bounding__BE3894F99D30F28A\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"darwin_cores\" ( \"id\" bigint NOT NULL, \"access_rights\" varchar(1024) NULL, \"basis_of_record\" varchar(64) NULL, \"bibliographic_citation\" varchar(512) NULL, \"collection_code\" varchar(64) NULL, \"collection_id\" varchar(2048) NULL, \"data_generalizations\" varchar(512) NULL, \"dataset_id\" uniqueidentifier NULL, \"dataset_name\" varchar(255) NULL, \"dynamic_properties\"varchar(2048) NULL, \"information_withheld\" varchar(255) NULL, \"institution_code\" varchar(255) NULL, \"institution_id\" varchar(255) NULL, \"license\" varchar(2048) NULL, \"modified\" datetimeoffset(6) NULL, \"owner_institution_code\" varchar(255) NULL, \"record_language\" varchar(35) NULL, \"record_references\" varchar(2048) NULL, \"record_type\" varchar(32) NULL, \"rights_holder\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"image_set_upload_id\" bigint NULL, CONSTRAINT \"PK__darwin_c__3213E83F92DAE497\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities\" ( \"id\" bigint NOT NULL, \"api_key\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(255) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(255) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"avatar_url\" varchar(2000) NULL, \"orcid\" varchar(32) NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__3213E83F59FE1468\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"api_key\" varchar(255) NULL, \"avatar_url\" varchar(2000) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(254) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(64) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"orcid\" varchar(32) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__BE3894F9CD98EF78\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"followed_topics\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"notification\" bit NULL, \"target\" varchar(256) NULL, \"topic\" varchar(32) NULL, \"uuid\" uniqueidentifier NOT NULL, CONSTRAINT \"PK__followed__3213E83F4A1EA9E0\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_set_uploads\" ( \"id\" bigint NOT NULL, \"contributors_email\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"format\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"local_path\" varchar(2048) NULL, \"rejection_details\" varchar(255) NULL, \"rejection_reason\" varchar(255) NULL, \"remote_uri\" varchar(2048) NULL, \"sha256\" varchar(64) NULL, \"status\" varchar(255) NULL, \"status_update_timestamp\" datetimeoffset(6) NULL, \"status_updater_email\" varchar(254) NULL, \"uuid\" uniqueidentifier NOT NULL, \"darwincore_id\" bigint NULL, CONSTRAINT \"PK__image_se__3213E83F9C72A0E9\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_uploads_join\" ( \"imagesetupload_id\" bigint NOT NULL, \"image_id\" bigint NOT NULL, CONSTRAINT \"PK__image_up__8A53EE0EBD9D776A\" PRIMARY KEY CLUSTERED(\"imagesetupload_id\",\"image_id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"submitter\" varchar(255) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"valid\" bit NULL, \"width\" int NULL, \"contributors_email\"varchar(254) NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images__3213E83FD76E309F\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"contributors_email\"varchar(254) NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"valid\" bit NULL, \"width\" int NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images_a__BE3894F92DF6715C\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"marine_regions\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"last_updated_timestamp\" datetime2 NULL, \"max_latitude\" float NOT NULL, \"max_longitude\" float NOT NULL, \"min_latitude\" float NOT NULL, \"min_longitude\" float NOT NULL, \"mrgid\" bigint NULL, \"name\" varchar(255) NULL, CONSTRAINT \"PK__marine_r__3213E83FE987FC8B\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"revinfo\" ( \"rev\" int IDENTITY(1,1) NOT NULL, \"revtstmp\" bigint NULL, CONSTRAINT \"PK__revinfo__C2B7CC69D3938648\" PRIMARY KEY CLUSTERED(\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NOT NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"value\" varchar(255) NOT NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags__3213E83F3A490684\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"value\" varchar(255) NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags_aud__BE3894F94F1608A8\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE VIEW \"dbo\".\"boundingbox_extended_info\" AS\nSELECT b.concept, b.alt_concept, b.observer, b.verified, b.verifier, b.verification_timestamp, b.user_defined_key, i.url, i.width, i.height, i.submitter, i.[timestamp], i.contributors_email AS image_contributors_email, u.contributors_email AS upload_contributors_email, dc.owner_institution_code, dc.institution_code, dc.rights_holder, dc.collection_code, dc.collection_id, dc.dataset_name\nFROM dbo.darwin_cores dc LEFT JOIN dbo.image_set_uploads u ON dc.id = u.darwincore_id LEFT JOIN dbo.image_uploads_join j ON j.imagesetupload_id = u.id LEFT JOIN dbo.images i ON j.image_id = i.id LEFT JOIN dbo.bounding_boxes b ON b.image_id = i.id;\n\n\n User Prompt: Find me similar images of species that are not Bathochordaeus stygius\n "}, {"role": "assistant", "content": "{\"similarImageIDs\": [], \"similarBoundingBoxIDs\": [], \"similarImageSearch\": true, \"sqlServerQuery\": \"SELECT TOP 10 SS.bb1, SS.bb2, BB.concept, IMG.url, SS.CosineSimilarity FROM SimilaritySearch SS INNER JOIN bounding_boxes BB ON BB.id = SS.bb2 INNER JOIN images IMG ON BB.image_id = IMG.id WHERE BB.concept <> 'Bathochordaeus stygius' ORDER BY SS.CosineSimilarity DESC;\", \"responseText\": \"Here are the similar images of species that are not Bathochordaeus stygius.\"}"}]}
{"messages": [{"role": "system", "content": "You are a very intelligent json generated that can generate highly efficient sql queries. You will be given an input prompt for which you need to generated the JSON in a format given below, nothing else.\nThe Generated SQL must be valid for Micorsoft sql server\nThe JSON format and the attributes on the JSON are provided below\n{\n \"similarImageIDs\": [],\n \"similarBoundingBoxIDs\": [],\n \"similarImageSearch\": true/false,\n \"sqlServerQuery\": \"\",\n \"responseText\": \"\"\n}\nsimilarImageIDs: these are the image id that will be provided by the user in the prompt on which image search needs to be done\nsimilarBoundingBoxIDs: these are the bounding_boxes id that will be provided by the user in the prompt on which bounding boxes search needs to be done\nsimilarImageSearch: this is a boolean field, that is true when the prompt says to find similar images, else it is false\nsqlServerQuery: This is the sql server query you need to generate based on the user's prompt. The database structure provided will be very useful to generate the sql query. \nresponseText: Suppose you are answering the user with the output from the prompt. You need to write the message in this section. When the response is text, you need to output the textResponse in a way the values from the generated sql can be formatted in the text\n\nThe prompt will asks for similar images, there is another system that takes in the similarImageIDs and similarBoundingBoxIDs that you generated above to calculate the similarity search. You will suppose the similarity search is already done and you have sql table SimilaritySearch that has the input bounding box id as bb1, output bounding box id as bb2 and Cosine Similarity Score as CosineSimilarity. You will use this table and add the conditions that is given provided by the user. You will also ouput the ouput bounding box image url and the concept. The result must be ordered in descending order using the CosineSimilarity value. Also, you will take 10 top results unless specified by the prompt\nThe sql query must have bounding box id of the species, concept of the species and the image url of the species on all inputs"}, {"role": "user", "content": "\nMicrosoft SQL Server Database Structure:\n\nCREATE TABLE \"dbo\".\"bounding_box_comments\" ( \"id\" bigint NOT NULL, \"bounding_box_uuid\" uniqueidentifier NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"text\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"alternate_concept\" varchar(255) NULL, \"flagged\" bit NULL, CONSTRAINT \"PK__bounding__3213E83F71625CCD\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"bounding_boxes\" (\"id\" bigint NOT NULL,\"concept\" varchar(255) NULL,\"created_timestamp\" datetime2(6) NULL,\"group_of\" bit NULL,\"height\" int NULL,\"last_updated_timestamp\" datetime2(6) NULL,\"observer\" varchar(256) NULL,\"occluded\" bit NULL,\"truncated\" bit NULL,\"uuid\" uniqueidentifier NOT NULL,\"verification_timestamp\" datetimeoffset(6) NULL,\"verified\" bit NULL,\"verifier\" varchar(256) NULL,\"width\" int NULL,\"x\" int NULL,\"y\" int NULL,\"image_id\" bigint NULL,\"alt_concept\" varchar(255) NULL,\"user_defined_key\" varchar(56) NULL, \"magnitude\" decimal(18,5) NULL, CONSTRAINT \"PK__bounding__3213E83F3E4C2D08\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE dbo.bounding_box_image_feature_vectors ( bounding_box_id bigint NOT NULL, vector_index int NULL, vector_value decimal(18,5) NULL, CONSTRAINT FK_bounding_box_image_feature_vectors_bounding_box_id FOREIGN KEY (bounding_box_id) REFERENCES dbo.bounding_boxes (id) ON DELETE CASCADE);\nCREATE TABLE \"dbo\".\"bounding_boxes_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"concept\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"group_of\" bit NULL, \"height\" int NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"observer\" varchar(256) NULL, \"occluded\" bit NULL, \"truncated\" bit NULL, \"uuid\" uniqueidentifier NULL, \"verification_timestamp\" datetimeoffset(6) NULL, \"verified\" bit NULL, \"verifier\" varchar(256) NULL, \"width\" int NULL, \"x\" int NULL, \"y\" int NULL, \"image_id\" bigint NULL, \"alt_concept\" varchar(255) NULL, \"user_defined_key\" varchar(56) NULL, CONSTRAINT \"PK__bounding__BE3894F99D30F28A\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"darwin_cores\" ( \"id\" bigint NOT NULL, \"access_rights\" varchar(1024) NULL, \"basis_of_record\" varchar(64) NULL, \"bibliographic_citation\" varchar(512) NULL, \"collection_code\" varchar(64) NULL, \"collection_id\" varchar(2048) NULL, \"data_generalizations\" varchar(512) NULL, \"dataset_id\" uniqueidentifier NULL, \"dataset_name\" varchar(255) NULL, \"dynamic_properties\"varchar(2048) NULL, \"information_withheld\" varchar(255) NULL, \"institution_code\" varchar(255) NULL, \"institution_id\" varchar(255) NULL, \"license\" varchar(2048) NULL, \"modified\" datetimeoffset(6) NULL, \"owner_institution_code\" varchar(255) NULL, \"record_language\" varchar(35) NULL, \"record_references\" varchar(2048) NULL, \"record_type\" varchar(32) NULL, \"rights_holder\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"image_set_upload_id\" bigint NULL, CONSTRAINT \"PK__darwin_c__3213E83F92DAE497\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities\" ( \"id\" bigint NOT NULL, \"api_key\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(255) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(255) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"avatar_url\" varchar(2000) NULL, \"orcid\" varchar(32) NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__3213E83F59FE1468\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"fathomnet_identities_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"api_key\" varchar(255) NULL, \"avatar_url\" varchar(2000) NULL, \"created_timestamp\" datetime2(6) NULL, \"disabled\" bit NULL, \"display_name\" varchar(255) NULL, \"email\" varchar(254) NULL, \"expertise_rank\" varchar(32) NULL, \"firebase_uid\" varchar(64) NULL, \"job_title\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"orcid\" varchar(32) NULL, \"organization\" varchar(255) NULL, \"profile\" varchar(1024) NULL, \"role_data\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"notification_frequency\" varchar(32) NULL, CONSTRAINT \"PK__fathomne__BE3894F9CD98EF78\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"followed_topics\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"email\" varchar(254) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"notification\" bit NULL, \"target\" varchar(256) NULL, \"topic\" varchar(32) NULL, \"uuid\" uniqueidentifier NOT NULL, CONSTRAINT \"PK__followed__3213E83F4A1EA9E0\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_set_uploads\" ( \"id\" bigint NOT NULL, \"contributors_email\" varchar(255) NULL, \"created_timestamp\" datetime2(6) NULL, \"format\" varchar(255) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"local_path\" varchar(2048) NULL, \"rejection_details\" varchar(255) NULL, \"rejection_reason\" varchar(255) NULL, \"remote_uri\" varchar(2048) NULL, \"sha256\" varchar(64) NULL, \"status\" varchar(255) NULL, \"status_update_timestamp\" datetimeoffset(6) NULL, \"status_updater_email\" varchar(254) NULL, \"uuid\" uniqueidentifier NOT NULL, \"darwincore_id\" bigint NULL, CONSTRAINT \"PK__image_se__3213E83F9C72A0E9\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"image_uploads_join\" ( \"imagesetupload_id\" bigint NOT NULL, \"image_id\" bigint NOT NULL, CONSTRAINT \"PK__image_up__8A53EE0EBD9D776A\" PRIMARY KEY CLUSTERED(\"imagesetupload_id\",\"image_id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"submitter\" varchar(255) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(2048) NULL, \"uuid\" uniqueidentifier NOT NULL, \"valid\" bit NULL, \"width\" int NULL, \"contributors_email\"varchar(254) NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images__3213E83FD76E309F\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"images_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"contributors_email\"varchar(254) NULL, \"created_timestamp\" datetime2(6) NULL, \"depth_meters\" float NULL, \"height\" int NULL, \"imaging_type\" varchar(64) NULL, \"last_updated_timestamp\" datetime2(6) NULL, \"last_validation\" datetimeoffset(6) NULL, \"latitude\" float NULL, \"longitude\" float NULL, \"media_type\" varchar(255) NULL, \"modified\" datetimeoffset(6) NULL, \"sha256\" varchar(64) NULL, \"timestamp\" datetimeoffset(6) NULL, \"url\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"valid\" bit NULL, \"width\" int NULL, \"altitude\" float NULL, \"oxygen_ml_l\" float NULL, \"pressure_dbar\" float NULL, \"salinity\" float NULL, \"temperature_celsius\" float NULL, CONSTRAINT \"PK__images_a__BE3894F92DF6715C\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"marine_regions\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"last_updated_timestamp\" datetime2 NULL, \"max_latitude\" float NOT NULL, \"max_longitude\" float NOT NULL, \"min_latitude\" float NOT NULL, \"min_longitude\" float NOT NULL, \"mrgid\" bigint NULL, \"name\" varchar(255) NULL, CONSTRAINT \"PK__marine_r__3213E83FE987FC8B\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"revinfo\" ( \"rev\" int IDENTITY(1,1) NOT NULL, \"revtstmp\" bigint NULL, CONSTRAINT \"PK__revinfo__C2B7CC69D3938648\" PRIMARY KEY CLUSTERED(\"rev\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags\" ( \"id\" bigint NOT NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NOT NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NOT NULL, \"value\" varchar(255) NOT NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags__3213E83F3A490684\" PRIMARY KEY CLUSTERED(\"id\")\nON [PRIMARY]);\nCREATE TABLE \"dbo\".\"tags_aud\" ( \"id\" bigint NOT NULL, \"rev\" int NOT NULL, \"revtype\" smallint NULL, \"created_timestamp\" datetime2 NULL, \"tag\" varchar(255) NULL, \"last_updated_timestamp\" datetime2 NULL, \"media_type\" varchar(255) NULL, \"uuid\" uniqueidentifier NULL, \"value\" varchar(255) NULL, \"image_id\" bigint NULL, CONSTRAINT \"PK__tags_aud__BE3894F94F1608A8\" PRIMARY KEY CLUSTERED(\"id\",\"rev\")\nON [PRIMARY]);\nCREATE VIEW \"dbo\".\"boundingbox_extended_info\" AS\nSELECT b.concept, b.alt_concept, b.observer, b.verified, b.verifier, b.verification_timestamp, b.user_defined_key, i.url, i.width, i.height, i.submitter, i.[timestamp], i.contributors_email AS image_contributors_email, u.contributors_email AS upload_contributors_email, dc.owner_institution_code, dc.institution_code, dc.rights_holder, dc.collection_code, dc.collection_id, dc.dataset_name\nFROM dbo.darwin_cores dc LEFT JOIN dbo.image_set_uploads u ON dc.id = u.darwincore_id LEFT JOIN dbo.image_uploads_join j ON j.imagesetupload_id = u.id LEFT JOIN dbo.images i ON j.image_id = i.id LEFT JOIN dbo.bounding_boxes b ON b.image_id = i.id;\n\n\n User Prompt: Find me similar looking octopus from Monterey Bay\n "}, {"role": "assistant", "content": "{\"similarImageIDs\": [], \"similarBoundingBoxIDs\": [], \"similarImageSearch\": true, \"sqlServerQuery\": \"SELECT TOP 10 SS.bb1, SS.bb2, BB.concept, IMG.url, SS.CosineSimilarity FROM SimilaritySearch SS INNER JOIN bounding_boxes BB ON BB.id = SS.bb2 INNER JOIN images IMG ON BB.image_id = IMG.id INNER JOIN marine_regions MR ON IMG.latitude BETWEEN MR.min_latitude AND MR.max_latitude AND IMG.longitude BETWEEN MR.min_longitude AND MR.max_longitude WHERE BB.concept IN ('Enteroctopus dofleini', 'Octopus rubescens', 'Opisthoteuthis adorabilis', 'Octopus californicus', 'Opisthoteuthis californiana') AND MR.name = 'Monterey Bay' ORDER BY SS.CosineSimilarity DESC;\", \"responseText\": \"Below are similar looking octopus from Monterey Bay\"}"}]}