Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/wisecube_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def __init__(self, *args):
raise Exception("Invalid args")



class QueryMethods:
def __init__(self, url, client_id):
self.url = url
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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):
Expand Down
7 changes: 7 additions & 0 deletions src/wisecube_sdk/string_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,10 @@
}
}
"""


ask_pythia = """
query askPythia($reference: [String!], $response: String!, $question: String) {
askPythia(reference: $reference, response: $response, question: $question)
}
"""