Browse Source

Update claude_ai_bot.py

master
resphina GitHub 1 year ago
parent
commit
6ba0baabb0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 4 deletions
  1. +0
    -4
      bot/claude/claude_ai_bot.py

+ 0
- 4
bot/claude/claude_ai_bot.py View File

@@ -42,7 +42,6 @@ class ClaudeAIBot(Bot, OpenAIImage):
con_uuid = self.generate_uuid() con_uuid = self.generate_uuid()
self.create_new_chat(con_uuid) self.create_new_chat(con_uuid)



def get_organization_id(self): def get_organization_id(self):
url = "https://claude.ai/api/organizations" url = "https://claude.ai/api/organizations"
headers = { headers = {
@@ -78,7 +77,6 @@ class ClaudeAIBot(Bot, OpenAIImage):


def get_organization_id(self): def get_organization_id(self):
url = "https://claude.ai/api/organizations" url = "https://claude.ai/api/organizations"

headers = { headers = {
'User-Agent': 'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0',
@@ -97,7 +95,6 @@ class ClaudeAIBot(Bot, OpenAIImage):
uuid = res[0]['uuid'] uuid = res[0]['uuid']
except: except:
print(response.text) print(response.text)

return uuid return uuid


def conversation_share_check(self,session_id): def conversation_share_check(self,session_id):
@@ -145,7 +142,6 @@ class ClaudeAIBot(Bot, OpenAIImage):
session_id = context["session_id"] session_id = context["session_id"]
session = self.sessions.session_query(query, session_id) session = self.sessions.session_query(query, session_id)
con_uuid = self.conversation_share_check(session_id) con_uuid = self.conversation_share_check(session_id)

model = conf().get("model") or "gpt-3.5-turbo" model = conf().get("model") or "gpt-3.5-turbo"
# remove system message # remove system message
if session.messages[0].get("role") == "system": if session.messages[0].get("role") == "system":


Loading…
Cancel
Save