Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pkg/model/provider/dmr/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,15 @@ func (c *Client) CreateChatCompletionStream(ctx context.Context, messages []chat
slog.Debug("Adding tools to DMR request", "tool_count", len(requestTools))
request.Tools = make([]openai.Tool, len(requestTools))
for i, tool := range requestTools {
// DMR requires the `description` key to be present; ensure a non-empty value
// NOTE(krissetto): workaround, remove when fixed upstream, this shouldn't be necceessary
desc := tool.Function.Description
if desc == "" {
desc = "Function " + tool.Function.Name
}
fd := &openai.FunctionDefinition{
Name: tool.Function.Name,
Description: tool.Function.Description,
Description: desc,
Strict: tool.Function.Strict,
}
if len(tool.Function.Parameters.Properties) == 0 {
Expand Down
Loading