Skip to content

Commit 03b5f0d

Browse files
committed
Update deployment
1 parent 372e995 commit 03b5f0d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

deploy_ai_search/text_2_sql_query_cache.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
SearchableField,
88
SimpleField,
99
ComplexField,
10+
SemanticField,
11+
SemanticPrioritizedFields,
12+
SemanticConfiguration,
13+
SemanticSearch,
1014
)
1115
from ai_search import AISearch
1216
from environment import (
@@ -107,3 +111,22 @@ def get_index_fields(self) -> list[SearchableField]:
107111
]
108112

109113
return fields
114+
115+
def get_semantic_search(self) -> SemanticSearch:
116+
"""This function returns the semantic search configuration for sql index
117+
118+
Returns:
119+
SemanticSearch: The semantic search configuration"""
120+
121+
semantic_config = SemanticConfiguration(
122+
name=self.semantic_config_name,
123+
prioritized_fields=SemanticPrioritizedFields(
124+
content_fields=[
125+
SemanticField(field_name="Question"),
126+
],
127+
),
128+
)
129+
130+
semantic_search = SemanticSearch(configurations=[semantic_config])
131+
132+
return semantic_search

0 commit comments

Comments
 (0)