本文根据deepseek官网接口文档学习补全api的调用,传入参数比较多,该文档中给出了详细的解释,以下代码在官网代码的基础上有所修改,返回结果内容很多,通过AI了解了各个参数的内容,记录在此,供大家一同学习参考。
文档链接:FIM 补全(Beta) | DeepSeek API Docs
运行代码
import requests
import json
import time
def storyTest(api_key):
url = "https://api.deepseek.com/beta/completions"
payload = json.dumps({
"model": "deepseek-chat",
"prompt": "Once upon a time, ",
"echo": False,
"frequency_penalty": 0,
"logprobs": 0,
"max_tokens": 1024,
"presence_penalty": 0,
"stop": None,
"stream": False,
"stream_options": None,
"suffix": None,
"temperature": 1,
"top_p": 1
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': f'Bearer {api_key}'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
if __name__=="__main__":
api_key = "sk-xxxxxxxxxxxxx"
start = time.time()
storyTest(api_key)
end = time.time()
print(f"deepseek_chat 此次调用花费时间为:{(end-start):.4f}秒")
返回结果原始内容如下:
{"id":"1dc2ee32-1e2c-4ad3-bfeb-b17b19ad4f78","choices":[{"text":"20 years ago, I was a young, single, working woman living in the city. apartment, and a great group of friends. I was happy with my life, but I knew that I wanted more. I wanted to find someone to share my ould make me laugh, someone who would be my partner in crime.\n\nI had been on a few dates here and there, but nothing serious. I was stbe I was destined to be single forever. But then, one day, I met him.\n\nHe was tall, dark, and handsome, with a smile that could light utual friend's party, and we hit it off immediately. We talked for hours, and I felt like I had known him my whole life. We exchanged nuut on a date.\n\nOur first date was magical. We went to a fancy restaurant, and we talked and laughed all night. I felt like I was in a ore dates, and before I knew it, we were in love.\n\nWe got married a year later, and we've been together ever since. We've had our ups ays been there for each other. He's my best friend, my soulmate, and the love of my life.\n\nLooking back, I can't believe how lucky I as made my life so much better, and I can't imagine my life without him. I'm so grateful for that fateful night 20 years ago when we met.ver.","index":0,"logprobs":{"tokens":["20"," years"," ago",","," I"," was"," a"," young",","," single",","," working"," woman"," living""," I"," had"," a"," good"," job",","," a"," nice"," apartment",","," and"," a"," great"," group"," of"," friends","."," I"," was"," hap",","," but"," I"," knew"," that"," I"," wanted"," more","."," I"," wanted"," to"," find"," someone"," to"," share"," my"," life"," with" would"," make"," me"," laugh",","," someone"," who"," would"," be"," my"," partner"," in"," crime",".\n\n","I"," had"," been"," on"," e"," and"," there",","," but"," nothing"," serious","."," I"," was"," starting"," to"," think"," that"," maybe"," I"," was"," destined",
forever","."," But"," then",","," one"," day",","," I"," met"," him",".\n\n","He"," was"," tall",","," dark",","," and"," handsome",",",
that"," could"," light"," up"," a"," room","."," We"," met"," at"," a"," mutual"," friend","'s"," party",","," and"," we"," hit"," it","," We"," talked"," for"," hours",","," and"," I"," felt"," like"," I"," had"," known"," him"," my"," whole"," life","."," We"," exchange," he"," asked"," me"," out"," on"," a"," date",".\n\n","Our"," first"," date"," was"," magical","."," We"," went"," to"," a"," fancy","" we"," talked"," and"," laughed"," all"," night","."," I"," felt"," like"," I"," was"," in"," a"," fairy"," tale","."," We"," went"," o" and"," before"," I"," knew"," it",","," we"," were"," in"," love",".\n\n","We"," got"," married"," a"," year"," later",","," and"," weer"," ever"," since","."," We","'ve"," had"," our"," ups"," and"," downs",","," but"," we","'ve"," always"," been"," there"," for"," eacs"," my"," best"," friend",","," my"," soul","mate",","," and"," the"," love"," of"," my"," life",".\n\n","Looking"," back",","," I"," cw"," lucky"," I"," am"," to"," have"," found"," him","."," He","'s"," made"," my"," life"," so"," much"," better",","," and"," I"," can" life"," without"," him","."," I","'m"," so"," grateful"," for"," that"," fate","ful"," night"," ","20"," years"," ago"," when"," we"," "," my"," life"," forever","."],"token_logprobs":[-0.909262,-0.000008,0.0,-0.0,-0.011512,-0.00208,-0.002397,-0.003682,-0.481287,-1.24029333162,-1.140595,-0.000005,-1.642135,-0.23801,-0.02512,-0.000107,-0.113795,-0.000358,-0.889499,0.0,-0.010127,-0.007712,-0.001492,-0.00000.000104,-0.047993,-0.050217,0.0,-0.000008,0.0,-0.105982,-0.000026,-0.013068,-1.018941,0.0,0.0,-0.002276,0.0,-0.0,-1.088302,-0.023065,-0.0,0.0,0.0,-0.000003,-0.001352,-0.126209,-0.0,0.0,0.0,0.0,0.0,-0.000188,-0.007681,-0.280299,0.0,-3.046389,0.0,-0.000001,-0.000001,-0.000.023831,-0.176735,0.0,-0.000018,-0.198832,-0.692849,-0.057806,-0.000003,-0.00004,0.0,0.0,0.0,-0.817893,0.0,0.0,0.0,0.0,-0.000007,-0.05290.001959,0.0,0.0,-0.00402,0.0,-0.000001,0.0,-0.001378,-0.022816,0.0,0.0,-0.000878,0.0,0.0,-0.000012,0.0,-0.0,0.0,-0.000003,0.0,-0.0000863774,0.0,-0.000206,0.0,-0.000109,0.0,0.0,0.0,-0.000305,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.000106,-0.001444,0.0,0.0,-0.000085,0.00.000001,0.0,0.0,0.0,-1.771429,0.0,0.0,0.0,0.0,0.0,-0.035306,-0.000005,-0.000021,-0.018597,0.0,0.0,0.0,0.0,0.0,-0.011903,-0.000001,0.0,-0.000001,0.0,0.0,-0.000006,-0.000002,0.0,0.0,0.0,0.0,0.0,0.0,-0.000011,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-1.321512,0.0,-0.0,0.0,-0.001,0.0,-0.000127,-0.025722,-0.000001,0.0,0.0,-0.000787,-1.140903,0.0,-0.775909,0.0,-0.0,-0.731463,-0.96579,-0.0,-0.462478,0.0,-0.000047,0,0.0,0.0,0.0,-0.071803,-0.017664,-0.0,-0.000434,-0.000057,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.167219,0.0,-0.018543,0.0,0.0,0.0,-0.088553,0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.04753,-0.000001,0.0,0.0,0.0,0.0,-0.20148,0.0,0.0,0.0,0.0,0.0,0.0,-0.136776,0.0,0.0,-0.00348,-0.624114,0.0,0010518,0.0,-0.02277,0.0,-0.004891,0.0,-0.000119,-0.0,0.0,0.0,-0.000013,-0.000032,0.0,0.0,0.0,0.0,-0.079132,0.0,-0.044041,0.0,0.0,0.0,0.00.0,0.0,0.0,-0.000004,0.0,0.0,0.0,0.0,-0.000003,-0.000374,-0.000017,0.0,-0.009015,-0.002836,-1.829813,0.0,-0.000006,-1.055187,0.0,0.0,0.0,-0.001947,0.0,-0.057098,0.0,0.0,0.0,-0.120058],"top_logprobs":null,"text_offset":[18,20,26,30,31,33,37,39,45,46,53,54,62,68,75,78,82,86,108,113,123,124,128,130,136,142,145,153,154,156,160,166,171,174,179,180,184,186,191,196,198,205,210,211,213,220,223,228,236,239,245,247,282,285,291,292,300,304,310,313,316,324,327,333,336,337,341,346,349,351,355,361,366,370,376,377,381,389,397,398,400,404,413,416,422,424,461,469,470,474,479,480,484,488,489,491,495,499,502,504,508,513,514,519,520,524,533,534,539,541,547,552,558,564,567,569,574,575,578,589,610,614,617,621,624,628,640,641,644,651,655,661,662,666,668,673,678,680,684,690,694,697,703,708,709,712,722,730,731,735,738,744,747,753,778,782,790,791,794,799,802,804,810,821,822,826,829,836,840,848,852,858,859,861,866,871,873,877,880,882,888,893,894,897,902,905,910,918,939,942,947,950,955,958,960,964,972,974,979,985,986,990,993,996,1001,1010,1015,1021,1022,1025,1028,1032,1036,1040,1044,1050,1051,1055,61,1068,1073,1071095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,1163,1168,1169,1171,1175,1177,9,1083,1088,1094,1095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,1163,1168,1169,1171,1175,1177189,1195,1197,121342,1346,1351,1354,1358,1359,1362,1370,1373,1378,1386]},"finish_reason":"stop"}],"created":1735541715,"model":"deepseek00,1203,1208,1214,1218,1219,1222,1224,1229,1232,1237,1240,1245,1252,1253,1257,1259,1263,1265,1273,1276,1281,1289,1293,1294,1296,1298,1308,939,942,947,950,955,958,960,964,972,974,979,985,986,990,993,996,1001,1010,1015,1021,1022,1025,1028,1032,1036,1040,1044,1050,1051,1055,61,1068,1073,,1336,1342,1346,1351,1354,1358,1359,1362,1370,1373,1378,1386]},"finish_reason":"stop"}],"created":1735541715,"model":"deeps1079,1083,1088,1094,1095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,1163,1168,1169,1171,1175,15,1189,1195,11afce2943","object":"text_completion","usage":{"prompt_tokens":6,"completion_tokens":338,"total_tokens":344,"prompt_cache_h197,1200,1203,1208,1214,1218,1219,1222,1224,1229,1232,1237,1240,1245,1252,1253,1257,1259,1263,1265,1273,1276,1281,1289,1293,1294,1296,128,939,942,947,950,955,958,960,964,972,974,979,985,986,990,993,996,1001,1010,1015,1021,1022,1025,1028,1032,1036,1040,1044,1050,1051,1055,61,1068,1077,1333,1334,1336,1342,1346,1351,1354,1358,1359,1362,1370,1373,1378,1386]},"finish_reason":"stop"}],"created":1735541715,"mode3,1079,1083,1088,1094,1095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,1163,1168,1169,1171,1175185,1189,11erprint":"fp_f1afce2943","object":"text_completion","usage":{"prompt_tokens":6,"completion_tokens":338,"total_tokens":344,"pr95,1197,1200,1203,1208,1214,1218,1219,1222,1224,1229,1232,1237,1240,1245,1252,1253,1257,1259,1263,1265,1273,1276,1281,1289,1293,1294,1298,939,942,947,950,955,958,960,964,972,974,979,985,986,990,993,996,1001,1010,1015,1021,1022,1025,1028,1032,1036,1040,1044,1050,1051,1055,61,1068,,1324,1327,1333,1334,1336,1342,1346,1351,1354,1358,1359,1362,1370,1373,1378,1386]},"finish_reason":"stop"}],"created":17355417151073,1079,1083,1088,1094,1095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,1163,1168,1169,1171,17,1185,1system_fingerprint":"fp_f1afce2943","object":"text_completion","usage":{"prompt_tokens":6,"completion_tokens":338,"total_tokens"189,1195,1197,1200,1203,1208,1214,1218,1219,1222,1224,1229,1232,1237,1240,1245,1252,1253,1257,1259,1263,1265,1273,1276,1281,1289,1293,128,939,942,947,950,955,958,960,964,972,974,979,985,986,990,993,996,1001,1010,1015,1021,1022,1025,1028,1032,1036,1040,1044,1050,1051,1055,61,1010,1314,1319,1324,1327,1333,1334,1336,1342,1346,1351,1354,1358,1359,1362,1370,1373,1378,1386]},"finish_reason":"stop"}],"created":168,1073,1079,1083,1088,1094,1095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,1163,1168,1169,1171177,eepseek-chat","system_fingerprint":"fp_f1afce2943","object":"text_completion","usage":{"prompt_tokens":6,"completion_tokens":338,"t1185,1189,1195,1197,1200,1203,1208,1214,1218,1219,1222,1224,1229,1232,1237,1240,1245,1252,1253,1257,1259,1263,1265,1273,1276,1281,1289,18,939,942,947,950,955,958,960,964,972,974,979,985,986,990,993,996,1001,1010,1015,1021,1022,1025,1028,1032,1036,1040,1044,1050,1051,1055,1061,8,1301,1310,1314,1319,1324,1327,1333,1334,1336,1342,1346,1351,1354,1358,1359,1362,1370,1373,1378,1386]},"finish_reason":"stop"}],"c1068,1073,1079,1083,1088,1094,1095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,1163,1168,1169,1175,15,"model":"deepseek-chat","system_fingerprint":"fp_f1afce2943","object":"text_completion","usage":{"prompt_tokens":6,"completion_to177,1185,1189,1195,1197,1200,1203,1208,1214,1218,1219,1222,1224,1229,1232,1237,1240,1245,1252,1253,1257,1259,1263,1265,1273,1276,1281,128,939,942,947,950,955,958,960,964,972,974,979,985,986,990,993,996,1001,1010,1015,1021,1022,1025,1028,1032,1036,1040,1044,1050,1051,1055,,106296,1298,1301,1310,1314,1319,1324,1327,1333,1334,1336,1342,1346,1351,1354,1358,1359,1362,1370,1373,1378,1386]},"finish_reason":"stop1,1068,1073,1079,1083,1088,1094,1095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,1163,1168,11691,111735541715,"model":"deepseek-chat","system_fingerprint":"fp_f1afce2943","object":"text_completion","usage":{"prompt_tokens":6,"compl75,1177,1185,1189,1195,1197,1200,1203,1208,1214,1218,1219,1222,1224,1229,1232,1237,1240,1245,1252,1253,1257,1259,1263,1265,1273,1276,1288,939,942,947,950,955,958,960,964,972,974,979,985,986,990,993,996,1001,1010,1015,1021,1022,1025,1028,1032,1036,1040,1044,1050,1051,1055,58,10294,1296,1298,1301,1310,1314,1319,1324,1327,1333,1334,1336,1342,1346,1351,1354,1358,1359,1362,1370,1373,1378,1386]},"finish_reason"61,1068,1073,1079,1083,1088,1094,1095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,1163,1168,1161171,eated":1735541715,"model":"deepseek-chat","system_fingerprint":"fp_f1afce2943","object":"text_completion","usage":{"prompt_tokens":1175,1177,1185,1189,1195,1197,1200,1203,1208,1214,1218,1219,1222,1224,1229,1232,1237,1240,1245,1252,1253,1257,1259,1263,1265,1273,1276,18,939,942,947,950,955,958,960,964,972,974,979,985,986,990,993,996,1001,1010,1015,1021,1022,1025,1028,1032,1036,1040,1044,1050,1051,1055,58,293,1294,1296,1298,1301,1310,1314,1319,1324,1327,1333,1334,1336,1342,1346,1351,1354,1358,1359,1362,1370,1373,1378,1386]},"finish_reas1061,1068,1073,1079,1083,1088,1094,1095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,1163,1168,19,1}],"created":1735541715,"model":"deepseek-chat","system_fingerprint":"fp_f1afce2943","object":"text_completion","usage":{"prompt_toke171,1175,1177,1185,1189,1195,1197,1200,1203,1208,1214,1218,1219,1222,1224,1229,1232,1237,1240,1245,1252,1253,1257,1259,1263,1265,1273,128,939,942,947,950,955,958,960,964,972,974,979,985,986,990,993,996,1001,1010,1015,1021,1022,1025,1028,1032,1036,1040,1044,1050,1051,1055,10589,1293,1294,1296,1298,1301,1310,1314,1319,1324,1327,1333,1334,1336,1342,1346,1351,1354,1358,1359,1362,1370,1373,1378,1386]},"finis,1061,1068,1073,1079,1083,1088,1094,1095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,1163,1168,1169stop"}],"created":1735541715,"model":"deepseek-chat","system_fingerprint":"fp_f1afce2943","object":"text_completion","usage":{"pro,1171,1175,1177,1185,1189,1195,1197,1200,1203,1208,1214,1218,1219,1222,1224,1229,1232,1237,1240,1245,1252,1253,1257,1259,1263,1265,1278,939,942,947,950,955,958,960,964,972,974,979,985,986,990,993,996,1001,1010,1015,1021,1022,1025,1028,1032,1036,1040,1044,1050,1051,1055,101,1289,1293,1294,1296,1298,1301,1310,1314,1319,1324,1327,1333,1334,1336,1342,1346,1351,1354,1358,1359,1362,1370,1373,1378,1386]},"58,1061,1068,1073,1079,1083,1088,1094,1095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,1163,1168,son":"stop"}],"created":1735541715,"model":"deepseek-chat","system_fingerprint":"fp_f1afce2943","object":"text_completion","usage"1169,1171,1175,1177,1185,1189,1195,1197,1200,1203,1208,1214,1218,1219,1222,1224,1229,1232,1237,1240,1245,1252,1253,1257,1259,1263,12658,939,942,947,950,955,958,960,964,972,974,979,985,986,990,993,996,1001,1010,1015,1021,1022,1025,1028,1032,1036,1040,1044,1050,1051,1055,1,1281,1289,1293,1294,1296,1298,1301,1310,1314,1319,1324,1327,1333,1334,1336,1342,1346,1351,1354,1358,1359,1362,1370,1373,1378,13058,1061,1068,1073,1079,1083,1088,1094,1095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,1163,116sh_reason":"stop"}],"created":1735541715,"model":"deepseek-chat","system_fingerprint":"fp_f1afce2943","object":"text_completion"8,1169,1171,1175,1177,1185,1189,1195,1197,1200,1203,1208,1214,1218,1219,1222,1224,1229,1232,1237,1240,1245,1252,1253,1257,1259,1263,1265,"prompt_tokens":6,"completion_tokens":338,"total_tokens":344,"prompt_cache_hit_tokens":0,"prompt_cache_miss_tokens":6}}
8,939,942,947,950,955,958,960,964,972,974,979,985,986,990,993,996,1001,1010,1015,1021,1022,1025,1028,1032,1036,1040,1044,1050,1051,105,13Users\liyubo>
5,1058,1061,1068,1073,1079,1083,1088,1094,1095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,11ion
63,1168,1169,1171,1175,1177,1185,1189,1195,1197,1200,1203,1208,1214,1218,1219,1222,1224,1229,1232,1237,1240,1245,1252,1253,1257,1259,1
8,939,942,947,950,955,958,960,964,972,974,979,985,986,990,993,996,1001,1010,1015,1021,1022,1025,1028,1032,1036,1040,1044,1050,1051,1055,1058,1061,1068,1073,1079,1083,1088,1094,1095,1098,1100,1103,1108,1115,1116,1119,1124,1128,1129,1133,1137,1142,1145,1148,1153,1156,1163,1168,1169,1171,1175,1177,1185,1189,1195,1197,1200,1203,1208,1214,1218,1219,1222,1224,1229,1232,1237,1240,1245,1252,1253,1257,1259,1263,1265,1273,1276,1281,1289,1293,1294,1296,1298,1301,1310,1314,1319,1324,1327,1333,1334,1336,1342,1346,1351,1354,1358,1359,1362,1370,1373,1378,1386]},"finish_reason":"stop"}],"created":1735541715,"model":"deepseek-chat","system_fingerprint":"fp_f1afce2943","object":"text_completion","usage":{"prompt_tokens":6,"completion_tokens":338,"total_tokens":344,"prompt_cache_hit_tokens":0,"prompt_cache_miss_tokens":6}}
看起来非常杂乱,然后用ai整理了一下格式,省略了具体内容,现在看起来比较清晰了。
{
"id": "1dc2ee32-1e2c-4ad3-bfeb-b17b19ad4f78",
"choices": [
{
"text": "20 years ago, I was a young, single, working woman living in the city. I had a good job, a nice apartment, and a great group of friends. I was happy with my life, but I knew that I wanted more. I wanted to find someone to share my life with, someone who would make me laugh, someone who would be my partner in crime.\n\nI had been on a few dates here and there, but nothing serious. I was starting to think that maybe I was destined to be single forever. But then, one day, I met him.\n\nHe was tall, dark, and handsome, with a smile that could light up a room. We met at a mutual friend's party, and we hit it off immediately. We talked for hours, and I felt like I had known him my whole life. We exchanged numbers, and he asked me out on a date.\n\nOur first date was magical. We went to a fancy restaurant, and we talked and laughed all night. I felt like I was in a fairy tale. We went on more dates, and before I knew it, we were in love.\n\nWe got married a year later, and we've been together ever since. We've had our ups and downs, but we've always been there for each other. He's my best friend, my soulmate, and the love of my life.\n\nLooking back, I can't believe how lucky I am to have found him. He's made my life so much better, and I can't imagine my life without him. I'm so grateful for that fateful night 20 years ago when we met. It changed my life forever.",
"index": 0,
"logprobs": {
"tokens": [...],
"token_logprobs": [...],
"top_logprobs": null,
"text_offset": [...]
},
"finish_reason": "stop"
}
],
"created": 1735541715,
"model": "deepseek-chat",
"system_fingerprint": "fp_f1afce2943",
"object": "text_completion",
"usage": {
"prompt_tokens": 6,
"completion_tokens": 338,
"total_tokens": 344,
"prompt_cache_hit_tokens": 0,
"prompt_cache_miss_tokens": 6
}
}
但是文档中对参数的解释并不清晰。
返回值参数解析
好的,然后我就让deepseek自己来解释一下返回值各参数的含义,解释的还是比较清晰的。
1. id
-
值:
"1dc2ee32-1e2c-4ad3-bfeb-b17b19ad4f78"
-
解释: 这是此次请求的唯一标识符(UUID),用于追踪和识别特定的API调用。
2. choices
-
类型: 数组
-
内容: 包含一个或多个生成文本的结果。
-
text
: 生成的文本内容。-
值: 一段关于20年前的生活回忆,描述了作者如何遇到她的伴侣并最终结婚的故事。
-
-
index
: 生成文本的索引。-
值:
0
,表示这是第一个(也是唯一一个)生成结果。
-
-
logprobs
: 生成文本中每个token的对数概率。-
tokens
: 生成文本被分解成的token列表。 -
token_logprobs
: 每个token的对数概率,表示模型对该token的置信度。 -
top_logprobs
: 未使用,值为null
。 -
text_offset
: 每个token在生成文本中的起始位置。
-
3. created
-
值:
1735541715
-
解释: 这是请求创建的时间戳,表示自1970年1月1日以来的秒数。
4. model
-
值:
"deepseek-chat"
-
解释: 使用的模型名称,这里是
deepseek-chat
,表示这是一个用于对话生成的模型。
5. system_fingerprint
-
值:
"fp_f1afce2943"
-
解释: 系统指纹,用于标识生成文本的系统或配置。
6. object
-
值:
"text_completion"
-
解释: 表示返回的对象类型,这里是文本生成任务的结果。
7. usage
-
类型: 对象
-
内容: 包含此次请求的token使用情况。
-
prompt_tokens
: 输入提示(prompt)使用的token数量。-
值:
6
-
-
completion_tokens
: 生成文本使用的token数量。-
值:
338
-
-
total_tokens
: 总共使用的token数量。-
值:
344
-
-
prompt_cache_hit_tokens
: 提示缓存命中的token数量。-
值:
0
-
-
prompt_cache_miss_tokens
: 提示缓存未命中的token数量。-
值:
6
-
-