Closed utopeadia closed 3 months ago
相似问题:隔壁oneapi的讨论:https://github.com/songquanpeng/one-api/issues/1408 gemini的流式返回包含大量"finish_reason":"stop",软件适配过程直接使用oneapi兼容接入可能会把finish_reason作为判断依据之一,希望能够将除了data: [DONE]最近的"finish_reason":"stop"之外的中间输出此字段删除。
data: { "id": "chatcmpl-00b12909dea748258b3bf38c9d2e7340", "object": "chat.completion.chunk", "created": 1721379147, "model": "gemini", "system_fingerprint": null, "choices": [ { "delta": { "content": "你好" }, "logprobs": null, "finish_reason": "stop", "index": 0 } ], "usage": null } data: { "id": "chatcmpl-00b12909dea748258b3bf38c9d2e7340", "object": "chat.completion.chunk", "created": 1721379147, "model": "gemini", "system_fingerprint": null, "choices": [ { "delta": { "content": "!很高兴认识你。请问有什么关于计算机科学或人工智能方面的问题需要" }, "logprobs": null, "finish_reason": "stop", "index": 0 } ], "usage": null } data: { "id": "chatcmpl-00b12909dea748258b3bf38c9d2e7340", "object": "chat.completion.chunk", "created": 1721379147, "model": "gemini", "system_fingerprint": null, "choices": [ { "delta": { "content": "我解答吗?我会尽力提供准确、详细和深入的答案。" }, "logprobs": null, "finish_reason": "stop", "index": 0 } ], "usage": null } data: { "id": "chatcmpl-00b12909dea748258b3bf38c9d2e7340", "object": "chat.completion.chunk", "created": 1721379147, "model": "gemini", "system_fingerprint": null, "choices": [ { "delta": { "content": " 😊 \n" }, "logprobs": null, "finish_reason": "stop", "index": 0 } ], "usage": null } data: { "id": "chatcmpl-00b12909dea748258b3bf38c9d2e7340", "object": "chat.completion.chunk", "created": 1721379147, "model": "gemini-1.5-pro-latest", "system_fingerprint": null, "choices": [], "usage": { "prompt_tokens": 43, "completion_tokens": 34, "total_tokens": 77 } } data: [DONE]
这两天被gemini气到没脾气了
gemini整的一手好活
相似问题:隔壁oneapi的讨论:https://github.com/songquanpeng/one-api/issues/1408 gemini的流式返回包含大量"finish_reason":"stop",软件适配过程直接使用oneapi兼容接入可能会把finish_reason作为判断依据之一,希望能够将除了data: [DONE]最近的"finish_reason":"stop"之外的中间输出此字段删除。