We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import ollama from 'ollama/dist/browser'; const response = await ollama.chat({ model: 'llama3.2:1b', messages: [{ role: 'user', content: 'Why is the sky blue?', }], });
While using with react-native, it throws the below error
[TypeError: Cannot read property 'toLowerCase' of undefined]
After debugging it seems the error is thrown in getPlatform() on line#95 This is because navigator.platform is deprecated.
getPlatform()
navigator.platform
(In case someone is stuck here as well)
const fetchResponse = await fetch('http://localhost:11434/api/chat', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'llama3.2:1b', messages: [{ role: 'user', content: 'Why is the sky blue?', }], stream: false }), }); const response = await fetchResponse.json();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Usage
Issue
While using with react-native, it throws the below error
RootCause
After debugging it seems the error is thrown in
getPlatform()
on line#95This is because
navigator.platform
is deprecated.Workaround
(In case someone is stuck here as well)
The text was updated successfully, but these errors were encountered: