Parth Sareen
967fd657f1
client: improve error messaging on connection failure ( #398 )
...
*iImprove error messaging on connection failure
2025-01-16 13:55:17 -08:00
Samhita Alla
eefe5c9666
remove sha256 as it's already available in the digest ( #420 )
2025-01-15 22:31:30 -08:00
Aarni Koskela
89e719ab92
chore: bump ruff and ensure imports are sorted ( #385 )
...
* chore: upgrade ruff & sort imports
2025-01-14 16:34:16 -08:00
ParthSareen
d9746ead51
fix stuff
2025-01-13 17:25:49 -08:00
ParthSareen
c7d4f1674a
Revert "make 3.8 happy"
...
This reverts commit ba27e71a20 .
2025-01-13 17:23:38 -08:00
ParthSareen
ba27e71a20
make 3.8 happy
2025-01-13 17:17:10 -08:00
Patrick Devine
2434443b88
whackamole
2025-01-13 16:57:17 -08:00
Patrick Devine
2be0bcf92a
python <3.9 errors
2025-01-13 16:51:59 -08:00
Patrick Devine
fc8585eabd
feed ruff
2025-01-13 16:42:31 -08:00
Patrick Devine
f5c8ee0a3e
fix async client
2025-01-13 15:54:16 -08:00
Patrick Devine
a0388b2e32
unhide create_blob
2025-01-13 15:22:26 -08:00
ParthSareen
f718dab45d
Make ruff happy
2025-01-13 15:01:02 -08:00
Patrick Devine
4dec73e8be
add unit tests
2025-01-13 14:53:10 -08:00
ParthSareen
4f9fb88137
Add custom serializer for CreateRequest + tests
2025-01-13 11:03:18 -08:00
ParthSareen
bee11029f7
Model serializer to handler from keyword
2025-01-12 23:19:44 -08:00
Patrick Devine
427b0c6291
create api
2025-01-12 22:48:16 -08:00
Parth Sareen
ee349ecc6d
bugfix: fix passing Image type in messages for chat ( #390 )
...
---------
Co-authored-by: Aarni Koskela <akx@iki.fi>
2024-12-29 14:43:07 -08:00
Aarni Koskela
9057705bc0
fix: export Image model
...
Allows construction of `Message(..., images=Image(value=...))` without having to import from `._types`
2024-12-17 13:31:25 +02:00
Jeffrey Morgan
1066246ab5
fix validation of format field to allow empty strings as it did previously ( #369 )
2024-12-07 19:37:55 -08:00
Parth Sareen
4b10dee2b2
Structured outputs support with examples ( #354 )
2024-12-05 15:40:49 -08:00
Parth Sareen
d6528cf731
Fix image serialization for long image string ( #348 )
2024-11-28 14:12:55 -08:00
Julia Scheaffer
b50a65b27d
Add Callable type annotation for Tools ( #344 )
2024-11-27 09:53:26 -08:00
Jeffrey Morgan
d4c38978d1
Update ollama/_types.py
...
Co-authored-by: Parth Sareen <parth.sareen@ollama.com>
2024-11-26 10:41:53 -08:00
Jeffrey Morgan
d8d98e17b2
Update ollama/_types.py
...
Co-authored-by: Parth Sareen <parth.sareen@ollama.com>
2024-11-26 10:41:50 -08:00
Jeffrey Morgan
ec2c8fdd8d
Update ollama/_types.py
...
Co-authored-by: Parth Sareen <parth.sareen@ollama.com>
2024-11-26 10:41:45 -08:00
Jeffrey Morgan
ea0e0dc692
Update ollama/_types.py
...
Co-authored-by: Parth Sareen <parth.sareen@ollama.com>
2024-11-26 10:35:57 -08:00
jmorganca
2095fc9107
make subscription methods more consistent with maps
2024-11-23 19:02:28 -08:00
jmorganca
1e22f2e118
add test case for explicit None
2024-11-23 18:22:38 -08:00
jmorganca
00c64332cc
check defaults that aren't None too
2024-11-23 18:15:05 -08:00
Michael Yang
c6ade633b8
fix: hasattr checks if attr is None
2024-11-23 16:44:09 -08:00
Parth Sareen
64c1eb78ff
Examples refactor ( #329 )
...
* Examples and README updates
---------
Co-authored-by: fujitatomoya <tomoya.fujita825@gmail.com>
Co-authored-by: Michael Yang <mxyng@pm.me>
2024-11-21 15:14:59 -08:00
Parth Sareen
139c89e833
Passing Functions as Tools ( #321 )
...
* Functions can now be passed as tools
2024-11-20 15:49:50 -08:00
Michael Yang
dc38fe4675
Merge pull request #277 from ollama/mxyng/no-head
...
no head request for create blob
2024-11-08 11:20:43 -08:00
Parth Sareen
72052188c3
Fixing empty header + ensuring security ( #313 )
...
* Fixing empty header + ensuring security
2024-11-08 10:03:14 -08:00
Parth Sareen
f25834217b
Pydantic Fixes and Tests ( #311 )
...
* Added SubscriptableBaseModel to the Model classes and added Image codec test
---------
Co-authored-by: Parth Sareen <parth@Parths-MacBook-Pro.local>
2024-11-08 10:02:55 -08:00
Michael Yang
b0da4ff2d8
no head
...
this request is unnecessary since the POST will short circuit the
request if the blob already exists
2024-11-08 09:59:04 -08:00
Michael Yang
0bbc246007
pydantic types
2024-11-08 09:59:03 -08:00
Patrick Devine
eff2afd827
update docs
2024-09-12 16:49:38 -07:00
Oscar Neira
81edab1b64
_stream in async client raises RuntimeError processing HTTP errors ( #266 )
...
Fixes a bug processing errors in async client. When response in _stream has an HTTP error, the process raises a RuntimeError("Attempted to call a sync iterator on an async stream.") due to use of e.response.read() instead of await e.response.aread()
2024-08-29 16:45:57 -07:00
Johannes Binder
d98f646929
IPv6 support ( #262 )
...
* Support IPv6 host addresses
* Add missing tests
* Integrate feedback review to make it generally more stable and remove redundancies
* Remove unused import
* Fix formatting
2024-08-27 16:51:14 -07:00
Ben Plunkert
dfdeb7cef3
Add URL path to client URL in in Client._parse_host() ( #170 )
...
* Add URL path to client URL in in Client._parse_host()
* add tests for url path
* improve URL path handling
* restore trailing space
* remove extraneous path assignment
* Fix url path test
Co-authored-by: Michael Yang <mxyng@pm.me>
---------
Co-authored-by: Ben Plunkert <ben@plunkert.com>
Co-authored-by: Michael Yang <mxyng@pm.me>
2024-08-23 13:09:45 -07:00
Denis Shulyaka
8b694bb0f4
Update Message annotations to support tool calls ( #227 )
2024-07-29 10:39:09 -07:00
Jeel Rupapara
cbf0887573
fix: update name of toolcallfunction parameter ( #236 )
2024-07-29 10:33:24 -07:00
royjhan
33c4b61ff9
add insert support to generate endpoint ( #215 )
...
* add suffix
* update fill-in-the-middle example
* keep example
* lint
* variables
2024-07-18 11:04:17 -07:00
royjhan
b0ea6d9e44
Support api/embed ( #208 )
...
* api/embed
* api/embed
* api/embed
* rm legacy
2024-07-18 10:40:30 -07:00
Josh
359c63daa7
integrate tool calls ( #213 )
2024-07-17 09:40:49 -07:00
royjhan
ce56f279e8
Add type overloads to methods ( #181 )
...
* Add type overloads for chat() method in _client.py
* Overloading
* Fix Overload Overlap
* Fix async chat
* Lint
* Reverse
---------
Co-authored-by: Simon Ottenhaus <simon.ottenhaus@kenbun.de>
2024-06-19 16:10:44 -07:00
Michael Yang
d25c4aa1cf
Merge pull request #129 from davep/mark-as-typed
...
Add py.typed to mark the library as typed
2024-06-05 11:59:39 -07:00
Michael Yang
57c597b60e
Merge pull request #158 from tillfalko/main
...
Avoid side effects if chat message contains images
2024-06-05 11:28:41 -07:00
royjhan
d5316d023a
Python API PS ( #177 )
...
* Python API PS
* PS Rename
* Readme
2024-06-05 11:12:32 -07:00