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

add ability to create a client without env file #4451

Closed
wants to merge 1 commit into from

Conversation

Tyrell04
Copy link

If you use Ollama as a Go package, you are forced to use an environment variable as a configuration to change the host. With the CreateClient function, you are free to use your own configuration passed into the Ollama client.

@pdevine
Copy link
Contributor

pdevine commented May 18, 2024

Hey @Tyrell04 thanks for submitting the PR, but you can already do this w/ NewClient() in client.go. I'm going to go ahead and close the PR.

@pdevine pdevine closed this May 18, 2024
@Tyrell04
Copy link
Author

How could I implement an alternative method to create a client that is not using an env variable? The Problem with the given implementation is that I am forced to use env as config for my project.

@pdevine
Copy link
Contributor

pdevine commented May 19, 2024

@Tyrell04 you just call api.NewClient(). The function header looks like: NewClient(base *url.URL, http *http.Client), so just pass it a url.URL object and an http client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants