Skip to content

stop using sdk config file for nua tests (#127)

Sign in for the full log view
GitHub Actions / JUnit Test Report failed Dec 28, 2024 in 0s

270 tests run, 89 passed, 180 skipped, 1 failed.

Annotations

Check failure on line 58 in nua/e2e/regional/test_predict.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_predict.test_predict_rephrase[https://europe-1.stashify.cloud-gemini-1-5-pro-vision]

nuclia.exceptions.NuaAPIException: Exception calling NUA API: 429 {"detail":"Rate limited by google for model gemini-1-5-pro-vision"}
Raw output
nua_config = <nuclia.lib.nua.AsyncNuaClient object at 0x7f23673652b0>
model = 'gemini-1-5-pro-vision'

    @pytest.mark.asyncio_cooperative
    @pytest.mark.parametrize("model", ALL_LLMS)
    async def test_predict_rephrase(nua_config: AsyncNuaClient, model):
        # Check that rephrase is working for all models
        np = AsyncNucliaPredict()
        # TODO: Test that custom rephrase prompt works once SDK supports it
>       rephrased = await np.rephrase(
            question="Barcelona best coffe", model=model, nc=nua_config
        )

nua/e2e/regional/test_predict.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/nuclia/decorators.py:126: in async_wrapper_checkout_nua
    return await func(*args, **kwargs)
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/nuclia/sdk/predict.py:277: in rephrase
    return (await nc.rephrase(question, user_context, context, model, prompt)).root
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/nuclia/lib/nua.py:609: in rephrase
    return await self._request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <nuclia.lib.nua.AsyncNuaClient object at 0x7f23673652b0>, method = 'POST'
url = 'https://europe-1.stashify.cloud/api/v1/predict/rephrase?model=gemini-1-5-pro-vision'
output = <class 'nuclia.lib.nua_responses.RephraseModel'>
payload = {'question': 'Barcelona best coffe', 'user_context': None, 'user_id': 'USER'}
timeout = 60

    async def _request(
        self,
        method: str,
        url: str,
        output: Type[ConvertType],
        payload: Optional[dict[Any, Any]] = None,
        timeout: int = 60,
    ) -> ConvertType:
        resp = await self.client.request(method, url, json=payload, timeout=timeout)
        if resp.status_code != 200:
>           raise NuaAPIException(code=resp.status_code, detail=resp.content.decode())
E           nuclia.exceptions.NuaAPIException: Exception calling NUA API: 429 {"detail":"Rate limited by google for model gemini-1-5-pro-vision"}

/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/nuclia/lib/nua.py:416: NuaAPIException