mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 09:05:23 -04:00
Update all examples to use the new Pydantic integration #162
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ParthSareen on GitHub (Nov 6, 2024).
Originally assigned to: @ParthSareen on GitHub.
With the introduction of https://github.com/ollama/ollama-python/pull/276, examples must be updated.
Add appropriate readme updates and create best practices through examples.
@sprior commented on GitHub (Nov 22, 2024):
Is this why I'm getting "Object of type function is not JSON serializable" on the call to chat() in the tools.py example?
@ParthSareen commented on GitHub (Nov 22, 2024):
Hey! Could you drop what version of ollama-python you're on?
pip show ollama@sprior@sprior commented on GitHub (Nov 22, 2024):
Name: ollama
Version: 0.3.3
Summary: The official Python client for Ollama.
Home-page: https://ollama.ai
Author: Ollama
Author-email: hello@ollama.com
License: MIT
Location: c:\Users\sprio\Documents\Python\ollama-client.venv\Lib\site-packages
Requires: httpx
Required-by:
@ParthSareen commented on GitHub (Nov 22, 2024):
Got it. @sprior Could you upgrade to the newest version of the sdk? It's 0.4.0.
@sprior commented on GitHub (Nov 22, 2024):
@ParthSareen ok thanks, working now. Just FYI when I run your examples I seem to have to add client=Client(host='') or else it can't connect, I'm running Windows Ollama and the Python example in VSCode. I'm guessing somehow there the default localhost isn't working. I don't know how common this issue is but maybe make the examples a bit more universal.
@ParthSareen commented on GitHub (Nov 22, 2024):
Thanks for letting me know! Will try to repro :) @sprior