Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest API revision / externalized API client lib #29

Open
p3r7 opened this issue Jul 31, 2020 · 12 comments
Open

Update to latest API revision / externalized API client lib #29

p3r7 opened this issue Jul 31, 2020 · 12 comments
Labels
enhancement New feature or request

Comments

@p3r7
Copy link
Member

p3r7 commented Jul 31, 2020

Relying on an externalized low-level API client lib would allow:

  • more projects to rely on it
  • have a less monolithic code base
  • be more effective when adapting to API changes

Initial idea formulated at #23 (comment).

Would certainly explore using 1Macho/AIDungeonAPI as proposed by #23 (comment).

Subjects to explore:

  • have only an async version of API calls (that could be made sync by awaiting them) or propose both (for performance + legibility)
  • having a debug option to log queries / responses
@p3r7 p3r7 added the enhancement New feature or request label Jul 31, 2020
@p3r7 p3r7 mentioned this issue Jul 31, 2020
@mkualquiera
Copy link

One thing to note is that using a library based on asyncio forces the use of asyncio for the project using it, since asyncio is mostly a framework. This is fine for things like Discord or Telegram bots but could not be as great for projects that already work in a different way fundamentally.

@p3r7
Copy link
Member Author

p3r7 commented Aug 12, 2020

I've made the code more modular (split in several python modules).

On benefit is that it'll ease testing the integration of your lib.

@p3r7
Copy link
Member Author

p3r7 commented Nov 5, 2020

I haven't tried playing for a while.

It seems that the API changed again 😱.

I'm still using my own "dirty" API client (I haven't found time wrapping my head around python coroutines) but I assume that yours is broke as well, @mkualquiera, right?

@sasha00123
Copy link

I guess that's the case, since my bot based on his library is also broken.

@mkualquiera
Copy link

From what I could tell, the API is the same... The thing is that they have disabled anonymous access, and now you have to login in order to play.

But I haven't looked into it a lot, I'm not really all that interested in AID anymore. If you guys want I could give you editing access to my repo in case you want to continue working on it.

@p3r7
Copy link
Member Author

p3r7 commented Nov 9, 2020

I haven’t investigated much but the introduction of the stamina system certainly changed some stuff in the API.

I’ll redo a test ensuring I’m using credentials and not an anonymous account.

I don’t have much time to work on fixing it right now, though. Maybe next week end.

@p3r7
Copy link
Member Author

p3r7 commented Nov 11, 2020

My code seems to fail with credentials as well.

Given how controversial the new stamina system is I anticipate changes in the weeks to come.

Let's not be too aggressive in trying to keep track with those API evolutions.

@mkualquiera
Copy link

I really wish they would just provide an API documentation instead of us having to reverse engineer it every time.
Did the discussion of an official API yield any answers?

@ochen1
Copy link

ochen1 commented Dec 11, 2020

Does anything work atm or should I use a web scraper for my project?

I tried looking at the websocket communications to make my own version but they broke my brain. WAYY to lazy to reverse engineer it.

@p3r7
Copy link
Member Author

p3r7 commented Dec 14, 2020

Does anything work atm

Nope. Hopefully, if nobody takes the plunge I'll implement it during the Christmas holidays.

I tried looking at the websocket communications to make my own version but they broke my brain.

That's how we did it in the previous iterations of this project.

I can understand, I'm not particularly partial to GQL / Apollo.

should I use a web scraper for my project?

What is your project? How a web scraper could help?

@ochen1
Copy link

ochen1 commented Dec 16, 2020

Sorry for the late reply, the email got drowned out in my email lol

I've already implemented a basic version of AI Dungeon for Python using selenium. Currently, it can log in and create new games with a custom prompt.

My project was to make a general purpose chatbot with GPT-3 through AI Dungeon. However, I've realized that the free model AI Dungeon provides isn't that great for this purpose. I think I'll wait for a public version of GPT-3 before attempting this.

@p3r7 p3r7 changed the title Use externalized API client lib Update to latest API revision / externalized API client lib Apr 29, 2021
@p3r7
Copy link
Member Author

p3r7 commented Apr 29, 2021

@ochen1 some peeps seem to have forked this repo to target GPT-3. I don't know if they had a proper early GPT-3 access or if they used AI Dungeon as a backend.

On a related note, this just dropped: https://github.com/AetherDevSecOps/aid_adventure_vulnerability_report

Some takes:

  • funny how much of the user base is using AI Dungeon for "18+" adventures. I don't play much but it happened to me once to have a rather explicit answer from the AI even though I'm pretty sure I never activated the NSFW mode.
  • they didn't friggin rate-limit the API calls
  • I'm not that shocked that they didn't disable introspection in PROD. Malicious ends could brute force their way to the list of endpoints / params anyway. The problem lies more on how open their API is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants