💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows
Python agentsaiai-agentsembeddingsinformation-retrievallanguage-modellarge-language-modelsllmnlppythonragretrieval-augmented-generationsearchsearch-enginesemantic-searchsentence-embeddingstransformerstxtaivector-databasevector-search
Fix issue with parsing multiline SQL statements, closes #242
davidmezzettidda277785a61
diff --git a/src/python/txtai/database/sql/base.py b/src/python/txtai/database/sql/base.pyindex e7bef613..439f18b1 100644--- a/src/python/txtai/database/sql/base.py+++ b/src/python/txtai/database/sql/base.py@@ -94,7 +94,10 @@ class SQL:True if this is a valid SQL query, False otherwise"""- query = query.lower().strip(";")+ # Reduce query to a single line, lower-cased and stripped of leading/trailing whitespace+ query = query.lower().strip(";").replace("\n", " ").replace("\t", " ").strip()++ # Detect if this is a valid txtai SQL statementreturn query.startswith("select ") and (" from txtai " in query or query.endswith(" from txtai"))def tokenize(self, query):