Skip to content

Commit 2cc85da

Browse files
authored
Removed upper bound on LiteLLM version (#255)
Removed upper bound on LiteLLM version Signed-off-by: Mandana Vaziri <[email protected]>
1 parent 8a54239 commit 2cc85da

20 files changed

+59
-36
lines changed

pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ disable=
1818
too-many-branches,
1919
too-many-statements,
2020
too-few-public-methods,
21-
duplicate-code
21+
duplicate-code,
22+
wrong-import-position
2223

2324
load-plugins=pylint.extensions.docparams,pylint.extensions.bad_builtin

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies = [
1313
"jinja2~=3.0",
1414
"PyYAML~=6.0",
1515
"jsonschema~=4.0",
16-
"litellm>=1.49,<1.51",
16+
"litellm>=1.49",
1717
"termcolor~=2.0",
1818
"ipython~=8.0",
1919
]

src/pdl/pdl_interpreter.py

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,30 @@
66
import sys
77
import types
88

9+
# TODO: temporarily disabling warnings to mute a pydantic warning from liteLLM
10+
import warnings
11+
12+
warnings.filterwarnings("ignore", "Valid config keys have changed in V2")
13+
914
# from itertools import batched
10-
from pathlib import Path
11-
from typing import Any, Generator, Optional, Sequence, TypeVar
15+
from pathlib import Path # noqa: E402
16+
from typing import Any, Generator, Optional, Sequence, TypeVar # noqa: E402
1217

13-
import httpx
14-
import litellm
15-
import yaml
16-
from jinja2 import (
18+
import httpx # noqa: E402
19+
import litellm # noqa: E402
20+
import yaml # noqa: E402
21+
from jinja2 import ( # noqa: E402
1722
Environment,
1823
StrictUndefined,
1924
Template,
2025
TemplateSyntaxError,
2126
UndefinedError,
2227
)
23-
from jinja2.nodes import TemplateData
24-
from jinja2.runtime import Undefined
25-
from pydantic import BaseModel
28+
from jinja2.nodes import TemplateData # noqa: E402
29+
from jinja2.runtime import Undefined # noqa: E402
30+
from pydantic import BaseModel # noqa: E402
2631

27-
from .pdl_ast import (
32+
from .pdl_ast import ( # noqa: E402
2833
AdvancedBlockType,
2934
ArrayBlock,
3035
BamModelBlock,
@@ -66,11 +71,11 @@
6671
TextBlock,
6772
empty_block_location,
6873
)
69-
from .pdl_dumper import block_to_dict
70-
from .pdl_llms import BamModel, LitellmModel
71-
from .pdl_location_utils import append, get_loc_string
72-
from .pdl_parser import PDLParseError, parse_file, parse_str
73-
from .pdl_scheduler import (
74+
from .pdl_dumper import block_to_dict # noqa: E402
75+
from .pdl_llms import BamModel, LitellmModel # noqa: E402
76+
from .pdl_location_utils import append, get_loc_string # noqa: E402
77+
from .pdl_parser import PDLParseError, parse_file, parse_str # noqa: E402
78+
from .pdl_scheduler import ( # noqa: E402
7479
CodeYieldResultMessage,
7580
GeneratorWrapper,
7681
ModelCallMessage,
@@ -80,8 +85,8 @@
8085
YieldResultMessage,
8186
schedule,
8287
)
83-
from .pdl_schema_validator import type_check_args, type_check_spec
84-
from .pdl_utils import (
88+
from .pdl_schema_validator import type_check_args, type_check_spec # noqa: E402
89+
from .pdl_utils import ( # noqa: E402
8590
get_contribute_value,
8691
messages_concat,
8792
messages_to_str,

tests/data/line/hello14.pdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
description: Hello world with model chaining
22
text:
33
- Hello,
4-
- model: watsonx/ibm/granite-34b-code-instruct
4+
- model: watsonx_text/ibm/granite-34b-code-instruct
55
def: GEN
66
parameters:
77
stop:
@@ -16,7 +16,7 @@ text:
1616
return:
1717
lastOf:
1818
- "\nTranslate the sentence '${ sentence }' to ${ language }\n"
19-
- model: watsonx/ibm/granite-20b-multilingual
19+
- model: watsonx_text/ibm/granite-20b-multilingual
2020
parameters:
2121
stop:
2222
- '!'

tests/data/line/hello16.pdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ text:
55
def: data
66
contribute: []
77
spec: { "questions": ["str"], "answers": ["obj"] }
8-
- model: watsonx/ibm/granite-20b-code-instruct
8+
- model: watsonx_text/ibm/granite-20b-code-instruct
99
def: model_output
1010
spec: {"bob": int, "carol": str}
1111
input:

tests/data/line/hello19.pdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
description: Hello world to call into a model
22
defs:
3-
model: watsonx/ibm/granite-34b-code-instruct
3+
model: watsonx_text/ibm/granite-34b-code-instruct
44
text:
55
- Hello,
66
- model: ${ models }

tests/data/line/hello24.pdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
description: Hello world with model chaining
22
text:
33
- Hello,
4-
- model: watsonx/ibm/granite-34b-code-instruct
4+
- model: watsonx_text/ibm/granite-34b-code-instruct
55
def: GEN
66
parameters:
77
stop:
@@ -16,7 +16,7 @@ text:
1616
return:
1717
lastOf:
1818
- "\nTranslate the sentence '${ sentence }' to ${ language }\n"
19-
- model: watsonx/ibm/granite-34b-code-instruct
19+
- model: watsonx_text/ibm/granite-34b-code-instruct
2020
parameters:
2121
mock_response: " World!"
2222
- call: ${ translate }

tests/data/line/hello25.pdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
description: Hello world with model chaining
22
text:
33
- Hello,
4-
- model: watsonx/ibm/granite-34b-code-instruct
4+
- model: watsonx_text/ibm/granite-34b-code-instruct
55
def: GEN
66
parameters:
77
stop:
@@ -14,7 +14,7 @@ text:
1414
return:
1515
lastOf:
1616
- "\nTranslate the sentence '${ sentence1 }' to ${ language }\n"
17-
- model: watsonx/ibm/granite-20b-multilingual
17+
- model: watsonx_text/ibm/granite-20b-multilingual
1818
parameters:
1919
stop:
2020
- "!"

tests/data/line/hello26.pdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ text:
55
def: data
66
contribute: []
77
spec: { "questions": ["str"], "answers": ["obj"] }
8-
- model: watsonx/ibm/granite-34b-code-instruct
8+
- model: watsonx_text/ibm/granite-34b-code-instruct
99
def: model_output
1010
input:
1111
text:

tests/data/line/hello27.pdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ text:
55
def: data
66
contribute: []
77
spec: { "questions": ["str"], "answers": ["obj"] }
8-
- model: watsonx/ibm/granite-34b-code-instruct
8+
- model: watsonx_text/ibm/granite-34b-code-instruct
99
def: model_output
1010
input:
1111
text:

0 commit comments

Comments
 (0)