Add extraction and display of the model response text from the json API response
This commit is contained in:
parent
78bb591bd3
commit
4789b9355d
|
@ -23,5 +23,7 @@ def create_model_response(conversation,model,message):
|
|||
response = requests.request("POST", url, headers=headers, data=payload)
|
||||
|
||||
print(response.text)
|
||||
print(response.json()["output"][-1]["content"][0]["text"])
|
||||
|
||||
if __name__ == '__main__':
|
||||
create_model_response(str(sys.argv[1]),str(sys.argv[2]),str(sys.argv[3]))
|
||||
|
|
|
@ -13,6 +13,7 @@ def retrieve_model_response(response):
|
|||
response = requests.request("GET", url, headers=headers, data=payload)
|
||||
|
||||
print(response.text)
|
||||
print(response.json()["output"][-1]["content"][0]["text"])
|
||||
|
||||
if __name__ == '__main__':
|
||||
retrieve_model_response(str(sys.argv[1]))
|
||||
|
|
Loading…
Reference in a new issue