GPT是一种AI模型,其对话是独立单次的。对话结束,AI记忆清除掉,Token<=4096可实现记住上下文、连续记忆。Trubo具补全作用,意味着很适合文本互动,首使参考:快速入门:开始通过 Azure OpenAI 服务使用 GPT-35-Turbo and GPT-4 - Azure OpenAI Service | Microsoft Learn
python_Azure代码实例:
import os from openai
import AzureOpenAI
client = AzureOpenAI(
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"),
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
api_version="2024-02-01"
) #调用相关API,配置Azure访问AI模型
response = client.chat.completions.create( #根据给定条件创建chat自动回复
model="gpt-35-turbo", #调用想要的gpt版本
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Does Azure OpenAI support customer managed keys?"},
{"role": "assistant", "content": "Yes, customer managed keys are supported by Azure OpenAI."},
{"role": "user", "content": "Do other Azure AI services support this too?"}
]
)
print(response.choices[0].message.content)#完成AI资源创建
key,云服,远控工具(FinalShell/Xshell/Xfpt)
中转key:
https://tw.openai-hk.com/
https://open-hk.com/
docker配置相关端口、账号、镜像:
docker run --name chatgpt-next-web -d -p 1002:3000 \
-e OPENAI_API_KEY=换成你的中转key \
-e CODE=页面访问密码 \
-e HIDE_USER_API_KEY=1 \
-e BASE_URL=https://api.openai-hk.com yidadaa/chatgpt-next-web
docker cmd:
docker ps
docker stop id
docker rm -f id
docker ps -a