diff --git a/dsp/primitives/predict.py b/dsp/primitives/predict.py index 6f442f643..bd5ce201b 100644 --- a/dsp/primitives/predict.py +++ b/dsp/primitives/predict.py @@ -63,7 +63,10 @@ def _generate(template: Template, **kwargs) -> Callable: generator = dsp.settings.lm def do_generate( - example: Example, stage: str, max_depth: int = 2, original_example=None + example: Example, + stage: str, + max_depth: int = 2, + original_example=None, ): if not dsp.settings.lm: raise AssertionError("No LM is loaded.") @@ -83,9 +86,7 @@ def do_generate( last_field_idx = 0 for field_idx, key in enumerate(field_names): - completions_ = [ - c for c in completions if key in c.keys() and c[key] is not None - ] + completions_ = [c for c in completions if c.get(key, None) is not None] # Filter out completions that are missing fields that are present in at least one completion. if len(completions_): diff --git a/dspy/adapters/basic_adapter.py b/dspy/adapters/basic_adapter.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/dspy/adapters/chatml_adapter.py b/dspy/adapters/chatml_adapter.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/dspy/adapters/llamachat_adapter.py b/dspy/adapters/llamachat_adapter.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/dspy/adapters/vicuna_adapter.py b/dspy/adapters/vicuna_adapter.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/dspy/adapters/__init__.py b/dspy/backends/__init__.py similarity index 100% rename from dspy/adapters/__init__.py rename to dspy/backends/__init__.py diff --git a/dspy/backends/lm/base.py b/dspy/backends/lm/base.py new file mode 100644 index 000000000..5967f4582 --- /dev/null +++ b/dspy/backends/lm/base.py @@ -0,0 +1,17 @@ +from abc import ABC, abstractmethod + +from pydantic import BaseModel + + +class BaseLM(BaseModel, ABC): + @abstractmethod + def __call__( + self, + prompt: str, + temperature: float, + max_tokens: int, + n: int, + **kwargs, + ) -> list[dict[str, str]]: + """Generates `n` predictions for the signature output.""" + ... diff --git a/dspy/backends/lm/litelm.py b/dspy/backends/lm/litelm.py new file mode 100644 index 000000000..524232d39 --- /dev/null +++ b/dspy/backends/lm/litelm.py @@ -0,0 +1,35 @@ +import typing as t + +from litellm import completion +from pydantic import Field + + +from .base import BaseLM + + +class LiteLM(BaseLM): + STANDARD_PARAMS = { + "temperature": 0.0, + "max_tokens": 150, + "top_p": 1, + "frequency_penalty": 0, + "presence_penalty": 0, + } + + model: str + default_params: dict[str, t.Any] = Field(default_factory=dict) + + def __call__( + self, + prompt: str, + **kwargs, + ) -> list[dict[str, str]]: + """Generates `n` predictions for the signature output.""" + options = {**self.STANDARD_PARAMS, **self.default_params, **kwargs} + response = completion( + model=self.model, + messages=[{"role": "user", "content": prompt}], + **options, + ) + choices = [c for c in response["choices"] if c["finish_reason"] != "length"] + return [c["message"]["content"] for c in choices] diff --git a/dspy/signatures/signature.py b/dspy/signatures/signature.py index bd7ea8d3e..8afe52e38 100644 --- a/dspy/signatures/signature.py +++ b/dspy/signatures/signature.py @@ -1,14 +1,14 @@ from copy import deepcopy import dsp from pydantic import BaseModel, Field, create_model -from typing import Type, Union, Dict, Tuple +from typing import Optional, Union import re from dspy.signatures.field import InputField, OutputField, new_to_old_field -def signature_to_template(signature): - """Convert from new to legacy format""" +def signature_to_template(signature) -> dsp.Template: + """Convert from new to legacy format.""" return dsp.Template( signature.instructions, **{name: new_to_old_field(field) for name, field in signature.fields.items()}, @@ -60,7 +60,10 @@ def instructions(cls) -> str: def with_instructions(cls, instructions: str): return create_model( - cls.__name__, __base__=Signature, __doc__=instructions, **cls.fields + cls.__name__, + __base__=Signature, + __doc__=instructions, + **cls.fields, ) @property @@ -75,17 +78,19 @@ def with_updated_fields(cls, name, **kwargs): **fields_copy[name].json_schema_extra, **kwargs, } - return create_model(cls.__name__, __base__=Signature, __doc__=cls.instructions, **fields_copy) + return create_model( + cls.__name__, __base__=Signature, __doc__=cls.instructions, **fields_copy + ) @property - def input_fields(cls): + def input_fields(cls) -> dict: return cls._get_fields_with_type("input") @property - def output_fields(cls): + def output_fields(cls) -> dict: return cls._get_fields_with_type("output") - def _get_fields_with_type(cls, field_type): + def _get_fields_with_type(cls, field_type) -> dict: return { k: v for k, v in cls.__fields__.items() @@ -98,8 +103,8 @@ def prepend(cls, name, field, type_=None): def append(cls, name, field, type_=None): return cls.insert(-1, name, field, type_) - def insert(cls, index: int, name: str, field, type_: Type = None): - # It's posisble to set the type as annotation=type in pydantic.Field(...) + def insert(cls, index: int, name: str, field, type_: Optional[type] = None): + # It's possible to set the type as annotation=type in pydantic.Field(...) # But this may be annoying for users, so we allow them to pass the type if type_ is not None: field.annotation = type_ @@ -127,7 +132,7 @@ def insert(cls, index: int, name: str, field, type_: Type = None): new_signature.__doc__ = cls.instructions return new_signature - def _parse_signature(cls, signature: str) -> Tuple[Type, Field]: + def _parse_signature(cls, signature: str) -> tuple[type, Field]: pattern = r"^\s*[\w\s,]+\s*->\s*[\w\s,]+\s*$" if not re.match(pattern, signature): raise ValueError(f"Invalid signature format: '{signature}'") @@ -144,7 +149,9 @@ def _parse_signature(cls, signature: str) -> Tuple[Type, Field]: return fields def __call__( - cls, signature: Union[str, Dict[str, Field]], instructions: str = None + cls, + signature: Union[str, dict[str, Field]], + instructions: Optional[str] = None, ): """ Creates a new Signature type with the given fields and instructions. @@ -215,7 +222,6 @@ def ensure_signature(signature): def infer_prefix(attribute_name: str) -> str: """Infers a prefix from an attribute name.""" - # Convert camelCase to snake_case, but handle sequences of capital letters properly s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", attribute_name) intermediate_name = re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1) diff --git a/poetry.lock b/poetry.lock index 9ddddc40a..37d41bd8b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -144,7 +144,7 @@ tz = ["backports.zoneinfo"] name = "annotated-types" version = "0.6.0" description = "Reusable constraint types to use with typing.Annotated" -optional = true +optional = false python-versions = ">=3.8" files = [ {file = "annotated_types-0.6.0-py3-none-any.whl", hash = "sha256:0641064de18ba7a25dee8f96403ebc39113d0cb953a01429249d5c7564666a43"}, @@ -155,7 +155,7 @@ files = [ name = "anyio" version = "4.2.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" -optional = true +optional = false python-versions = ">=3.8" files = [ {file = "anyio-4.2.0-py3-none-any.whl", hash = "sha256:745843b39e829e108e518c489b31dc757de7d2131d53fac32bd8df268227bfee"}, @@ -846,6 +846,17 @@ files = [ [package.extras] graph = ["objgraph (>=1.7.2)"] +[[package]] +name = "distro" +version = "1.9.0" +description = "Distro - an OS platform information API" +optional = false +python-versions = ">=3.6" +files = [ + {file = "distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2"}, + {file = "distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed"}, +] + [[package]] name = "dnspython" version = "2.4.2" @@ -880,7 +891,7 @@ files = [ name = "exceptiongroup" version = "1.2.0" description = "Backport of PEP 654 (exception groups)" -optional = true +optional = false python-versions = ">=3.7" files = [ {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, @@ -1405,7 +1416,7 @@ setuptools = "*" name = "h11" version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" -optional = true +optional = false python-versions = ">=3.7" files = [ {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, @@ -1442,7 +1453,7 @@ files = [ name = "httpcore" version = "1.0.2" description = "A minimal low-level HTTP client." -optional = true +optional = false python-versions = ">=3.8" files = [ {file = "httpcore-1.0.2-py3-none-any.whl", hash = "sha256:096cc05bca73b8e459a1fc3dcf585148f63e534eae4339559c9b8a8d6399acc7"}, @@ -1511,7 +1522,7 @@ test = ["Cython (>=0.29.24,<0.30.0)"] name = "httpx" version = "0.26.0" description = "The next generation HTTP client." -optional = true +optional = false python-versions = ">=3.8" files = [ {file = "httpx-0.26.0-py3-none-any.whl", hash = "sha256:8915f5a3627c4d47b73e8202457cb28f1266982d1159bd5779d86a80c0eab1cd"}, @@ -1897,6 +1908,32 @@ websocket-client = ">=0.32.0,<0.40.0 || >0.40.0,<0.41.dev0 || >=0.43.dev0" [package.extras] adal = ["adal (>=1.0.2)"] +[[package]] +name = "litellm" +version = "1.25.0" +description = "Library to easily interface with LLM API providers" +optional = false +python-versions = ">=3.8, !=2.7.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*" +files = [ + {file = "litellm-1.25.0-py3-none-any.whl", hash = "sha256:2f679776c6292e88c5b5e672a8566ac6e2ffb572a8e4c264ced25c279ce6fb19"}, + {file = "litellm-1.25.0.tar.gz", hash = "sha256:44af5985d7da7ad7b012ffab9f944322fe85de193e2e5325154e678ab8a20216"}, +] + +[package.dependencies] +aiohttp = "*" +click = "*" +importlib-metadata = ">=6.8.0" +jinja2 = ">=3.1.2,<4.0.0" +openai = ">=1.0.0" +python-dotenv = ">=0.2.0" +requests = ">=2.31.0,<3.0.0" +tiktoken = ">=0.4.0" +tokenizers = "*" + +[package.extras] +extra-proxy = ["streamlit (>=1.29.0,<2.0.0)"] +proxy = ["PyJWT (>=2.8.0,<3.0.0)", "apscheduler (>=3.10.4,<4.0.0)", "backoff", "fastapi (>=0.104.1,<0.105.0)", "fastapi-sso (>=0.10.0,<0.11.0)", "gunicorn (>=21.2.0,<22.0.0)", "orjson (>=3.9.7,<4.0.0)", "python-multipart (>=0.0.6,<0.0.7)", "pyyaml (>=6.0.1,<7.0.0)", "rq", "uvicorn (>=0.22.0,<0.23.0)"] + [[package]] name = "livereload" version = "2.6.3" @@ -2809,25 +2846,26 @@ sympy = "*" [[package]] name = "openai" -version = "0.28.1" -description = "Python client library for the OpenAI API" +version = "1.12.0" +description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-0.28.1-py3-none-any.whl", hash = "sha256:d18690f9e3d31eedb66b57b88c2165d760b24ea0a01f150dd3f068155088ce68"}, - {file = "openai-0.28.1.tar.gz", hash = "sha256:4be1dad329a65b4ce1a660fe6d5431b438f429b5855c883435f0f7fcb6d2dcc8"}, + {file = "openai-1.12.0-py3-none-any.whl", hash = "sha256:a54002c814e05222e413664f651b5916714e4700d041d5cf5724d3ae1a3e3481"}, + {file = "openai-1.12.0.tar.gz", hash = "sha256:99c5d257d09ea6533d689d1cc77caa0ac679fa21efef8893d8b0832a86877f1b"}, ] [package.dependencies] -aiohttp = "*" -requests = ">=2.20" -tqdm = "*" +anyio = ">=3.5.0,<5" +distro = ">=1.7.0,<2" +httpx = ">=0.23.0,<1" +pydantic = ">=1.9.0,<3" +sniffio = "*" +tqdm = ">4" +typing-extensions = ">=4.7,<5" [package.extras] -datalib = ["numpy", "openpyxl (>=3.0.7)", "pandas (>=1.2.3)", "pandas-stubs (>=1.1.0.11)"] -dev = ["black (>=21.6b0,<22.0)", "pytest (==6.*)", "pytest-asyncio", "pytest-mock"] -embeddings = ["matplotlib", "numpy", "openpyxl (>=3.0.7)", "pandas (>=1.2.3)", "pandas-stubs (>=1.1.0.11)", "plotly", "scikit-learn (>=1.0.2)", "scipy", "tenacity (>=8.0.1)"] -wandb = ["numpy", "openpyxl (>=3.0.7)", "pandas (>=1.2.3)", "pandas-stubs (>=1.1.0.11)", "wandb"] +datalib = ["numpy (>=1)", "pandas (>=1.2.3)", "pandas-stubs (>=1.1.0.11)"] [[package]] name = "opentelemetry-api" @@ -3477,7 +3515,7 @@ files = [ name = "pydantic" version = "2.5.3" description = "Data validation using Python type hints" -optional = true +optional = false python-versions = ">=3.7" files = [ {file = "pydantic-2.5.3-py3-none-any.whl", hash = "sha256:d0caf5954bee831b6bfe7e338c32b9e30c85dfe080c843680783ac2b631673b4"}, @@ -3496,7 +3534,7 @@ email = ["email-validator (>=2.0.0)"] name = "pydantic-core" version = "2.14.6" description = "" -optional = true +optional = false python-versions = ">=3.7" files = [ {file = "pydantic_core-2.14.6-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:72f9a942d739f09cd42fffe5dc759928217649f070056f03c70df14f5770acf9"}, @@ -3724,7 +3762,7 @@ six = ">=1.5" name = "python-dotenv" version = "1.0.0" description = "Read key-value pairs from a .env file and set them as environment variables" -optional = true +optional = false python-versions = ">=3.8" files = [ {file = "python-dotenv-1.0.0.tar.gz", hash = "sha256:a8df96034aae6d2d50a4ebe8216326c61c3eb64836776504fcca410e5937a3ba"}, @@ -4279,7 +4317,7 @@ files = [ name = "sniffio" version = "1.3.0" description = "Sniff out which async library your code is running under" -optional = true +optional = false python-versions = ">=3.7" files = [ {file = "sniffio-1.3.0-py3-none-any.whl", hash = "sha256:eecefdce1e5bbfb7ad2eeaabf7c1eeb404d7757c379bd1f7e5cce9d8bf425384"}, @@ -4725,11 +4763,63 @@ files = [ [package.extras] doc = ["reno", "sphinx", "tornado (>=4.5)"] +[[package]] +name = "tiktoken" +version = "0.6.0" +description = "tiktoken is a fast BPE tokeniser for use with OpenAI's models" +optional = false +python-versions = ">=3.8" +files = [ + {file = "tiktoken-0.6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:277de84ccd8fa12730a6b4067456e5cf72fef6300bea61d506c09e45658d41ac"}, + {file = "tiktoken-0.6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9c44433f658064463650d61387623735641dcc4b6c999ca30bc0f8ba3fccaf5c"}, + {file = "tiktoken-0.6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:afb9a2a866ae6eef1995ab656744287a5ac95acc7e0491c33fad54d053288ad3"}, + {file = "tiktoken-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c62c05b3109fefca26fedb2820452a050074ad8e5ad9803f4652977778177d9f"}, + {file = "tiktoken-0.6.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:0ef917fad0bccda07bfbad835525bbed5f3ab97a8a3e66526e48cdc3e7beacf7"}, + {file = "tiktoken-0.6.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e095131ab6092d0769a2fda85aa260c7c383072daec599ba9d8b149d2a3f4d8b"}, + {file = "tiktoken-0.6.0-cp310-cp310-win_amd64.whl", hash = "sha256:05b344c61779f815038292a19a0c6eb7098b63c8f865ff205abb9ea1b656030e"}, + {file = "tiktoken-0.6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cefb9870fb55dca9e450e54dbf61f904aab9180ff6fe568b61f4db9564e78871"}, + {file = "tiktoken-0.6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:702950d33d8cabc039845674107d2e6dcabbbb0990ef350f640661368df481bb"}, + {file = "tiktoken-0.6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8d49d076058f23254f2aff9af603863c5c5f9ab095bc896bceed04f8f0b013a"}, + {file = "tiktoken-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:430bc4e650a2d23a789dc2cdca3b9e5e7eb3cd3935168d97d43518cbb1f9a911"}, + {file = "tiktoken-0.6.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:293cb8669757301a3019a12d6770bd55bec38a4d3ee9978ddbe599d68976aca7"}, + {file = "tiktoken-0.6.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:7bd1a288b7903aadc054b0e16ea78e3171f70b670e7372432298c686ebf9dd47"}, + {file = "tiktoken-0.6.0-cp311-cp311-win_amd64.whl", hash = "sha256:ac76e000183e3b749634968a45c7169b351e99936ef46f0d2353cd0d46c3118d"}, + {file = "tiktoken-0.6.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:17cc8a4a3245ab7d935c83a2db6bb71619099d7284b884f4b2aea4c74f2f83e3"}, + {file = "tiktoken-0.6.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:284aebcccffe1bba0d6571651317df6a5b376ff6cfed5aeb800c55df44c78177"}, + {file = "tiktoken-0.6.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0c1a3a5d33846f8cd9dd3b7897c1d45722f48625a587f8e6f3d3e85080559be8"}, + {file = "tiktoken-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6318b2bb2337f38ee954fd5efa82632c6e5ced1d52a671370fa4b2eff1355e91"}, + {file = "tiktoken-0.6.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:1f5f0f2ed67ba16373f9a6013b68da298096b27cd4e1cf276d2d3868b5c7efd1"}, + {file = "tiktoken-0.6.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:75af4c0b16609c2ad02581f3cdcd1fb698c7565091370bf6c0cf8624ffaba6dc"}, + {file = "tiktoken-0.6.0-cp312-cp312-win_amd64.whl", hash = "sha256:45577faf9a9d383b8fd683e313cf6df88b6076c034f0a16da243bb1c139340c3"}, + {file = "tiktoken-0.6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7c1492ab90c21ca4d11cef3a236ee31a3e279bb21b3fc5b0e2210588c4209e68"}, + {file = "tiktoken-0.6.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e2b380c5b7751272015400b26144a2bab4066ebb8daae9c3cd2a92c3b508fe5a"}, + {file = "tiktoken-0.6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c9f497598b9f58c99cbc0eb764b4a92272c14d5203fc713dd650b896a03a50ad"}, + {file = "tiktoken-0.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e65e8bd6f3f279d80f1e1fbd5f588f036b9a5fa27690b7f0cc07021f1dfa0839"}, + {file = "tiktoken-0.6.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:5f1495450a54e564d236769d25bfefbf77727e232d7a8a378f97acddee08c1ae"}, + {file = "tiktoken-0.6.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6c4e4857d99f6fb4670e928250835b21b68c59250520a1941618b5b4194e20c3"}, + {file = "tiktoken-0.6.0-cp38-cp38-win_amd64.whl", hash = "sha256:168d718f07a39b013032741867e789971346df8e89983fe3c0ef3fbd5a0b1cb9"}, + {file = "tiktoken-0.6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:47fdcfe11bd55376785a6aea8ad1db967db7f66ea81aed5c43fad497521819a4"}, + {file = "tiktoken-0.6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fb7d2ccbf1a7784810aff6b80b4012fb42c6fc37eaa68cb3b553801a5cc2d1fc"}, + {file = "tiktoken-0.6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1ccb7a111ee76af5d876a729a347f8747d5ad548e1487eeea90eaf58894b3138"}, + {file = "tiktoken-0.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b2048e1086b48e3c8c6e2ceeac866561374cd57a84622fa49a6b245ffecb7744"}, + {file = "tiktoken-0.6.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:07f229a5eb250b6403a61200199cecf0aac4aa23c3ecc1c11c1ca002cbb8f159"}, + {file = "tiktoken-0.6.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:432aa3be8436177b0db5a2b3e7cc28fd6c693f783b2f8722539ba16a867d0c6a"}, + {file = "tiktoken-0.6.0-cp39-cp39-win_amd64.whl", hash = "sha256:8bfe8a19c8b5c40d121ee7938cd9c6a278e5b97dc035fd61714b4f0399d2f7a1"}, + {file = "tiktoken-0.6.0.tar.gz", hash = "sha256:ace62a4ede83c75b0374a2ddfa4b76903cf483e9cb06247f566be3bf14e6beed"}, +] + +[package.dependencies] +regex = ">=2022.1.18" +requests = ">=2.26.0" + +[package.extras] +blobfile = ["blobfile (>=2)"] + [[package]] name = "tokenizers" version = "0.15.0" description = "" -optional = true +optional = false python-versions = ">=3.7" files = [ {file = "tokenizers-0.15.0-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:cd3cd0299aaa312cd2988957598f80becd04d5a07338741eca076057a2b37d6e"}, @@ -5695,4 +5785,4 @@ qdrant = ["fastembed", "qdrant-client"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.12" -content-hash = "99bd00127b31d0000d1a99122ff54ee6c61a685fa446e0241d4283b0767c7dd4" +content-hash = "18a79a257d412840ff5032cb7e7d11fdb8224cc297b7aefd28790971f39be143" diff --git a/pyproject.toml b/pyproject.toml index 8d8eb7e85..0eb565795 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,18 +18,6 @@ classifiers = [ "Programming Language :: Python :: 3", # removed 3.8 "Programming Language :: Python :: 3.9", ] -dependencies = [ - "backoff~=2.2.1", - "joblib~=1.3.2", - "openai>=0.28.1,<2.0.0", - "pandas~=2.1.1", - "regex~=2023.10.3", - "ujson~=5.8.0", - "tqdm~=4.66.1", - "datasets~=2.14.6", - "requests~=2.31.0", - "optuna~=3.4.0", -] [project.optional-dependencies] pinecone = ["pinecone-client~=2.2.4"] @@ -71,7 +59,6 @@ keywords = ["dspy", "ai", "language models", "llm", "openai"] python = ">=3.9,<3.12" backoff = "^2.2.1" joblib = "^1.3.2" -openai = "^0.28.1" pandas = "^2.1.1" regex = "^2023.10.3" ujson = "^5.8.0" @@ -97,6 +84,7 @@ autodoc_pydantic = { version = "*", optional = true } sphinx-reredirects = { version = "^0.1.2", optional = true } sphinx-automodapi = { version = "0.16.0", optional = true } snoop = "^0.4.3" +litellm = "^1.25.0" [tool.poetry.extras] pinecone = ["pinecone-client"]