Skip to main content
HunYuanGPT

HunYuanGPT

混元大模型逆向api

安装模块

pip install HunYuanGPT --upgrade

获取cookie

  1. 你需要一个拥有腾讯混元大模型体验资格的账号。

  2. 打开腾讯混元助手

  3. 打开浏览器开发者模式,切换到network选项卡,随便发送一条信息,找到一个有效的的请求,获取cookie字段的值。

使用聊天机器人

从命令行运行

$ python -m HunYuanGPT -h



             _    _         __     __                 _____ _____ _______ 

            | |  | |        \ \   / /                / ____|  __ \__   __|

            | |__| |_   _ _ _\ \_/ /   _  __ _ _ __ | |  __| |__) | | |   

            |  __  | | | | '_ \   / | | |/ _` | '_ \| | |_ |  ___/  | |   

            | |  | | |_| | | | | || |_| | (_| | | | | |__| | |      | |   

            |_|  |_|\__,_|_| |_|_| \__,_|\__,_|_| |_|\_____|_|      |_|   





Type /help for help.

Alt + Enter to send a message.



usage: __main__.py [-h] [--cookie_file_path COOKIE_FILE_PATH] [--no_stream]



options:

  -h, --help            show this help message and exit

  --cookie_file_path COOKIE_FILE_PATH

                        The path to the cookie file.

  --no_stream           Whether to use streaming mode.

在代码中运行

from HunYuanGPT import ChatBot



bot = ChatBot(cookie="xxxxxxxx")



# Streaming output

for rsp in bot.ask_stream("你好!你叫什么名字?"):

    print(rsp, end="", flush=True)



# Normal output

print(bot.ask("你好!你叫什么名字?"))



# Generate images

# Images are named numerically by default and are saved in the./images folder.

# Of course, you can specify these parameters.

bot.get_image("赛博朋克风格的上海街头", path="./", name="img")

其他用法

# Switch to conversation with chatId "xxxxxx"

bot.change_conversation(chatId="xxxxxx")



# Set the name of conversation with chatId "xxxxxx" to "xxx"

bot.set_conversation_name(name="xxx", chatId="xxxxxx")



# Get the history of conversation with chatId "xxxxxx"

bot.get_conversation(chatId="xxxxxx")



# Get chatId and titles of all conversations

bot.get_all_conversations()



# Clear all conversations

bot.clear_all_conversations()



# Repeat the last reply

bot.repeat_last_reply()



# Forget the history and continue the conversation

bot.restart_conversation()

Release files for HunYuanGPT 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for HunYuanGPT 0.1.0
File Size Uploaded
HunYuanGPT-0.1.0.tar.gz 17.4 kB Details

Release files / HunYuanGPT-0.1.0.tar.gz

Download URL HunYuanGPT-0.1.0.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8549131ae111415d62e81c61f6cb66e727b57a85e8529bcdefd0f8e917b9d735
BLAKE2b-256 checksum
How to use checksums
2b8dde54254595ef99c305877bf05e2e0a25351ed076f694fc344c935b18dd2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page