Skip to content

Claude-March-Updated #97

Description

@KiRyuWen

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions