togethercomputer / together-python

The Official Python Client for Together's API
https://pypi.org/project/together/
Apache License 2.0
24 stars 5 forks source link

Legacy compatibility #87

Closed orangetin closed 5 months ago

orangetin commented 5 months ago

Adds legacy compatibility code for all API classes and functions.

Bumps package version to v1.0.1 and updated github link to https://github.com/togethercomputer/together-python (@orangetin to update repo on 04/05).

Example warnings:

>>> import together
>>> resp = together.Models.list()
<stdin>:1: DeprecationWarning: Call to deprecated function list.
>>> together.api_key = "test"
>>> resp = together.Models.list()
/Users/abhy/coding/github.com/together/.venv/lib/python3.10/site-packages/together/legacy/models.py:18: UserWarning: The use of together.api_key is deprecated and will be removed in the next major release. Please set the TOGETHER_API_KEY environment variable instead.
  warnings.warn(API_KEY_WARNING)