Update README.md
Browse files
README.md
CHANGED
@@ -1,112 +1,10 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
- mistral-large
|
12 |
-
|
13 |
-
## 请求格式
|
14 |
-
已转换为OpenAI格式,支持非流与流式请求,支持temperature与topP传参:
|
15 |
-
|
16 |
-
## 获取模型列表
|
17 |
-
```
|
18 |
-
curl https:/http://127.0.0.1:7860/v1/models
|
19 |
-
```
|
20 |
-
## 聊天请求
|
21 |
-
```
|
22 |
-
curl https://http://127.0.0.1:7860/v1/chat/completions \
|
23 |
-
-H "Content-Type: application/json" \
|
24 |
-
-H "Authorization: Bearer YOUR_API_KEY" \
|
25 |
-
-d '{
|
26 |
-
"model": "claude-3-5-sonnet-20241022",
|
27 |
-
"messages": [
|
28 |
-
{
|
29 |
-
"role": "user",
|
30 |
-
"content": "Hello, can you help me?"
|
31 |
-
}
|
32 |
-
],
|
33 |
-
"temperature": 0.7,
|
34 |
-
"topP": 1
|
35 |
-
}'
|
36 |
-
```
|
37 |
-
## 抱脸部署
|
38 |
-
下载文件,创建新的docker抱脸项目,然后上传文件,等待运行即可
|
39 |
-
|
40 |
-
## 本地docker部署
|
41 |
-
下载文件,然后创建镜像。
|
42 |
-
|
43 |
-
```
|
44 |
-
docker build -t youname/partyrock2api .
|
45 |
-
```
|
46 |
-
docker运行
|
47 |
-
```
|
48 |
-
docker run -it -d --name partyrock2api \
|
49 |
-
--network=my_custom_network \
|
50 |
-
-p 7860:7860 \
|
51 |
-
-e API_KEY=your_api_key \
|
52 |
-
-e RedisUrl=your_RedisUrl \
|
53 |
-
-e RedisToken=your_RedisUrl \
|
54 |
-
-e AUTH_TOKENS_0_REFRESH_URL=your_referer \
|
55 |
-
-e AUTH_TOKENS_0_ANTI_CSRF_TOKEN=your_partyrock_anti-csrftoken-a2z\
|
56 |
-
-e AUTH_TOKENS_0_COOKIE=your_ partyrockCookie \
|
57 |
-
-e PORT=7860 \
|
58 |
-
youname/partyrock2api:latest
|
59 |
-
```
|
60 |
-
## 端口
|
61 |
-
- 默认端口:7860
|
62 |
-
|
63 |
-
## 主要变量参数获取方式
|
64 |
-
1、打开登录这个网站[partyrock](https://partyrock.aws/),然后创建一个聊天app.
|
65 |
-

|
66 |
-
|
67 |
-
2、先打开f12,进入network界面,然后进行对话,完整复制下面的信息,分别为anti-csrftoken-a2z,Referer, Cookie的值,最好对话两次再获取cookie的值,有可能第一次没有验证用的waf cookie,导致后面报错400。
|
68 |
-

|
69 |
-
|
70 |
-

|
71 |
-
|
72 |
-
3、redis保护需要的token获取方式
|
73 |
-
注册账号后创建数据库选择免费计划,然后在这里获取url和认证密钥填入环境变量。
|
74 |
-

|
75 |
-
|
76 |
-
4、抱脸ip可能被封,可能需要反代,才能正常使用
|
77 |
-
创建deno账号创建项目,复制如下代码,然后获取url
|
78 |
-
```
|
79 |
-
import { serve } from "https://deno.land/[email protected]/http/server.ts";
|
80 |
-
|
81 |
-
const PROXY_DOMAIN = "https://partyrock.aws/stream/getCompletion";
|
82 |
-
const PORT = 8080;
|
83 |
-
|
84 |
-
async function handler(req: Request): Promise<Response> {
|
85 |
-
try {
|
86 |
-
const url = new URL(req.url);
|
87 |
-
const targetUrl = `${PROXY_DOMAIN}${url.pathname}${url.search}`;
|
88 |
-
|
89 |
-
const proxyResponse = await fetch(targetUrl, {
|
90 |
-
headers: req.headers,
|
91 |
-
method: req.method,
|
92 |
-
body: req.body
|
93 |
-
});
|
94 |
-
|
95 |
-
// 返回代理响应,保留状态码和响应头
|
96 |
-
return new Response(proxyResponse.body, {
|
97 |
-
status: proxyResponse.status,
|
98 |
-
headers: proxyResponse.headers
|
99 |
-
});
|
100 |
-
} catch (error) {
|
101 |
-
console.error("代理请求失败:", error);
|
102 |
-
return new Response("代理服务器错误", { status: 500 });
|
103 |
-
}
|
104 |
-
}
|
105 |
-
serve(handler, { port: PORT });
|
106 |
-
```
|
107 |
-

|
108 |
-
|
109 |
-

|
110 |
-
|
111 |
-
## 声明
|
112 |
-
请勿用于商业用途。
|
|
|
1 |
+
---
|
2 |
+
title: ppppp
|
3 |
+
emoji: 🏆
|
4 |
+
colorFrom: green
|
5 |
+
colorTo: gray
|
6 |
+
sdk: docker
|
7 |
+
pinned: false
|
8 |
+
license: mit
|
9 |
+
app_port: 7860
|
10 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|