Coder Social home page Coder Social logo

character.ai-ts's Introduction

Character.AI

img.png

Unofficial Javascript/Typescript Wrapper for character.ai

AS OF 3/14/2023 This seems to only work for Bun

Initialize a Client and Login

import  Log_in,{Client}  from 'character.ai';

let client:Client = await Log_in("token") // returns the Client

the default of the second arg of innit is false, will start a new chat if it set to true, if there is no previous history between character and client it will create one

const character = await client.init("characterId",true) // returns a Character and sets client's current character to it 
const msg :Msg = await client.sendMsg("Hello!") // returns a Message Object
const History : Array<Msg> = client.history // returns an Array of Messages

to get user info

const user = client.me // returns a User Object

lookFor returns an Array of Characters that has the same name as the first arg the second argument sorts the array by the amount of interactions the characters has, the default is "score"

const characters : Array<char> = await client.lookFor("characterName","interactions") // returns an Array of Characters

This project was created using bun init in bun v0.5.7. Bun is a fast all-in-one JavaScript runtime.

character.ai-ts's People

Contributors

weismanns avatar

Stargazers

Josh avatar GURU SENSEI avatar Empty-Sama avatar JulianZhu avatar  avatar Rexi avatar Omar Ben El Fkih avatar  avatar 0x321513 avatar alt avatar zhang avatar AhmedKellouch avatar Amer Tahri-Joutey avatar Joaquin avatar  avatar Reluzh avatar El Mahdi BENRAMI avatar KARIM EL KAHLA avatar  avatar

Watchers

 avatar

character.ai-ts's Issues

NodeJS and Deno

it seems Character.ai upgraded their security, This package still works With Bun Runtime
although, i can find workarounds, it seems highly ineffective and it will just be too slow for my liking, if you still want that support regardless, i may make a separate Repo if the demand is high enough lol.
Bun works great with this since It has support CommonJS compiles to ESM regardless, as an Illustration this is now possible
const Login = require("character.ai-ts").default

now that's out the way, that doesn't mean i'll stop looking for better solutions!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.