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

Is this pip package was ever working? #35

Closed
MerlinTheProgramist opened this issue May 4, 2021 · 3 comments
Closed

Is this pip package was ever working? #35

MerlinTheProgramist opened this issue May 4, 2021 · 3 comments

Comments

@MerlinTheProgramist
Copy link

MerlinTheProgramist commented May 4, 2021

When I install via the pip package manager I don't get the conda yml file as it is contained in the GitHub files. So I can't start the environment. The second thing that I'm experiencing is when I run ai-dungeon-cli I get some errors from the code itself about libraries not containing things, or this is not right until I install the env in conda.

(base) C:\Users\Merlin\anaconda3\Lib\site-packages\ai_dungeon_cli>ai-dungeon-cli
Traceback (most recent call last):
  File "c:\users\merlin\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\merlin\anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Merlin\anaconda3\Scripts\ai-dungeon-cli.exe\__main__.py", line 4, in <module>
  File "c:\users\merlin\anaconda3\lib\site-packages\ai_dungeon_cli\__init__.py", line 6, in <module>
    from gql import gql, Client, WebsocketsTransport
ImportError: cannot import name 'WebsocketsTransport' from 'gql' (c:\users\merlin\anaconda3\lib\site-packages\gql\__init__.py)
@p3r7
Copy link
Member

p3r7 commented May 5, 2021

Yes, this used to work but stopped due to regular API changes, see #29.

As far as I know, pypi packages don’t run under conda. So if you want to use conda you’d have to git clone the repo.

If you’ve got some programming chops, we welcome contributions on adapting to the newest API. The timing might not be ideal, though, given the ongoing war around content moderation. The API is likely to change (again) as things settle down.

@p3r7 p3r7 closed this as completed May 5, 2021
@MerlinTheProgramist
Copy link
Author

So with the gql package import, it is some other problem, independent of that I'm trying to run it with conda? And it will be kind of hard to fix it myself?

@p3r7
Copy link
Member

p3r7 commented May 6, 2021

So with the gql package import, it is some other problem, independent of that I'm trying to run it with conda?

Yes.

The error message you get is due to breaking changes that were made to the gql package. f311141 fixes it but we didn't publish a new release on PyPI as there are other things to fix to make it work (the idea being to not publish a non-working version).

Namely, the play.aidungeon.io API changed and we need to adapt to these changes.

This the error you should be getting when running from git cloned sources (instead of pip installed).

Traceback (most recent call last):
  File "./ai_dungeon_cli/__init__.py", line 393, in <module>
    main()
  File "./ai_dungeon_cli/__init__.py", line 356, in main
    ai_dungeon.make_user_choose_config()
  File "./ai_dungeon_cli/__init__.py", line 177, in make_user_choose_config
    prompt, settings = self.api.get_options(self.api.single_player_mode_id)
  File "/home/eigen/Documents/Code/local/ai-dungeon-cli/ai_dungeon_cli/impl/api/client.py", line 124, in get_options
    prompt = result['content']['prompt']
KeyError: 'content' 

And it will be kind of hard to fix it myself?

It's not that hard. It consists of running AI Dungeon in a web browser, inspect the exchanges in developper mode and reproduce the exchanges in impl/api/client.py.

This comment is an example of the process: #23 (comment)

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

No branches or pull requests

2 participants