# web-chat-gpt **Repository Path**: chat-gpt/web-chat-gpt ## Basic Information - **Project Name**: web-chat-gpt - **Description**: 使用openai , fastapi, nginx来创建一个web聊天服务器,来访问chatGPT,和更多的openai的服务 - **Primary Language**: Python - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2023-02-12 - **Last Updated**: 2023-02-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # web-chat-gpt #### 介绍 使用openai , fastapi, nginx来创建一个web聊天服务器,来访问chatGPT,和更多的openai的服务 #### 软件架构 软件架构说明: nginx做前端web服务器,访问index.html index.html来访问fastapi的restapi 使用openai的python接口来访问chatGPT #### 安装教程 1. pip install fastapi "uvicorn[standard]" openai 2. yum/apt install nginx 3. cd web-chat-gpt && cp -r nginx/chatgpt-html /var/www/html #### 使用说明 1. 修改nginx.conf, 添加web服务的路径路由 ``` location = /text { proxy_pass http://ip:port/text; } location = /code { proxy_pass http://ip:port/code; } ``` 这里ip为web服务的外部ip,端口为内部fastapi webserver的端口,一般是5001 2. 修改html中的访问地址 http://ip:port/code http://ip:port/text,写上自己的ip和port, 和nginx.conf中提供的webserver的端口,ip地址一样 3. 启动fastapi的web服务 >../webserver && nohup python ws_server.py 4. 使用浏览器访问 nginx服务的index.html # nginx 的html网页来自第三方的网站 > chatgpt-html, 你可以访问这个网站来获取同样 # 扩展 现在只提供了text completion和code_completion,未来会提供更多的api