Skip to content

Commit

Permalink
feat(ai): add supportAI endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
parkererickson-tg committed Apr 10, 2024
1 parent f17ecaf commit 50e4bfd
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions pyTigerGraph/ai/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def initializeSupportAI(self):
Returns:
JSON response from the SupportAI service.
"""
url = self.nlqs_host+"/"+self.conn.graphname+"/initialize"
url = self.nlqs_host+"/"+self.conn.graphname+"/supportai/initialize"
return self.conn._req("POST", url, authMode="pwd", resKey=None)

def createDocumentIngest(self, data_source, data_source_config, loader_config, file_format):
Expand Down Expand Up @@ -161,9 +161,9 @@ def searchDocuments(self, query, method = "hnswoverlap", method_parameters: dict
JSON response from the document search.
"""
data = {
"query": query,
"question": query,
"method": method,
"method_parameters": method_parameters
"method_params": method_parameters
}
url = self.nlqs_host+"/"+self.conn.graphname+"/supportai/search"
return self.conn._req("POST", url, authMode="pwd", data = data, jsonData=True, resKey=None)
Expand All @@ -181,9 +181,17 @@ def answerQuestion(self, query, method = "hnswoverlap", method_parameters: dict
JSON response from the question answer.
"""
data = {
"query": query,
"question": query,
"method": method,
"method_parameters": method_parameters
"method_params": method_parameters
}
url = self.nlqs_host+"/"+self.conn.graphname+"/supportai/answerquestion"
return self.conn._req("POST", url, authMode="pwd", data = data, jsonData=True, resKey=None)
return self.conn._req("POST", url, authMode="pwd", data = data, jsonData=True, resKey=None)

def forceConsistencyUpdate(self):
""" Force a consistency update for SupportAI embeddings.
Returns:
JSON response from the consistency update.
"""
url = self.nlqs_host+"/"+self.conn.graphname+"/supportai/forceupdate"
return self.conn._req("GET", url, authMode="pwd", resKey=None)

0 comments on commit 50e4bfd

Please sign in to comment.