Skip to content

Commit

Permalink
Merge pull request #684 from thedadams/default-model-provider-set-model
Browse files Browse the repository at this point in the history
fix: ensure default model is parsed when using default model provider
  • Loading branch information
thedadams authored Jul 31, 2024
2 parents 7ff3fa1 + 7646c4b commit c94dd10
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ func (c *Client) Call(ctx context.Context, messageRequest types.CompletionReques
return nil, fmt.Errorf("failed to find remote model %s", messageRequest.Model)
}

_, modelName := types.SplitToolRef(messageRequest.Model)
toolName, modelName := types.SplitToolRef(messageRequest.Model)
if modelName == "" {
// modelName is empty, then the messageRequest.Model is not of the form 'modelName from provider'
// Therefore, the modelName is the toolName
modelName = toolName
}
messageRequest.Model = modelName
return client.Call(ctx, messageRequest, status)
}
Expand Down

0 comments on commit c94dd10

Please sign in to comment.