You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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=awaitrouter.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
-
exceptlitellm.ServiceUnavailableError:
209
-
pass
210
-
exceptlitellm.UnprocessableEntityErrorase:
211
-
pass
212
-
exceptExceptionase:
213
-
pytest.fail(f"An error occurred - {str(e)}")
214
-
215
170
216
171
@pytest.mark.skip(
217
172
reason="Local test. Vertex AI Quota is low. Leads to rate limit errors on ci/cd."
0 commit comments