本帖最后由 丙丁先生 于 2024-6-18 19:30 编辑
零一万物大模型开放平台 第三天
RAG 模型同步调用HTTP 示例· 请求 Powershell输入: PS C:\Users\Administrator> Invoke-WebRequest -Uri 'https://api.lingyiwanwu.com/v1/chat/completions' -Method POST -Headers @{ >> "Authorization" = "Bearer fa75942eb8914a57bdddb44af543164f"; >> "Content-Type" = "application/json" >> } -Body '{ >> "temperature": 0.3, >> "model": "yi-large-rag", >> "stream": true, >> "max_tokens": 3000, >> "messages": [ >> { >> "role": "user", >> "content": "How is the weather in Los Angeles today?" >> } >> }' -UseBasicParsing >>>>输出: StatusCode : 200 StatusDescription : OK Content : data: {"id":"cmpl-2qoiepzt","object":"chat.completion.chunk","created":1718674701,"model":"yi-large-rag","choices":[{"delt a":{"content":""},"index":0}],"content":"","lastOne":false} data: {"id":"cmpl... RawContent : HTTP/1.1 200 OK Transfer-Encoding: chunked Connection: keep-alive Vary: Accept-Encoding,Origin,Access-Control-Request-Method,Access-Control-Request-Headers trace-id: 482f6e103b68c1b315d0e28aedd37b... Forms : Headers : {[Transfer-Encoding, chunked], [Connection, keep-alive], [Vary, Accept-Encoding,Origin,Access-Control-Request-Method,Acces s-Control-Request-Headers], [trace-id, 482f6e103b68c1b315d0e28aedd37b32]...} Images : {} InputFields : {} Links : {} ParsedHtml : RawContentLength : 21588 解释: 这是一个HTTP响应,状态码为200,表示请求成功。响应内容是一个包含聊天信息的JSON对象。其中: 问: "How is the weather in Los Angeles today?" 答: 未显示 分析:未知原因
|