diff --git a/src/wisecube_sdk/client.py b/src/wisecube_sdk/client.py index a42bc7c..5b5b5fa 100644 --- a/src/wisecube_sdk/client.py +++ b/src/wisecube_sdk/client.py @@ -16,7 +16,6 @@ def __init__(self, *args): raise Exception("Invalid args") - class QueryMethods: def __init__(self, url, client_id): self.url = url @@ -76,7 +75,7 @@ def search_text(self, text): payload = create_payload.create(string_query.search_text, variables) headers = self.get_headers() response = api_calls.create_api_call(payload, headers, self.url, "json") - return create_response.search_text(response,self.output_format ) + return create_response.search_text(response, self.output_format) def execute_vector_function(self, graphIds: [str]): variables = { @@ -134,6 +133,18 @@ def get_admet_predictions(self, smiles: [str], model: WisecubeModel): response = api_calls.create_api_call(payload, headers, self.url, "json") return create_response.basic(response) + def ask_pythia(self, references: [str], response: str, question: str): + variables = { + "reference": references, + "response": response + } + if question is not None: + variables["question"] = question + payload = create_payload.create(string_query.ask_pythia, variables) + headers = self.get_headers() + response = api_calls.create_api_call(payload, headers, self.url, "json") + return create_response.basic(response) + class OpenClient: def __init__(self, url): diff --git a/src/wisecube_sdk/string_query.py b/src/wisecube_sdk/string_query.py index a569df4..050cd1b 100644 --- a/src/wisecube_sdk/string_query.py +++ b/src/wisecube_sdk/string_query.py @@ -162,3 +162,10 @@ } } """ + + +ask_pythia = """ +query askPythia($reference: [String!], $response: String!, $question: String) { + askPythia(reference: $reference, response: $response, question: $question) +} +"""