diff --git a/api/src/routes/ws/threads_and_messages/post_thread/post_thread.rs b/api/src/routes/ws/threads_and_messages/post_thread/post_thread.rs index 5c52c2a77..e41c26d3a 100644 --- a/api/src/routes/ws/threads_and_messages/post_thread/post_thread.rs +++ b/api/src/routes/ws/threads_and_messages/post_thread/post_thread.rs @@ -1227,6 +1227,7 @@ async fn search_for_relevant_terms( terms_search where fts @@ websearch_to_tsquery('{prompt}') + and organization_id = '{organization_id}' order by rank_ix limit least(10, 30) * 2 ), @@ -1236,6 +1237,7 @@ semantic as ( row_number() over (order by embedding <#> '{prompt_embedding}') as rank_ix from terms_search + where organization_id = '{organization_id}' order by rank_ix limit least(10, 30) * 2 ) diff --git a/api/src/utils/prompts/analyst_chat_prompts/failed_to_fix_sql_prompts.rs b/api/src/utils/prompts/analyst_chat_prompts/failed_to_fix_sql_prompts.rs index 11bb95a2b..308196fe2 100644 --- a/api/src/utils/prompts/analyst_chat_prompts/failed_to_fix_sql_prompts.rs +++ b/api/src/utils/prompts/analyst_chat_prompts/failed_to_fix_sql_prompts.rs @@ -8,6 +8,11 @@ You should talk about how you tried to fix the SQL query three times, and that y At the end make sure to apologize to the user +PLEASE OUTPUT THE SQL QUERY IN THE FOLLOWING FORMAT: +```sql + +``` + ### GENERAL GUIDELINES - Keep your response under 50 words - Do not output the failed SQL query in your response