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 ci tests/lint #1

Merged
merged 10 commits into from
Dec 21, 2023
Merged

add ci tests/lint #1

merged 10 commits into from
Dec 21, 2023

Conversation

mxyng
Copy link
Collaborator

@mxyng mxyng commented Dec 20, 2023

TODO:

  • type hints
  • docstrings
  • concrete types
    • message
    • options
    • requests
    • responses

@mxyng mxyng force-pushed the mxyng/tests branch 2 times, most recently from 9903840 to 319037d Compare December 20, 2023 20:14
@mxyng mxyng force-pushed the mxyng/tests branch 3 times, most recently from f45c8d4 to eedfcc2 Compare December 21, 2023 01:57
### Using the Synchronous Client

```python
from ollama import Client
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this much different than just calling ollama.chat?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you can change the base url. ollama.chat uses the default base url of https://127.0.0.1:11434. Client will likely need to support other things like TLS and proxies pretty soon

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, so this is using a "custom client" effectively

README.md Outdated Show resolved Hide resolved
Requires Python 3.8 or higher.

```sh
pip install ollama
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

README.md Show resolved Hide resolved
@jmorganca
Copy link
Member

jmorganca commented Dec 21, 2023

Looking very solid - a few minor README.md comments and we can continue to iterate on main

return response.json()

async def _stream(self, method, url, **kwargs):
async def inner():
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary because _stream needs to return a coroutine and a generator. Otherwise the caller will need to decide whether to return await or just return based on stream since an async generator cannot be awaited

@mxyng mxyng force-pushed the mxyng/tests branch 3 times, most recently from 8f3029b to 677be58 Compare December 21, 2023 22:04
@mxyng mxyng merged commit 187bd29 into main Dec 21, 2023
5 checks passed
@mxyng mxyng deleted the mxyng/tests branch December 21, 2023 23:06
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