MarsGPT
A ChatGPT API
安装
pip install MarsGPT
使用
import sys
import asyncio
from MarsGPT import Chatbot
async def main():
"""
Chat AI Test
"""
# params
email = "xxx@xxx.com"
password = "xxxxxx"
# login
chatbot = Chatbot(email=email, password=password)
# ask
try:
while True:
print("You:")
prompt = ""
while(len(prompt.strip()) == 0):
prompt = input()
# # clear
# chatbot.conversations.remove("default")
print("ChatGPT:")
# ret, res = self.chatbot.ask_sync(prompt)
# print(res)
async for line in chatbot.ask(prompt):
result = line["choices"][0]["text"].replace("<|im_end|>", "")
print(result, end="")
sys.stdout.flush()
print()
except KeyboardInterrupt:
print("Exiting...")
sys.exit(0)
if __name__ == "__main__":
asyncio.run(main())
Metadata
Release files for marsgpt 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| MarsGPT-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for MarsGPT-0.1.1-py3-none-any.whl |
Release files / MarsGPT-0.1.1-py3-none-any.whl
| Download URL | MarsGPT-0.1.1-py3-none-any.whl |
|---|---|
| Size | 12.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
38b1369555be9e760625548cd4a5e9df2195b7c0e7b47bdccbe8c6e78debee9f
|
|
BLAKE2b-256 checksum How to use checksums |
b993dd15384f0420aaebe31fd09b026e4bfc82b18178cfafadac65ba51eca46e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.9
|
Security for marsgpt 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.