Skip to content

Commit 44900e7

Browse files
committed
testing fixes - vertex ai deprecated claude 3 sonnet models
1 parent 900c7f4 commit 44900e7

File tree

1 file changed

+1
-46
lines changed

1 file changed

+1
-46
lines changed

tests/local_testing/test_amazing_vertex_completion.py

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -167,51 +167,6 @@ async def test_get_response():
167167
pytest.fail(f"An error occurred - {str(e)}")
168168

169169

170-
@pytest.mark.asyncio
171-
@pytest.mark.flaky(retries=3, delay=1)
172-
async def test_get_router_response():
173-
model = "claude-3-5-sonnet@20240620"
174-
vertex_ai_project = "pathrise-convert-1606954137718"
175-
vertex_ai_location = "asia-southeast1"
176-
json_obj = get_vertex_ai_creds_json()
177-
vertex_credentials = json.dumps(json_obj)
178-
179-
prompt = '\ndef count_nums(arr):\n """\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([]) == 0\n >>> count_nums([-1, 11, -11]) == 1\n >>> count_nums([1, 1, 2]) == 3\n """\n'
180-
try:
181-
router = litellm.Router(
182-
model_list=[
183-
{
184-
"model_name": "sonnet",
185-
"litellm_params": {
186-
"model": "vertex_ai/claude-3-5-sonnet@20240620",
187-
"vertex_ai_project": vertex_ai_project,
188-
"vertex_ai_location": vertex_ai_location,
189-
"vertex_credentials": vertex_credentials,
190-
},
191-
}
192-
]
193-
)
194-
response = await router.acompletion(
195-
model="sonnet",
196-
messages=[
197-
{
198-
"role": "system",
199-
"content": "Complete the given code with no more explanation. Remember that there is a 4-space indent before the first line of your generated code.",
200-
},
201-
{"role": "user", "content": prompt},
202-
],
203-
mock_response="Hello, how are you?",
204-
)
205-
206-
print(f"\n\nResponse: {response}\n\n")
207-
208-
except litellm.ServiceUnavailableError:
209-
pass
210-
except litellm.UnprocessableEntityError as e:
211-
pass
212-
except Exception as e:
213-
pytest.fail(f"An error occurred - {str(e)}")
214-
215170

216171
@pytest.mark.skip(
217172
reason="Local test. Vertex AI Quota is low. Leads to rate limit errors on ci/cd."
@@ -880,7 +835,7 @@ def test_gemini_pro_grounding(value_in_dict):
880835

881836
# @pytest.mark.skip(reason="exhausted vertex quota. need to refactor to mock the call")
882837
@pytest.mark.parametrize(
883-
"model", ["vertex_ai_beta/gemini-1.5-pro", "vertex_ai/claude-3-5-sonnet@20240620"]
838+
"model", ["vertex_ai_beta/gemini-1.5-pro"]
884839
) # "vertex_ai",
885840
@pytest.mark.parametrize("sync_mode", [True]) # "vertex_ai",
886841
@pytest.mark.asyncio

0 commit comments

Comments
 (0)