Skip to main content

unoffical wrtn api

Project description

Typing SVG

사용방법

from wrtn import wrtn

client = wrtn(token='<TOKEN>')

예제 한번 보고 사용해보는걸 추천

Token찾는법은 크롬 개발자도구 열고 애플리케이션에 들어간 다음 cookies에 있는 access_token 을 가져오면 된다.

기능

유저정보조회

client.user.nickname(self) #유저 name (string)
client.user.uid(self) #유저 uid (string)
client.user._id(self) #유저 id (string)
client.user.marketingAccountTerm(self) #계정생성일자 (string)
client.user.isNewbie(self) #뉴비여부 (bool)

채팅방기능

room_id는 채팅방조회 해보면 '_id': '' 있을텐대 그거임

아니면 본인 진행중인 채팅방 링크 보면 https://wrtn.ai/character/u/<캐릭터챗id>/c/<채팅방id> 이렇게 나올텐대 채팅방id 부분이다.

client.chat.all_chat_list(self) #유저의 모든 챗방 조회
client.chat.chat_list(self,limit:int) #유저의 챗방을 limit개수만큼만 출력
client.chat.send_chat(self,room_id:str,message:str,isSuperMode:bool=False) #해당room_id의 챗방에 메시지 보낸 후 답변 출력
client.chat.chat_log(self,room_id :str,limit:int) #해당room_id의 챗방에 있는 채팅내역을 limit개수 만큼 출력

피드조회

client.feed.ranking(self,limit:int,period="daily") #일간랭킹을 limit개수만큼출력 period는 daily, monthly 있음 (순위순)

챗봇제작

client.charmaker.make_char(self,data :dict) #챗봇 제작
client.charmaker.modify_char(self,data :dict,char_id :str) #챗봇 수정

챗봇 제작/수정을 위한 json form

제작

{
            "name":"테스트4",
            "description":"테스트4",
            "profileImageUrl":"<이미지url>",
            "model":"sonnet",
            "initialMessages":["테스트4"],
            "characterDetails":"테스트4",
            "situationImages":[],
            "categoryIds":["65e809f21a9eea7b2f660937"],
            "tags":[],"visibility":"public",
            "promptTemplate":"simulation",
            "isCommentBlocked":false,
            "defaultStartingSetName":"기본 설정",
            "keywordBook":[
            {
                "keywords":["테스트"],
                "prompt":"테스트4",
                "name":"키워드 노트 1"
            }
            ],
            "isAdult":false
}

수정

{
            "name":"테스트6",
            "description":"테스트5",
            "profileImageUrl":"<이미지url>",
            "model":"sonnet",
            "initialMessages":["테스트5"],
            "characterDetails":"테스트5",
            "replySuggestions":["안녕 테스트5! 어떻게 지내?","테스트5, 여기서 뭐하고 있었어? 뭔가 재밌는 일이 생겼어?","오, 테스트5! 요즘 어떤 일들이 있었는지 이야기 좀 해줘, 궁금해!"],
            "chatExamples":[],
            "situationImages":[],
            "categoryIds":["65e809f21a9eea7b2f660937"],
            "tags":[],
            "visibility":"public",
            "promptTemplate":"simulation",
            "isCommentBlocked":false,
            "defaultStartingSetName":"기본 설정",
            "startingSets":[],
            "keywordBook":[{
                "keywords":["테스트"],
                "prompt":"테스트5",
                "name":"키워드 노트 1"
            }
            ]
}

made by 뤼튼병자

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wrtn-1.0.9.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wrtn-1.0.9-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file wrtn-1.0.9.tar.gz.

File metadata

  • Download URL: wrtn-1.0.9.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for wrtn-1.0.9.tar.gz
Algorithm Hash digest
SHA256 b673b26ab6c24b8d3d899aafb269c4fef504fe8b6d4012597d2eeddac3e3815b
MD5 ed8640a7f84448f864daa660ee2b28e5
BLAKE2b-256 4b01c156249c69c8e7c8af4544c448568dddde06311fd5a79f4378e29044ce1d

See more details on using hashes here.

File details

Details for the file wrtn-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: wrtn-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for wrtn-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 afd28d45b891efa87a7b0349a68e17bcccd96b1aff80ba4a20e7fd2387c1c873
MD5 dd0e3234a3440ceb1e943aad910bd2c8
BLAKE2b-256 6864f55e39eaa7f95ae575f77e9549be1ac0cd7e3d138e08fddeabd3e8c370e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page