May 17, 2023
Improved Python SDK
We’ve just released a new version of our Python SDK supporting our v4 API!
This brings support for:
- 💬 Chat mode
humanloop.chat(...)
- 📥 Streaming support
humanloop.chat_stream(...)
- 🕟 Async methods
humanloop.acomplete(...)
https://pypi.org/project/humanloop/
Installation
pip install --upgrade humanloop
Example usage
Migration from 0.3.x
For those coming from an older SDK version, this introduces some breaking changes. A brief highlight of the changes:
- The client initialization step of
hl.init(...)
is nowhumanloop = Humanloop(...)
.- Previously
provider_api_keys
could be provided inhl.init(...)
. They should now be provided when constructingHumanloop(...)
client. -
- Previously
hl.generate(...)
’s various call signatures have now been split into individual methods for clarity. The main ones are:humanloop.complete(project, model_config={...}, ...)
for a completion with the specified model config parameters.humanloop.complete_deployed(project, ...)
for a completion with the project’s active deployment.