File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 52
52
parameters_short .append ((m , d ))
53
53
54
54
55
- @pytest .mark .parametrize ("model" , MODELS )
55
+ @pytest .mark .parametrize ("model" , [ "autots" ] )
56
56
def test_artificial_big (model ):
57
57
all_data = []
58
58
TARGET_COLUMN = "sensor"
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
# -*- coding: utf-8 -*--
3
3
4
- # Copyright (c) 2023 Oracle and/or its affiliates.
4
+ # Copyright (c) 2023, 2024 Oracle and/or its affiliates.
5
5
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
6
6
7
7
import json
@@ -151,7 +151,9 @@ def test_fn(chain: GuardrailSequence):
151
151
self .assertIsInstance (output .data , str )
152
152
self .assertEqual (output .data , "Tell me a joke about cats" )
153
153
self .assertIsInstance (output .info , list )
154
- self .assertEqual (len (output .info ), len (chain .steps ))
154
+ self .assertEqual (
155
+ len (output .info ), len (chain .steps ) if hasattr (chain , "steps" ) else 0
156
+ )
155
157
156
158
self .assert_before_and_after_serialization (test_fn , chain )
157
159
@@ -175,7 +177,6 @@ def test_fn(chain: GuardrailSequence):
175
177
176
178
self .assert_before_and_after_serialization (test_fn , chain )
177
179
178
-
179
180
def test_save_to_file (self ):
180
181
"""Tests saving to file."""
181
182
message = "Let's talk something else."
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
# -*- coding: utf-8 -*--
3
3
4
- # Copyright (c) 2023 Oracle and/or its affiliates.
4
+ # Copyright (c) 2023, 2024 Oracle and/or its affiliates.
5
5
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
6
6
7
7
@@ -142,7 +142,6 @@ def test_llm_chain_serialization_with_oci(self):
142
142
self .assertEqual (llm_chain .llm .model , "my_model" )
143
143
self .assertEqual (llm_chain .input_keys , ["subject" ])
144
144
145
-
146
145
def test_oci_gen_ai_serialization (self ):
147
146
"""Tests serialization of OCI Gen AI LLM."""
148
147
try :
@@ -189,7 +188,7 @@ def test_runnable_sequence_serialization(self):
189
188
190
189
element_1 = kwargs .get ("first" )
191
190
self .assertEqual (element_1 .get ("_type" ), "RunnableParallel" )
192
- step = element_1 .get ("kwargs" ) .get ("steps" ) .get ("text" )
191
+ step = element_1 .get ("kwargs" , dict ()) .get ("steps" , dict ()) .get ("text" , dict () )
193
192
self .assertEqual (step .get ("id" )[- 1 ], "RunnablePassthrough" )
194
193
195
194
element_2 = kwargs .get ("middle" )[0 ]
You can’t perform that action at this time.
0 commit comments