-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Swama always returns finish_reason: stop for streaming responses, but it should return finish_reason: tool_calls if the model returned any tool calls.
swama/swama/Sources/SwamaKit/Server/CompletionsHandler.swift
Lines 700 to 713 in b9d1b86
| let finishJSON: [String: Any] = [ | |
| "id": chunkId, | |
| "object": "chat.completion.chunk", | |
| "created": timestamp, | |
| "model": model, | |
| "choices": [["index": 0, "delta": [:], "finish_reason": "stop"]], | |
| "usage": [ | |
| "prompt_tokens": result.promptTokens, | |
| "completion_tokens": finalCompletionTokens, | |
| "total_tokens": result.promptTokens + finalCompletionTokens, | |
| "response_token/s": tokensPerSecond, | |
| "total_duration": totalDuration | |
| ] | |
| ] |
sxy-trans-n
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working