Skip to content

Incorrect finish reason for streaming tool calls #50

@subnix

Description

@subnix

Swama always returns finish_reason: stop for streaming responses, but it should return finish_reason: tool_calls if the model returned any tool calls.

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
]
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions