Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use setters pattern for fullURL method #636

Open
sashabaranov opened this issue Jan 15, 2024 · 0 comments
Open

Use setters pattern for fullURL method #636

sashabaranov opened this issue Jan 15, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@sashabaranov
Copy link
Owner

sashabaranov commented Jan 15, 2024

Currently client's fullURL method expects optional first argument to be an Azure model name:

// fullURL returns full URL for request.
// args[0] is model name, if API type is Azure, model name is required to get deployment name.
func (c *Client) fullURL(suffix string, args ...any) string {

Let's make this more straighforward by using setters pattern similar to newRequest method:

func (c *Client) newRequest(ctx context.Context, method, url string, setters ...requestOption) (*http.Request, error) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant