-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stop using sdk config file for nua tests (#127)
- Loading branch information
Showing
13 changed files
with
85 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import pytest | ||
from nuclia.sdk.predict import AsyncNucliaPredict | ||
|
||
from nuclia.lib.nua import AsyncNuaClient | ||
from regional.models import ALL_LLMS | ||
|
||
|
||
@pytest.mark.asyncio_cooperative | ||
@pytest.mark.parametrize("model", ALL_LLMS) | ||
async def test_llm_generate(nua_config, model): | ||
async def test_llm_generate(nua_config: AsyncNuaClient, model): | ||
np = AsyncNucliaPredict() | ||
generated = await np.generate("Which is the capital of Catalonia?", model=model) | ||
generated = await np.generate( | ||
"Which is the capital of Catalonia?", model=model, nc=nua_config | ||
) | ||
assert "Barcelona" in generated.answer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
from nuclia.sdk.predict import AsyncNucliaPredict | ||
import pytest | ||
from nuclia.lib.nua import AsyncNuaClient | ||
|
||
|
||
@pytest.mark.asyncio_cooperative | ||
async def test_llm_schema_nua(nua_config): | ||
async def test_llm_schema_nua(nua_config: AsyncNuaClient): | ||
np = AsyncNucliaPredict() | ||
config = await np.schema() | ||
config = await np.schema(nc=nua_config) | ||
|
||
assert len(config.ner_model.options) == 1 | ||
assert len(config.generative_model.options) >= 5 | ||
|
||
|
||
@pytest.mark.asyncio_cooperative | ||
async def test_llm_schema_kbid(nua_config): | ||
async def test_llm_schema_kbid(nua_config: AsyncNuaClient): | ||
np = AsyncNucliaPredict() | ||
config = await np.schema("fake_kbid") | ||
config = await np.schema("fake_kbid", nc=nua_config) | ||
assert len(config.ner_model.options) == 1 | ||
assert len(config.generative_model.options) >= 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.