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

WIP feat: migrate to openai>=1.0.0 #98

Draft
wants to merge 6 commits into
base: next
Choose a base branch
from
Draft

Conversation

Hanssen0
Copy link
Contributor

@Hanssen0 Hanssen0 commented Dec 8, 2023

See openai/openai-python#742, openai.Image.create() has been replaced with client.images.generate().

@Hanssen0 Hanssen0 force-pushed the master branch 4 times, most recently from 8c0b5ba to 32c1559 Compare December 9, 2023 13:18
@F33RNI
Copy link
Owner

F33RNI commented Dec 9, 2023

Thx so much for your contribution! And special thanks for trying to solve the markdown problem! Please fix the problem with importing the md2tgmd package and then I'll look at the rest of your pull requests

@Hanssen0
Copy link
Contributor Author

Hanssen0 commented Dec 9, 2023

Thx so much for your contribution! And special thanks for trying to solve the markdown problem! Please fix the problem with importing the md2tgmd package and then I'll look at the rest of your pull requests

Hi!
I have added the md2tgmd. See

git+https://github.com/handsome0hell/md2tgmd.git@main

I wonder why the docker build failed. I'm using the docker image on my server. Any idea?

@F33RNI
Copy link
Owner

F33RNI commented Dec 9, 2023

My attempt to build it by hand also failed

  ...
  Running setup.py install for md2tgmd ... done
  Running setup.py install for langdetect ... done
  Running setup.py install for EdgeGPT ... done
  Running setup.py install for bardapi ... done
Successfully installed BingImageCreator-0.5.0 EdgeGPT-0.14.0 OpenAIAuth-3.0.0 PySocks-1.7.1 aiohttp-3.9.1 aiosignal-1.3.1 annotated-types-0.6.0 anyio-4.1.0 async-timeout-4.0.3 asyncio-3.4.3 attrs-23.1.0 bardapi-0.1.38 certifi-2023.11.17 charset-normalizer-3.3.2 colorama-0.4.6 distro-1.8.0 exceptiongroup-1.2.0 frozenlist-1.4.0 h11-0.14.0 h2-4.1.0 hpack-4.0.0 httpcore-0.17.3 httpx-0.24.1 hyperframe-6.0.1 idna-3.6 langdetect-1.0.9 markdown-it-py-3.0.0 md2tgmd-0.1.0 mdurl-0.1.2 multidict-6.0.4 openai-1.3.8 pillow-10.1.0 prompt-toolkit-3.0.41 psutil-5.9.6 pydantic-2.5.2 pydantic-core-2.14.5 pygments-2.17.2 python-telegram-bot-20.3 regex-2023.10.3 requests-2.31.0 revChatGPT-6.8.6 rich-13.7.0 six-1.16.0 sniffio-1.3.0 socksio-1.0.0 telegram-0.0.1 tiktoken-0.5.2 tls-client-0.2.2 tqdm-4.66.1 typing-extensions-4.8.0 urllib3-2.1.0 wcwidth-0.2.12 websockets-12.0 yarl-1.9.4
$ python main.py

Traceback (most recent call last):
  File "/home/fern/GPT-Telegramus/main.py", line 24, in <module>
    import BardModule
  File "/home/fern/GPT-Telegramus/BardModule.py", line 26, in <module>
    import BotHandler
  File "/home/fern/GPT-Telegramus/BotHandler.py", line 33, in <module>
    import md2tgmd
ModuleNotFoundError: No module named 'md2tgmd'

@F33RNI
Copy link
Owner

F33RNI commented Dec 9, 2023

Maybe u need to put md2tgmd.py inside src directory? (it's a common structure of python packages)

@F33RNI
Copy link
Owner

F33RNI commented Dec 9, 2023

And also I think you need to add py_modules=["md2tgmd"], inside setup.py

@Hanssen0
Copy link
Contributor Author

Hanssen0 commented Dec 9, 2023

Maybe u need to put md2tgmd.py inside src directory? (it's a common structure of python packages)

I guess so. But md2tgmd is not my project, I'm trying to avoid modification on it.

@F33RNI
Copy link
Owner

F33RNI commented Dec 9, 2023

Maybe u need to put md2tgmd.py inside src directory? (it's a common structure of python packages)

I guess so. But md2tgmd is not my project, I'm trying to avoid modification on it.

I see... Maybe we can just include this file separately without pip 🙃

@Hanssen0
Copy link
Contributor Author

Hanssen0 commented Dec 9, 2023

I see... Maybe we can just include this file separately without pip 🙃

image
I tried to build it from scratch, and it succeeded. Not sure what's the problem.

@Hanssen0
Copy link
Contributor Author

Hanssen0 commented Dec 9, 2023

> python --version
Python 3.11.6
> pip --version
pip 23.2.1 from /home/hanssen/Programs/GPT-Telegramus/venv/lib/python3.11/site-packages/pip (python 3.11)

@F33RNI
Copy link
Owner

F33RNI commented Dec 9, 2023

I think this helped
https://github.com/F33RNI/md2tgmd

@Hanssen0
Copy link
Contributor Author

Hanssen0 commented Dec 9, 2023

I think this helped https://github.com/F33RNI/md2tgmd

I have merged that to my repo. Could you please try to build again?

@F33RNI
Copy link
Owner

F33RNI commented Dec 9, 2023

I think this helped https://github.com/F33RNI/md2tgmd

I have merged that to my repo. Could you please try to build again?

Yeah, now everything works and even Bard generates pictures 🤯
I'm testing other features... 😅

@Hanssen0
Copy link
Contributor Author

Hanssen0 commented Dec 9, 2023

Yeah, now everything works and even Bard generates pictures 🤯 I'm testing other features... 😅

I suggest that we should merge #102 first. This pr needs more work to improve the dalle module's user experience.

@F33RNI
Copy link
Owner

F33RNI commented Dec 9, 2023

Yeah, now everything works and even Bard generates pictures 🤯 I'm testing other features... 😅

I suggest that we should merge #102 first. This pr needs more work to improve the dalle module's user experience.

OK! Can you please fix md2tgmd to restart the workflow in all PRs?

@Hanssen0
Copy link
Contributor Author

Hanssen0 commented Dec 9, 2023

OK! Can you please fix md2tgmd to restart the workflow in all PRs?

The code here doesn't need to be changed since the dependency link is the same. Can you re-run the workflows manually?

@Hanssen0 Hanssen0 changed the title feat: migrate to openai>=1.0.0 WIP feat: migrate to openai>=1.0.0 Dec 9, 2023
@Hanssen0 Hanssen0 marked this pull request as draft December 9, 2023 17:40
@Hanssen0 Hanssen0 force-pushed the master branch 8 times, most recently from 48b9f12 to 0477813 Compare December 15, 2023 03:27
@Hanssen0 Hanssen0 changed the base branch from master to next December 15, 2023 03:28
@Hanssen0 Hanssen0 force-pushed the master branch 5 times, most recently from 0477813 to f7ff02d Compare December 17, 2023 00:54
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

Successfully merging this pull request may close these issues.

None yet

2 participants