In claude_api.py => send_message(self, prompt, conversation_id, attachment=None, timeout=500):
1.
original:
payload = json.dumps({
"completion": {
"prompt": f"{prompt}",
"timezone": "Asia/Kolkata",
"model": "claude-3-opus-20240229"
},
"organization_uuid": f"{self.organization_id}",
"conversation_uuid": f"{conversation_id}",
"text": f"{prompt}",
"attachments": attachments
})
change to
payload = json.dumps({
"prompt": f"{prompt}",
"timezone": "Asia/Kolkata",
"model": "claude-3-haiku-20240307",
"attachments": attachments,
"files":[]
})
change original loop data_strings to following loop
for data_string in data_strings:
if data_string.find('data:')==-1 or data_string == "event: completion" or data_string == "event: stop" or data_string == "ping":
continue
json_str = data_string[6:].strip()
data = json.loads(json_str)
if 'completion' in data:
completions.append(data['completion'])
Feel free to let me know if you have any questions.
If it works for you, please give me a blessing for upcoming interviews!
In claude_api.py => send_message(self, prompt, conversation_id, attachment=None, timeout=500):
1.
original:
payload = json.dumps({
"completion": {
"prompt": f"{prompt}",
"timezone": "Asia/Kolkata",
"model": "claude-3-opus-20240229"
},
"organization_uuid": f"{self.organization_id}",
"conversation_uuid": f"{conversation_id}",
"text": f"{prompt}",
"attachments": attachments
})
change to
payload = json.dumps({
"prompt": f"{prompt}",
"timezone": "Asia/Kolkata",
"model": "claude-3-haiku-20240307",
"attachments": attachments,
"files":[]
})
change original loop data_strings to following loop
for data_string in data_strings:
if data_string.find('data:')==-1 or data_string == "event: completion" or data_string == "event: stop" or data_string == "ping":
continue
json_str = data_string[6:].strip()
data = json.loads(json_str)
Feel free to let me know if you have any questions.
If it works for you, please give me a blessing for upcoming interviews!