Azure_ChatGPT
According to the Azure OpenAI Service Documentation, the GPT-35-Turbo model for Azure OpenAI service only has completion functionality, and cannot perform conversations like the official OpenAI API.
[2023/3/23 update] Azure update api_version: 2023-03-15-preview. Now we can use openai.ChatCompletion for gpt-3.5-turbo and gpt4.
Based on the chat prompt construction method provided in the documentation.
I have made modifications to the source code of the V3 module in ChatGPT.
Encapsulate Azure OpenAI GPT-3.5-Turbo model and GPT-4 model into a chat API. Extensible for chatbots etc.
Installation
python3 -m pip install azureChatGPT --upgrade
Terminal Chat
Get api_key, api_base, engine_gpt-3.5-turbo, engine_gpt-4 from your Azure (API_KEY, ENDPOINT, ENGINE)
engine set default engine "gpt-3.5-turbo" or "gpt-4"
Modify the configuration file azure.yaml and run
Command line
python3 -m azureChatGPT --config azure.yaml
You can save or load your YAML at any time during the program's execution, making it easy to restore your work state (including conversation records).
$ python3 -m azureChatGPT -h
ChatGPT - Official azureChatGPT API
Repo: github.com/EvAnhaodong/Azure_ChatGPT
Type '!help' to show a full list of commands
Press Esc followed by Enter or Alt+Enter to send a message.
usage: __main__.py [-h] [--temperature TEMPERATURE] [--top_p TOP_P] [--system_prompt SYSTEM_PROMPT] --config CONFIG [--submit_key SUBMIT_KEY]
options:
-h, --help show this help message and exit
--temperature TEMPERATURE
Temperature for response
--top_p TOP_P Top p for response
--system_prompt SYSTEM_PROMPT
Base prompt for chatbot
--config CONFIG Path to config yaml file
--submit_key SUBMIT_KEY
Custom submit key for chatbot. For more information on keys, see https://python-prompt-toolkit.readthedocs.io/en/stable/pages/advanced_topics/key_bindings.html#list-of-special-keys
Disclaimers
This is a personal project. Modify from ChatGPT
Metadata
Release files for azureChatGPT 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| azureChatGPT-0.0.5.tar.gz | 15.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| azureChatGPT-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.2 kB
Release files / azureChatGPT-0.0.5.tar.gz
| Download URL | azureChatGPT-0.0.5.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68aa13bd3009ce5a8ede5732781515f4d936abc7f03cfa62922999e16a7ca327
|
|
BLAKE2b-256 checksum How to use checksums |
3ab277b237b746cbe03c42eb01a56309c0eb27a82c9b24804f951d38787d77f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Release files / azureChatGPT-0.0.5-py3-none-any.whl
| Download URL | azureChatGPT-0.0.5-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f53b7d756e76197bd6142339d8de4c9b67921fc8277e70d7b3966aa414d3b7ca
|
|
BLAKE2b-256 checksum How to use checksums |
52bc5720e308d368560ca50208a47d8180936fad9a5e8ca7bc294b7f9f39dffe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|