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

Isomorphic Fetch #2

Merged
merged 2 commits into from
Nov 24, 2023
Merged

Isomorphic Fetch #2

merged 2 commits into from
Nov 24, 2023

Conversation

saul-jb
Copy link
Collaborator

@saul-jb saul-jb commented Nov 21, 2023

I have removed node-fetch in favor of the default fetch implementation or window.fetch making it compatible in both nodejs and the browser.

There is also the ability to pass a custom fetch method if you are in an environment where both window.fetch and global fetch is undefined such as older versions of nodejs:

import { Ollama } from "ollama";
import fetch from "node-fetch";

const ollama = new Ollama({ fetch });

@saul-jb saul-jb merged commit 99bb6fc into ollama:master Nov 24, 2023
@jmorganca
Copy link
Member

Awesome!!

@saul-jb saul-jb mentioned this pull request Jan 24, 2024
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.

2 participants